plotly / plotly/plotly.js

redraw <chart type> with no changes is not a noop (svg mocks)

Đang mở
#7,347 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 testing
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ả

  • We traced it back to 2.24.0 (https://github.com/plotly/plotly.js/releases/tag/v2.24.0), which includes a group of PR's that correspond to the exact same figure types that are failing. For example, in the sunburst PR, there's a line that updates the trace marker color.
  • From @alexcjohnson:
    • In sunburst/style.js (which is part of the plotting pipeline) we have
    if(marker.pattern) {
        if(!marker.colors || !marker.pattern.shape) marker.color = cdi.color;
    } else {
        marker.color = cdi.color;
    }
    
    • ie we’re changing _fullData during plotting. Which is a big no no. So yeah that’s where the noop is being broken, we should avoid that, which I bet in this case means creating a new mock trace object to pass into Drawing.pointStyle(s, trace, gd, pt); rather than modifying this one. But of course since this has been around for a year and a half, this is not a release blocker.
    • Also I’ll note, the code in question is in styleOne, meaning that it’ll be called once for every segment of the sunburst… so if you do go with a mock trace object, put the object creation up in style (which only happens once per trace) instead of in styleOne, and styleOne can keep reusing that same object.
      If it helps, you’re free to attach new things to the trace object during plotting as long as they start with _.
    • I’m thinking about things like here where we mock an axis in order to reuse logic from regular axis handling in 3D axes… or here where we mock the entire figure in the course of making a new shrunken version of the figure for rangesliders
  • Update after looking into it a bit: The code referenced above is now is fill_one.js. Added in this commit

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

Bắt đầu trong fill_one.js và lần theo đường dẫn style/styleOne đến Drawing.pointStyle(s, trace, gd, pt). Kiểm tra cách các mock SVG và fullData được xử lý trong các lần vẽ lại, đặc biệt là trên các loại biểu đồ bị ảnh hưởng. Hoàn tất khi việc vẽ lại một biểu đồ không thay đổi không làm thay đổi dữ liệu nền và hoạt động như một noop.

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ó
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.