Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: 动态锚点的关联边问题 #2075

Closed
Niko-Mata opened this issue Feb 20, 2025 · 1 comment
Closed

[Feature]: 动态锚点的关联边问题 #2075

Niko-Mata opened this issue Feb 20, 2025 · 1 comment

Comments

@Niko-Mata
Copy link

背景&目的

背景:我的项目中存在一个自定义节点,该节点可通过内部按钮动态添加或者删除锚点,但如果被删除的锚点已经有一个边连入,此时删除锚点后边还被保留。
目的:能否添加一个锚点的删除监听事件,用户可自行实现锚点关联边的删除功能

@DymoneLewis
Copy link
Collaborator

目前不太能支持,因为现在锚点有多种实现方法,model里不关注锚点的动态增减。
不过从你的描述里看,我觉得可以试试在删除锚点之前,遍历lf.graphModel.edges找到sourceAnchorId和targetAnchorId是这个锚点Id的边,取其Id调lf.graphModel.deleteEdge(edgeId)把这条边删掉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants