update nodes and edges after removals

This commit is contained in:
liamcottle 2024-08-16 15:45:08 +12:00
parent 66c011caca
commit 9e48e6ce95

View file

@ -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);