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

Strange link layout gliches #14

Open
andrey-zakharov opened this issue Oct 2, 2018 · 2 comments
Open

Strange link layout gliches #14

andrey-zakharov opened this issue Oct 2, 2018 · 2 comments

Comments

@andrey-zakharov
Copy link

andrey-zakharov commented Oct 2, 2018

Take this data:

{
  "nodes": [ 
    { "id": "a" }, { "id": "b" }, { "id": "c" }, {"id": "d" }, {"id": "e" }, {"id": "f" }
  ],
  "links": [
    { "source": "a", "target": "b", "value": 1 },
    { "source": "a", "target": "c", "value": 1000 }, 
    { "source": "b", "target": "d", "value": 1 },
    { "source": "c", "target": "d", "value": 1000 },
    { "source": "d", "target": "e", "value": 1 },
    { "source": "e", "target": "f", "value": 1 }
  ]
}

put into https://ricklupton.github.io/d3-sankey-diagram/

Observe strange layout if links from "a" to "c" (largest one)

@andrey-zakharov
Copy link
Author

andrey-zakharov commented Oct 2, 2018

it comes from too wide stroke width line relative to line length (by horizontal or sometimes vertical), as it drawed by SVG.

@ricklupton
Copy link
Owner

Thanks for the example to reproduce! You're right about the problem. Perhaps we need to check for this happening and change to a different layout method if there isn't enough space to draw the link.

(The link outline is calculated by d3-sankey-diagram directly and filled -- it's not the SVG stroke-width that's causing the problem)

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

2 participants