X6 icon indicating copy to clipboard operation
X6 copied to clipboard

可以设定节点的链接桩规则嘛?

Open IcarusRyy opened this issue 2 years ago • 4 comments

问题描述

最近项目需求需要设定几个规则,比如矩形要设定为单进单出,(我已经设定为2个链接桩了,但是不知道怎么进行入口和出口限定)。

重现链接

https://codesandbox.io/s/ph3c65?file=/src/app.tsx

重现步骤

1、进入页面; 2、设定矩形为单进单出规则,定义链接桩只能一个进,一个出

预期行为

设定矩形为单进单出规则,定义链接桩只能一个进,一个出

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • X6 版本: [1.28.2 ... ]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

IcarusRyy avatar Sep 05 '22 06:09 IcarusRyy

👋 @IcarusRyy

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 Sep 05 '22 06:09 x6-bot[bot]

可以在validateConnection做判断 也可参考这个例子

babachao avatar Sep 08 '22 04:09 babachao

那个判断的没弄懂咋写 。 我利用这个监听创建新的edge的 connected事件, 在回调函数里对开始节点和结束节点进行的判断,如果是我想要的,该edge遵守连线规则,就保留,如果不遵守我们的规则,就调用edge.remove方法移除掉。

------------------ 原始邮件 ------------------ 发件人: "antvis/X6" @.>; 发送时间: 2022年9月8日(星期四) 中午12:46 @.>; @.@.>; 主题: Re: [antvis/X6] 可以设定节点的链接桩规则嘛? (Issue #2625)

可以在validateConnection做判断 也可参考这个例子

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

IcarusRyy avatar Sep 09 '22 07:09 IcarusRyy

@IcarusRyy 可以参考这个例子。

NewByVector avatar Sep 14 '22 13:09 NewByVector

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

x6-bot[bot] avatar Feb 02 '24 01:02 x6-bot[bot]