Skip to content

Commit

Permalink
fix: destroy graph layout when model changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tthvo committed Aug 26, 2024
1 parent 85f54fb commit ee03e5e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/Topology/GraphView/TopologyGraphView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ export const TopologyGraphView: React.FC<TopologyGraphViewProps> = ({ transformC
},
};

// Destroy old graph if any
if (visualization.hasGraph()) {
visualization.getGraph().destroy();
}

// Initialize the controller with model to create nodes
visualization.fromModel(model, false);
}, [_transformData, visualization, discoveryTree]);
Expand Down

0 comments on commit ee03e5e

Please sign in to comment.