[BUG]: `sankey`: `node.x` / `node.y` of `0` is ignored
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- d3, javascript
调研方向
从 src/traces/sankey/render.js 中的“Force node position”循环开始,检查它如何判断 trace.node.x[p] 和 trace.node.y[p] 是否缺失。使用提供的 Plotly.newPlot 示例并设置 arrangement: 'fixed' 来复现问题。当值为 0 的坐标得到保留,且 mock 基准文件 sankey_x_y_with_arrows.json 按需更新后,即为完成。
由索引模型根据 Issue 内容生成。
描述
Description
Node coordinates of 0 for node.x or node.yare ignored and the node gets positioned automatically.
Screenshots
With 0 coords:
With close to 0 coords:
Steps to reproduce
- Open Plotly devtools and paste the following into browser devtools:
Plotly.newPlot('g', [{
type: 'sankey',
arrangement: 'fixed',
node: {label: ['a', 'b', 'c'], x: [0, 0.5, 0.8], y: [0, 0, 0.7]},
link: {source: [0, 1], target: [1, 2], value: [1, 1]}
}], {margin: {l: 0, r: 0, t: 0, b: 0}});
- Note that the center of
ais not in the top left corner of the plot
Notes
- This issue stems from the fact that the "Force node position" loop in
src/traces/sankey/render.jsuses a truthy test (if(trace.node.x[p] && trace.node.y[p])), and0is falsy - The fix is to change the test for missing values to
!= null - The mock
sankey_x_y_with_arrows.jsonsetsy: [0, 0, 0], so the fix changes its baseline - Discovered while working on #7826
- 主要语言
- JavaScript
- 星标
- 18.4k
- 派生
- 2.1k
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 12
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
plotly/plotly.js 的其他 Issue
-
[BUG]: `scatterpolargl` drops points between 10000 and 100000 points可能已有人在做 @Tanishdete333 于 1 天前认领。 未关闭bug P3 size: 1
难度 2/5 1-3 小时 新手友好度 82/100
plotly/plotly.js#8148 · 1 条评论 ·
维护者通常 2 天内回复
-
[BUG]: findEmpties throws "iterated with no new neighbors" for large NaN regions in contour (double-precision underflow)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug P3 size: 3
难度 2/5 1-3 小时 新手友好度 86/100
plotly/plotly.js#8108 · 4 条评论 ·
维护者通常 2 天内回复
-
chore P3 plotly-internal size: 3 task
难度 2/5 1-3 小时 新手友好度 77/100
plotly/plotly.js#8064 · 1 条评论 ·
维护者通常 2 天内回复
-
chore P1 plotly-internal size: 1 task
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 2 天内回复
-
chore P3 plotly-internal size: 1 task
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 2 天内回复
相似的 Issue
-
neutral:fix
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
wazuh/wazuh-documentation#10611 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
remotion-dev/remotion#12905 ·
维护者通常 1 天内回复
-
enhancement websites
难度 2/5 1-3 小时 新手友好度 78/100
quarto-dev/quarto-cli#15255 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
PolicyEngine/cliff-watch#44 ·