Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

Sankey Chart: Add a parameter which allows nodes to be manually placed horizontally. #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

speedplane
Copy link

The automatic horizontal placement of nodes in the Sankey chart is nice, but sometimes you need a bit more specificity. This commit adds a parameter which allows nodes to be manually placed horizontally. If xpos is specified as a parameter to each node object, then it will override the default calculated x-position.

…. Now if xpos is specified as a parameter to each node, then it will override the x-position as calculated.
@NPC
Copy link

NPC commented Sep 25, 2014

This is an excellent idea, I hope it gets included. As far as I understand, the x position value is an integer “step number”, not an actual horizontal coordinate?

Thanks for proposing this enhancement!

@speedplane
Copy link
Author

@NPC yes, xpos is a step number, we leave it to d3 to figure out the actual x-pixel location.

@thiloplanz
Copy link

This is a dupe of #88.

As for xpos, while it is an integer "step number", I have found that it also works with any kind of positive number, d3 will scale it nicely to fit the page, so you could have steps "wider" than others (At least if you specify it for all nodes, it might mess up the normal step calculations otherwise)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants