避免链接交叉/重叠在d3.js使用强制布局 [英] Avoid links criss cross / overlap in d3.js using force layout

查看:613
本文介绍了避免链接交叉/重叠在d3.js使用强制布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何避免链接重叠在d3.js使用强制布局?
我把屏幕分成了两半,上半节点使用链接连接到下半节点,有时有十字交叉链接,我怎么能避免?

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 ?

推荐答案

简单的答案是,你不能。更长的答案是,强制布局,D3实现不会阻止重叠链接,没有参数,你可以设置来做到这一点。你可以做的是尝试调整那里的参数,看看他们是否发生了帮助这个问题。

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.

sigma js 尝试最小化交叉的链接数,因此如果你不需要D3,是您可以研究的替代方案。

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.

这篇关于避免链接交叉/重叠在d3.js使用强制布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆