disable default selection of button in range selector buttons
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ả
Hello all,
Right now, enabling the use of buttons in layout.xaxis.rangeselector makes it such that the button 'all' is always selected by default, no matter where it is positioned in the list of buttons. If the button 'all' is not present, the display is still rendered as if it was selected by default.
May we add a default (boolean) property inside a button to know which should be selected by default when first displaying the graph ? This could help to focus on a key point of the data, while allowing the user to zoom out by clicking the 'all' button or by double-clicking on the graph.
This property would be set to false by default, and if no buttons show a true value for this property, then the usual 'all' display shall be rendered.
Example :
Usual display
var layout = {
xaxis: {
autorange: true,
rangeselector: {
buttons: [
{
count: 1,
label: '1m',
step: 'month',
stepmode: 'backward'
},
{
count: 6,
label: '6m',
step: 'month',
stepmode: 'backward'
},
{
step: 'all'
}
]
},
rangeslider: {autorange: true},
type: 'date'
}
};
In the second case, when loading the page, we already have the 6 months zoom.
6 months button selected by default
var layout = {
xaxis: {
autorange: true,
rangeselector: {
buttons: [
{
count: 1,
label: '1m',
step: 'month',
stepmode: 'backward'
},
{
count: 6,
label: '6m',
step: 'month',
stepmode: 'backward',
default: true
},
{
step: 'all'
}
]
},
rangeslider: {autorange: true},
type: 'date'
}
};
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 với việc xử lý các nút xaxis.rangeselector được mô tả trong issue và theo dõi cách phạm vi được chọn ban đầu được xác định. Công việc hoàn tất khi một nút có default: true điều khiển phạm vi ban đầu, trong khi hành vi “all” hiện có vẫn là fallback khi không có nút nào được đánh dấu là mặc định.
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ó
- 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