Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling update() breaks circular link paths #17

Open
antoinerg opened this issue Feb 4, 2019 · 0 comments
Open

Calling update() breaks circular link paths #17

antoinerg opened this issue Feb 4, 2019 · 0 comments

Comments

@antoinerg
Copy link

First of all, thank you for this very nice library @ricklupton

I have seen a strange behavior when using update: when calling sankey.update(graph) with an unmodified graph object, circular links (usually made out of 4 segments) are now made out of 2 segments.

The layout goes from:
screenshot_2019-02-04_14-07-10
to the following wrong result upon calling update:
screenshot_2019-02-04_14-07-22

Programmatically, this can be seen by running the following:

            var graph = sankey(data);
            var before = graph.links.map(function(link) {
                return link.points.map(function(pts) {
                    return pts.d;
                });
            });
            console.log(before);
            // [['r', 'r'], ['r', 'r', 'r', 'r'], ['r', 'r'], ['r', 'r'], ['r', 'l', 'l', 'r'], ['r', 'r'], ['r', 'l', 'l', 'r']]

            graph = sankey.update(graph);
            var after = graph.links.map(function(link) {
              return link.points.map(function(pts) {
                  return pts.d;
              });
            });
            console.log(after);
            // [['r', 'r'], ['r', 'r'], ['r', 'r'], ['r', 'r'], ['r', 'r'], ['r', 'r'], ['r', 'r']]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant