plotly / plotly/plotly.js

[BUG]: last period label sometimes not drawn when using negative ticklabelindex

Đang mở
#7,875 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug P2 size: 3
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ả

Here is an example of the last ticklabel not being drawn. The figure's ticklabelindex is set to -1:

Plotly 3.6.0 (missing last label)
Image

Plotly 3.5.1 (all labels visible)
Image

This is a regression from #7735. In version 3.5.1 ticklabelindex was ignored because no minor ticks were drawn. In version 3.6.0 ticklabelindex is not ignored and so for this figure, the label is expected to be drawn to the left of each major tick (ticklabelindex -1). However, there is no tick to the right of the last period and so that period is not labeled.

Before ticklabelindex, period labels were only ever drawn to the right of a major tick. There is logic in plotly to add a helper tick before the first period, making sure it will be labeled. For negative ticklabelindex, the same logic is required for the period at the end of the axis range.

Codepen: https://codepen.io/toffi-fee/pen/MYJEWLY

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

Tái hiện label còn thiếu bằng CodePen được liên kết, đồng thời so sánh hành vi của 3.5.1 và 3.6.0. Theo dõi cách xử lý ticklabelindex và logic helper-tick hiện có cho khoảng thời gian đầu tiên, sau đó đảm bảo trường hợp tương đương ở cuối phạm vi sẽ gắn nhãn cho khoảng thời gian cuối cùng khi chỉ mục là số âm.

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
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
65/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.