Plot does not appear in some cases if rangebreaks overlap
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
I've created a Codepen for the issue: https://codepen.io/mofojed/pen/ZEgPJPN
In this case, the data spans a week, and range breaks are specified for a full holiday on Thursday, Nov 23, 2023 (Thanksgiving), and a half day on Friday, Nov 24, 2023. These specifications overlaps with other patterns for business days.
The chart does not appear. It looks like the rangebreaks that Plotly.js locates for the plot is:
Where some of those overlap. It looks like that isn't taken into account when calculating the breaks length, so when there's overlap it will not generate a valid break length: https://github.com/plotly/plotly.js/blob/29ca37b4ba3ee28a3ffe3d48eab97a080d602af3/src/plots/cartesian/autorange.js#L199
I think it would make sense to check for overlapping here. I'll see if it's possible to adjust holidays to not overlap with any existing business periods as well...
#5783 is similar
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从链接的 CodePen 复现开始,检查 src/plots/cartesian/autorange.js 第 199 行附近对 rangebreaks 的处理。将其行为与类似的 issue #5783 进行比较,然后验证当 holiday 和 business-day rangebreaks 重叠时,图表仍能渲染且不会产生无效的 break length。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100