[BUG]: Sankey warning breaks in @plotly/d3-sankey v0.12.3
Chưa có ai nhận issue này.
- 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 upgrade to @plotly/d3-sankey v0.12.3 (in #7830) will break the warning here:
if (sankey.nodePadding() < nodePad) {
Lib.warn('node.pad was reduced to ', sankey.nodePadding(), ' to fit within the figure.');
}
In @plotly/d3-sankey@0.7.x, calling sankey.nodePadding() after running the layout returned the effective (post-clamp) padding value. In 0.12.3 the getter returns the user-configured value instead, because upstream split the internal state into separate dy (configured) and py (effective) variables.
After the upgrade, sankey.nodePadding() always equals nodePad, so the comparison is never true and the warning never fires. The layout itself still clamps correctly - only the diagnostic is affected.
Notes
Options to address the issue:
- Remove the warning entirely
- Derive the effective padding from the laid-out node positions (e.g. measure the gap between consecutive nodes in the densest column)
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu trong src/traces/sankey/render.js tại cảnh báo quanh các dòng 76-78, sau đó so sánh API padding đã được nâng cấp của @plotly/d3-sankey v0.12.3 với vị trí các node đã được layout. Xác định cách phát hiện padding hiệu dụng hoặc liệu có nên loại bỏ cảnh báo hay không, và xác minh rằng hành vi chẩn đoán khớp với layout đã được giới hạn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- d3, 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
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100