Skip to content

Sankey issue #3140

Closed
Closed

Description

@nicolaskruchten

Here is the codepen for the reported bug: https://codepen.io/rbakker/pen/gBjXde
The pen shows two plotly plots with Sankey diagram with the same data.
The only difference is that the first plot uses node.pad = 10, the second uses node.pad = 2.
In the first plot the nodes are not drawn at all.

Activity

  1. nicolaskruchten commented on Oct 23, 2018

    @nicolaskruchten
    ContributorAuthor

    (reported via support channels)

  2. alexcjohnson commented on Oct 23, 2018

    @alexcjohnson
    Collaborator

    Interesting... what's happening is we need to generate a node/link thickness scaling, and we do so by taking the height of a column, subtracting off n-1 paddings (for n nodes in that column), and scaling all nodes so the sum of their thicknesses fills the remaining space.

    The problem is that the requested padding is more than the available space, so the scaling factor goes negative, and apparently we never considered this possibility before. The way we appear to draw it, negatively scaled nodes get zero height, and negatively scaled links get drawn with the absolute value of the scaling (but misaligned because we weren't expecting this)

    I suppose the solution would be something like limit the padding to at most occupy perhaps half the space in any given column? 2/3?

  3. added
    bug
    on Oct 23, 2018
  4. antoinerg commented on Oct 23, 2018

    @antoinerg
    Contributor

    @alexcjohnson Should we give a warning (Lib.warn) if the user specified value is too big?

  5. alexcjohnson commented on Oct 23, 2018

    @alexcjohnson
    Collaborator

    Mmm yeah, good idea - Lib.warn if the actual padding is less than requested. 👍 That's probably better (and certainly easier) than trying to push the calculated value back into fullData (in a way that's compatible with Plotly.react...)

  6. self-assigned this
    on Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions