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)
Description
The upgrade to
@plotly/d3-sankeyv0.12.3 (in #7830) will break the warning here:In
@plotly/d3-sankey@0.7.x, callingsankey.nodePadding()after running the layout returned the effective (post-clamp) padding value. In0.12.3the getter returns the user-configured value instead, because upstream split the internal state into separatedy(configured) andpy(effective) variables.After the upgrade,
sankey.nodePadding()always equalsnodePad, 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: