Skip to content

Sankey link ordering bug #4390

@alexcjohnson

Description

@alexcjohnson

While tweaking a sankey diagram for publication, I ran into a funny bug in the link layout algorithm: links sometimes cross unnecessarily, depending on the positions of their source & target nodes.
https://codepen.io/alexcjohnson/pen/abbxdWW?editors=0010

// <=0.24 gets the link order correct,
// >=0.25 swaps the links incorrectly
var yYellow3 = 0.24;

correct @ 0.24:
Screen Shot 2019-11-29 at 10 37 21 AM

wrong @ 0.25:
Screen Shot 2019-11-29 at 10 36 53 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions