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

未关闭
#7,875 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
javascript

调研方向

使用链接的 CodePen 重现缺失的标签,并比较 3.5.1 和 3.6.0 的行为。跟踪 ticklabelindex 的处理以及第一个周期现有的 helper-tick 逻辑,然后确保当索引为负数时,范围末端的等效情况会为最后一个周期添加标签。

由索引模型根据 Issue 内容生成。

描述

bug P2 size: 3

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

主要语言
JavaScript
星标
18.3k
派生
2k
平均合并
2 天 12 小时
30 天内合并 PR
28

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

plotly/plotly.js 的其他 Issue

查看 plotly/plotly.js 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。