Axis auto-range improvements
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ả
This issue attempts to combine ideas from several individual feature requests into coherent picture (i.e. the least number of new attribute possible).
In a private conversation with @alexcjohnson , we proposed adding two new (cartesian) axis attributes: bounds and boundmode. bounds would expect 2-item array values similar to the current range. bounds can be thought of as representing the maximum possible extend of the axis ranges. In turn, boundmode would determine if bounds applies during the auto-range routine (i.e. on first view - discuss in https://github.com/plotly/plotly.js/pull/1861#issuecomment-314518657) or during interactions as well (as proposed in https://github.com/plotly/plotly.js/issues/887). For example,
xaxis: {
autorange: true,
boundmode: 'soft',
bounds: [0, 100]
}
would restrict the auto-range logic to compute an x-axis range between 0 and 100. This might be useful when plotting percentages where users don't want the axis ranges to go beyond 100%.
xaxis: {
boundmode: 'hard',
bounds: [0, 100]
}
would restrict the axis range to [0,100] in the auto-range logic and during interactions.
In doing so, 1-way bounds values such as [null, 100] or [0, null] should be allowed. null items here mean don't restrict the min (or max) bound acting. This behavior is similar to cmin and cmax for color scales. This call signature should also be extended to the axis range attribute - taking care of https://github.com/plotly/plotly.js/issues/400
A few more things to think about:
- Adding a
'tight'value for axisautorangewould take care of https://github.com/plotly/plotly.js/issues/928 - Maybe adding
'once'value for axisautorangefor https://github.com/plotly/plotly.js/issues/1849 - Maybe allow span axis
range(andbounds) values for https://github.com/plotly/plotly.js/issues/387
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 bằng việc xem xét các thuộc tính trục được đề xuất và các cuộc thảo luận được liên kết trong PR #1861 cùng các issue #887, #400, #928, #1849 và #387, sau đó xác định logic autorange và tương tác của trục. Được xem là hoàn tất khi phạm vi cho bounds, boundmode, null bounds, cùng hành vi bổ sung của autorange và range, đã được thống nhất; issue không nêu tên các tệp hoặc bài kiểm thử.
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
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100