`autorange` throws when y range is small
Đang mở
Chưa có ai nhận issue này.
bug
P2
- 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ả
When max(y) - min(y) is a very small value, ie, Number.MIN_VALUE, plotly failed to draw the plot.
Codepen https://codepen.io/opportunityliu/pen/QWmwPEO
TESTER = document.getElementById('tester');
Plotly.react( TESTER, [{
x: [1, 2, 3, 4, 5],
y: [0,0,0,0,Number.MIN_VALUE] }]);

Got error:
plotly-2.12.1.js:141901
Uncaught TypeError: Cannot read properties of undefined (reading 'val')
at getAutoRange (plotly-2.12.1.js:141901:26)
at doAutoRange (plotly-2.12.1.js:142098:56)
at exports.doAutoRangeAndConstraints (plotly-2.12.1.js:140196:13)
at doAutoRangeAndConstraints (plotly-2.12.1.js:134769:21)
at lib.syncOrAsync (plotly-2.12.1.js:129221:15)
at positionAndAutorange (plotly-2.12.1.js:134759:20)
at lib.syncOrAsync (plotly-2.12.1.js:129221:15)
at Object._doPlot (plotly-2.12.1.js:134834:24)
at Object.newPlot (plotly-2.12.1.js:135011:20)
at Object.react (plotly-2.12.1.js:137070:28)
When the diff become slightly larger, ie, 1e-310, I got another error and an empty plot
Codepen https://codepen.io/opportunityliu/pen/wvmBZEy
TESTER = document.getElementById('tester');
Plotly.react( TESTER, [{
x: [1, 2, 3, 4, 5],
y: [0,0,0,0,1e-310] }]);

plotly-2.12.1.js:153093
Uncaught Error: Something went wrong with axis scaling
at ax.setScale (plotly-2.12.1.js:153093:19)
at axes.drawOne (plotly-2.12.1.js:144647:8)
at plotly-2.12.1.js:144605:31
at lib.syncOrAsync (plotly-2.12.1.js:129221:15)
at axes.draw (plotly-2.12.1.js:144600:16)
at drawAxes (plotly-2.12.1.js:134783:21)
at lib.syncOrAsync (plotly-2.12.1.js:129221:15)
at Object._doPlot (plotly-2.12.1.js:134834:24)
at Object.newPlot (plotly-2.12.1.js:135011:20)
at Object.react (plotly-2.12.1.js:137070:28)
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
Tái hiện lỗi bằng hai ví dụ JavaScript và lần theo stack được báo cáo từ getAutoRange và doAutoRange đến ax.setScale. Việc sửa lỗi hoàn tất khi cả hai phạm vi y rất nhỏ đều được render thành công mà không có lỗi giá trị không xác định hoặc lỗi scale trụ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
- 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
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100