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

删除node的时候不删除和node连接的edge #3005

Closed
weedxu opened this issue Dec 6, 2022 · 8 comments
Closed

删除node的时候不删除和node连接的edge #3005

weedxu opened this issue Dec 6, 2022 · 8 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@weedxu
Copy link

weedxu commented Dec 6, 2022

功能描述

删除node的时候连带删除了node关联的edge

期望解决方案

期望在删除node时不删除和node关联的edge,关联画布的node在拖动时可以吸附新的node

@x6-bot
Copy link
Contributor

x6-bot bot commented Dec 6, 2022

👋 @weedxu

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.

@NewByVector
Copy link
Contributor

如果不删除的话,那么连接的边怎么展示呢?

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label Dec 6, 2022
@a-silent-guy
Copy link

@NewByVector 实际使用时可能会有这样的场景:用户在配置流程时在边上配置了相关数据,可能由于操作失误或者其他原因,需要将边连接的节点删除掉重新创建一个节点后再连接,如果删除时连带将边删除了那么用户配置的边信息也一并删除了,用户需要重新配置一遍,操作上会有所不适,是不是可以考虑添加一个配置,允许删除节点时不删除与节点相连接的边,保留边可以合其他节点连接。

@NewByVector
Copy link
Contributor

可以:

graph.removeNode(node, {  disconnectEdges: true })

这样删除节点的时候,连接的边连接的那一端会定位到画布左上角。

@a-silent-guy
Copy link

我在使用过程中遇到这样一个问题,当我使用disconnectEdges: true时,edge的确保留了,但是edge上的source-arrowhead和source-targethead失效了,edge不能再被拖动了。

@NewByVector
Copy link
Contributor

@a-silent-guy 所以还是建议如果要保留边的话,可以先通过 edge.setSource 或者 edge.setTarget 等方法先将边和节点解绑。

@a-silent-guy
Copy link

a-silent-guy commented Dec 23, 2022 via email

@x6-bot
Copy link
Contributor

x6-bot bot commented Jan 20, 2024

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 x6-bot bot locked as resolved and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

3 participants