plotly / plotly/plotly.js

[BUG]: The `quiver` trace ignores a discrete `marker.color` array and results in every arrow being black

Đang mở
#8,026 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug P2 size: 3
Ngôn ngữ chính
JavaScript
Star
18.3k
Fork
2k
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
28

Mô tả

Description

The quiver trace ignores a discrete marker.color array. Every arrow ends up black instead of taking its per-point color. A numeric array with a colorscale works, and a single color string works.

Screenshots/Video
No colorscale (the bug) With colorscale (for comparison)
Image Image
Steps to reproduce
  • Open plotly devtools
  • Run the following snippet in the browser devtools console
     Plotly.newPlot(gd, [{
       type: 'quiver',
       x: [1, 2, 3], y: [1, 2, 3],
       u: [1, 1, 1], v: [0, 1, 0],
       marker: { color: ['rgb(23, 103, 194)', '#FF4136', '#2ECC40'], line: { width: 3 } }
     }]);
    
  • Note that all three arrows are rgb(0, 0, 0) (by inspection of using your eyes)
  • Run the following modified snippet:
     Plotly.newPlot(gd, [{
       type: 'quiver',
       x: [1, 2, 3], y: [1, 2, 3],
       u: [1, 1, 1], v: [0, 1, 0],
       marker: { color: [0, 5, 10], line: { width: 3 } },
       colorscale: 'Viridis'
     }]);
    
  • Note that the arrows have the correct color
Notes
  • marker.color is documented as arrayOk, so the black arrows seem to be a rendering bug (rather than an unsupported input)
  • Per the schema, each arrow should be drawn as its own color from the array. If this behavior is intentional, we should update the description.
  • This was found while working on #8025

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện vấn đề thông qua các lệnh gọi Plotly.newPlot trong công cụ dành cho nhà phát triển của trình duyệt, bắt đầu với phần triển khai trace quiver. So sánh cách xử lý mảng marker.color rời rạc với trường hợp colorscale dạng số, sau đó xác minh rằng mỗi mũi tên sử dụng màu tương ứng của nó, trong khi các màu đơn và colorscales vẫn tiếp tục hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
data-visualization
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
72/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.