Skip to content

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

Description

@camdecoster

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions