From 9e48e6ce953b27f08f42405408e5929aabe2616e Mon Sep 17 00:00:00 2001 From: liamcottle Date: Fri, 16 Aug 2024 15:45:08 +1200 Subject: [PATCH] update nodes and edges after removals --- .../network-visualiser/NetworkVisualiser.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/frontend/components/network-visualiser/NetworkVisualiser.vue b/src/frontend/components/network-visualiser/NetworkVisualiser.vue index 1eb2480..46278c9 100644 --- a/src/frontend/components/network-visualiser/NetworkVisualiser.vue +++ b/src/frontend/components/network-visualiser/NetworkVisualiser.vue @@ -336,10 +336,9 @@ export default { }, processNewNodes(newNodes) { - // update nodes + // determine old and new nodes const oldNodeIds = this.nodes.map((node) => node.id); const newNodeIds = newNodes.map((node) => node.id); - this.nodes.update(newNodes); // log new nodes for(const newNodeId of newNodeIds){ @@ -356,13 +355,15 @@ export default { } } + // update nodes + this.nodes.update(newNodes); + }, processNewEdges(newEdges) { - // update edges + // determine old and new edges const oldEdgeIds = this.edges.map((edge) => edge.id); const newEdgeIds = newEdges.map((edge) => edge.id); - this.edges.update(newEdges); // log new edges for(const newEdgeId of newEdgeIds){ @@ -379,6 +380,9 @@ export default { } } + // update edges + this.edges.update(newEdges); + }, formatBytes: function(bytes) { return Utils.formatBytes(bytes);