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

你离开我真会死。 提交于 2019-12-19 03:12:14

问题


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

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

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?


回答1:


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.



来源:https://stackoverflow.com/questions/18653784/d3-sankey-is-it-possible-to-affect-or-decide-the-placement-of-nodes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!