X6 icon indicating copy to clipboard operation
X6 copied to clipboard

使用X6创建流程图的时候,如何确保当前流程图为一个DAG图呢?或者说如何实现判断没有环出现

Open yuanAIhan opened this issue 4 months ago • 3 comments

Describe the feature you'd like to request

我的目的就是参考https://x6.antv.antgroup.com/examples/showcase/practices/#flowchart这里的流程图,然后限制图中不会出现环路,但是我发现添加connecting的属性以后,没法保证不出现环路。 image

Describe the solution you'd like

目前没有想到很好的办法,不知道是否是哪里功能遗漏啦! allowBlank: false, // 不允许连接到画布空白位置的点 allowLoop: false, // 不允许创建循环连线 allowMulti: false, // 不允许在相同的起始节点和终止之间创建多条边 我添加了上述的几个属性,但是都无法保证不出现环路。

Describe alternatives you've considered

暂时没有。 每次链接线以后都去检测全部的线条是否存在环路?这样显然是不可以的。

Your Example Website or App

No response

Screenshots or Videos

image 这种无法限制感觉是比较奇怪的。不知道该添加哪些属性让这个支持

yuanAIhan avatar Feb 21 '24 09:02 yuanAIhan

👋 @yuanAIhan

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

x6-bot[bot] avatar Feb 21 '24 09:02 x6-bot[bot]

allowLoop 限制的是首尾是同一个节点, 你这种限制只能自己做

cyrilluce avatar Feb 27 '24 02:02 cyrilluce

用图算法做,看看拓扑排序可不可以做

Jiangwenzhe avatar Mar 25 '24 13:03 Jiangwenzhe