[BUG]: Sankey warning breaks in @plotly/d3-sankey v0.12.3
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 18.3k
- Fork
- 2k
- Merge medio
- 2g 12h
- PR unite (30g)
- 28
Descrizione
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)
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia in src/traces/sankey/render.js, in corrispondenza dell'avviso intorno alle righe 76-78, quindi confronta l'API di padding aggiornata di @plotly/d3-sankey v0.12.3 con le posizioni dei nodi disposti. Determina come debba essere rilevato il padding effettivo o se l'avviso debba essere rimosso, e verifica che il comportamento diagnostico corrisponda al layout limitato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- d3, javascript
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100