[BUG]: Sankey warning breaks in @plotly/d3-sankey v0.12.3
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.3k
- Forks
- 2k
- Ø Merge
- 2 T. 12 Std.
- Gemergte PRs (30 T.)
- 28
Beschreibung
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)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in src/traces/sankey/render.js bei der Warnung um die Zeilen 76-78 und vergleiche dann die aktualisierte Padding-API von @plotly/d3-sankey v0.12.3 mit den Positionen der angeordneten Knoten. Kläre, wie das effektive Padding ermittelt werden sollte oder ob die Warnung entfernt werden sollte, und überprüfe, dass das Diagnoseverhalten mit dem begrenzten Layout übereinstimmt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- d3, javascript
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 55/100