Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

未關閉
#7,832 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
d3, javascript

研究方向

從 src/traces/sankey/render.js 中第 76-78 行附近的警告開始,然後將升級後的 @plotly/d3-sankey v0.12.3 padding API 與已佈局的節點位置進行比較。釐清應如何偵測有效 padding,或是否應移除警告,並驗證診斷行為是否與受限制的佈局一致。

由索引模型根據 Issue 內容生成。

描述

bug P3 size: 1
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/[email protected], 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)
主要語言
JavaScript
星號
18.4k
分支
2k
平均合併
1 天 21 小時
30 天內合併 PR
18

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

plotly/plotly.js 的其他 Issue

查看 plotly/plotly.js 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。