Inconsistent `gap` attributes causes misalignment
未关闭
还没有人认领这个 Issue。
bug
sev-3
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
If you provide both bargap and scattergap but they're different, traces in the same alignment and offset group do not properly align. One way or another, ensuring these traces align is more important than honoring both gaps. Here, the orange and green scatter points should be centered on the bars of the same color, but they are not:
https://codepen.io/alexcjohnson/pen/yLdEZvo?editors=0010
This is a little tricky though:
- If there are no bar traces,
bargapwill not be defined, soscattergapshould be honored. - Even if there are bar traces but only
scattergapis explicitly given, seems like it should be honored and used as thebargapvalue as well. - There are also
boxgapandviolingap- in principle you could have ALL of these traces in the same alignment and offset groups, do we define a hierarchy, something like bar beats scatter beats box beats violin? Or do we take the gap from the first trace in the group, and use that for all traces in that group? Or the maximum gap that applies to any trace in the group? I have no strong opinions here, so long as the result is always proper alignment. - All but scatter also have
*groupgapattributes. There's no problem allowing these to be different.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 bar、scatter、box 和 violin trace 的对齐及偏移组处理开始,并使用链接的 CodePen 复现不匹配问题。比较缺少 gap 属性和显式设置 gap 属性的情况,然后建立选择共享 gap 的一致规则,同时保持正确的对齐。完成标准是:同一组中的 trace 在所有相关的 trace 组合中都能正确居中。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100