plotly / plotly/react-plotly.js

Coloraxis not properly updated

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

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

Ngôn ngữ chính
JavaScript
Star
1.1k
Fork
138
Merge trung bình
3 ngày 2 giờ
Pull request đã merge (30 ngày)
4

Mô tả

In this codepen example, I have a simple scatterplot with a single data point, and a "coloraxis" marker.

When the datapoint's marker is updated, the coloraxis is not properly updated. Specifically, when the datapoint marker color is incremented or decremented, the coloraxis does not rescale as you'd expect.

For example, when the chart is initialized, the datapoint's color is initialized to 5. The color axis values range from 4-6, as you'd expect:

image

The Data.color++ and Data.color-- buttons increment and decrement the datapoint's color value. But this results in the coloraxis expanding to encompass the datapoint's color value from previous renders. Here, I've incremented and decremented the color a bunch of times, and the color axis' values now range from 0-12:

image

If I force the component to unload and reload (by passing a new React key param to the <Plot/> each time render is called), the issue is fixed. (Also, if I download the plot as a PNG, that PNG looks correct.)

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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

Bắt đầu với ví dụ CodePen được liên kết và lần theo đường dẫn cập nhật của React Plot đối với các thay đổi về màu marker của datapoint. Liên tục sử dụng các control Data.color++ và Data.color--; hoàn tất khi coloraxis được scale lại theo giá trị hiện tại thay vì các giá trị từ những lần render trước, trong khi PNG đã tải xuống vẫn chính xác.

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, react
Lĩnh vực
data-visualization, frontend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/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.