Sankey Chart: Add a parameter which allows nodes to be manually placed horizontally.
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.
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!
@NPC yes, xpos is a step number, we leave it to d3 to figure out the actual x-pixel location.
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)