Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

d3 Sankey - Is it possible to affect or decide the placement of nodes?

I'm working with the Sankey plugin for d3.js. Is there a way to affect the automatic placement of the nodes?

If you compare the below 2 images.

Automatically generated Sankey Diagram: https://files.secureserver.net/0s3DEU5s3OZtqL

enter image description here

After I have manually re-arranged it: https://files.secureserver.net/0sYJF1w7f54wdF

enter image description here

You see that the nodes are aligned centered after each other which make it hard to use the diagram until you manually rearrange the nodes. Can I affect this flow somehow - or is it just the way it is?

By the way - Is there a way to specify that the text for the nodes should not be longer than the height of the nodes?

like image 431
Peter NB Avatar asked Sep 06 '13 08:09

Peter NB


1 Answers

According to the demo and its explanation, there is no way to affect the placement (and a brief look at the source confirms that). Similarly, there's no way to specify that the text for the nodes should not be longer than the height of the nodes.

like image 89
Lars Kotthoff Avatar answered Oct 11 '22 13:10

Lars Kotthoff