antvis/G6

请问线条过多,线条重叠,节点文字和线条重叠,怎么去优化? #4561

wwwing123 posted onGitHub

Issue Hunt Program (optional)

  • This issue will participate in the Issue Hunt Program

Issue Difficulty

None

Bounty

No response

Describe the bug

使用Fruchterman布局时,我本身节点并不多,但线条比较多,节点文字重叠(有些还比较长),应该怎么去优化

Your Example Website or App

截图

Steps to Reproduce the Bug or Issue

初始化进来

Expected behavior

重叠尽量减少

Screenshots or Videos

微信123

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response


可以尝试将节点之间的距离调大些。

posted by PmcFizz almost 2 years ago

调过了,效果不太理想,主要是线条太多了,不会自己去避让计算,大佬你那里有布局可以参考一下吗

posted by wwwing123 almost 2 years ago

这里还有个问题,为什么间距会越来越大 123

posted by wwwing123 almost 2 years ago
  1. 如果可以接受的话,可以把文字做成tooltip 悬浮框的形式展示,鼠标hover到某个节点,展示对应的节点信息。
  2. 或者还有一个方式,如果只需要展示一个属性的话,可以把所有文字的opacity调成0.1到0.5,绑定mouseEnter事件,鼠标滑入时将透明度变为1。
posted by zqqcee almost 2 years ago

用 force2 布局,可以调整 nodeSize 大一些,这样节点间距比较大。目前没有节点和边之间相互避让的方式。

posted by Yanyan-Wang almost 2 years ago

这里还有个问题,为什么间距会越来越大 123

我也遇到同样的问题,还没找到解决办法。我用 force. 因为其他的都太慢了。

posted by neolee6053 almost 2 years ago

你好,请问你解决了吗

posted by HogoZhang over 1 year ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests