antvis/G6

使用Dagre布局的时候,如果有环形关系,布局展示异常 #4984

XiaoRIGE posted onGitHub

Describe the bug

使用Dagre布局的时候,如果有环形关系,布局展示异常 c45b33664ee9fb20cd6af714b158937

Your Example Website or App

(https://stackblitz.com/edit/vue-qpyddk?file=src%2FApp.vue)

Steps to Reproduce the Bug or Issue

使用dagre布局,如果有环形数据,就会展示异常

Expected behavior

使用dagre布局,如果有环形数据,展示依然正常

Screenshots or Videos

No response

Platform

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

Additional context

No response


给个在线复现 demo 吧

posted by Yanyan-Wang over 1 year ago

发现配置了align: 'DL'就会出现该bug

posted by XiaoRIGE over 1 year ago

给个在线复现 demo 吧

demo链接更新在example中

posted by XiaoRIGE over 1 year ago

应该是数据中指定的 layer 和图结构冲突导致的:

https://g6.antv.antgroup.com/api/graph-layout/dagre#%E6%8C%87%E5%AE%9A%E8%8A%82%E7%82%B9%E5%B1%82%E7%BA%A7

image

我试了一下把 d 的 layer 改成 1 可以正常 image

posted by Yanyan-Wang over 1 year ago

如果我们将d的layer改为1,那么c=>d这个edge也是违背了原则(每一条边的起点的 layer 一定小于终点的 layer 值),c的layer为2,d的layer为1,为啥能正常展示呢?

posted by XiaoRIGE 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