Avoid links criss cross / overlap in d3.js using force layout

ぐ巨炮叔叔 提交于 2019-12-10 21:36:28

问题


How to avoid links overlap in d3.js using force layout ? I have divided screen into two halves, the upper half nodes are connected to bottom half nodes using links , sometimes there is a criss cross of links , how can i avoid that ?


回答1:


The short answer is that you can't. The longer answer is that the force layout that D3 implements does nothing to prevent overlapping links and there are no parameters you can set to do that. What you can do is try to adjust the parameters that are there and see if they happen to help with this problem.

The force layout implemented in sigma js does try to minimise the number of links that cross, so if you don't absolutely need D3, this would be an alternative you could look into.



来源:https://stackoverflow.com/questions/29006725/avoid-links-criss-cross-overlap-in-d3-js-using-force-layout

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