fix: 🐛 fix delete node connection not delete (#1167)

Co-authored-by: 橙林 <chenglin@dian.so>
This commit is contained in:
BARM
2021-07-14 13:36:37 +08:00
committed by GitHub
parent fa149692e6
commit 2be4b33ce8

View File

@ -314,6 +314,12 @@ class ExperimentGraph extends GraphCore<BaseNode, BaseEdge> {
nextGraph.nodes = oldGraph.nodes.filter(
(node) => !nodes.includes(node.id.toString()),
)
nextGraph.links = oldGraph.links.filter(
(link) =>
!nodes.find((node) =>
[link.source.toString(), link.target.toString()].includes(node),
),
)
} else {
nextGraph.links = oldGraph.links.filter((link) => {
return !links.find((delLink) => {