plotly / plotly/plotly.js

[BUG]: Sankey warning breaks in @plotly/d3-sankey v0.12.3

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

还没有人认领这个 Issue。

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

描述

Description

The upgrade to @plotly/d3-sankey v0.12.3 (in #7830) will break the warning here:

if (sankey.nodePadding() < nodePad) {
    Lib.warn('node.pad was reduced to ', sankey.nodePadding(), ' to fit within the figure.');
}

In @plotly/d3-sankey@0.7.x, calling sankey.nodePadding() after running the layout returned the effective (post-clamp) padding value. In 0.12.3 the getter returns the user-configured value instead, because upstream split the internal state into separate dy (configured) and py (effective) variables.

After the upgrade, sankey.nodePadding() always equals nodePad, so the comparison is never true and the warning never fires. The layout itself still clamps correctly - only the diagnostic is affected.

Notes

Options to address the issue:

  • Remove the warning entirely
  • Derive the effective padding from the laid-out node positions (e.g. measure the gap between consecutive nodes in the densest column)

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 src/traces/sankey/render.js 中第 76-78 行附近的警告开始,然后将升级后的 @plotly/d3-sankey v0.12.3 padding API 与已布局的节点位置进行比较。确定应如何检测有效 padding,或者是否应移除警告,并验证诊断行为是否与被限制的布局一致。

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

评估

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

把新 issue 发到你的邮箱

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