removeNode method
Remove a node from the graph.
Also removes all edges to/from this node.
Implementation
void removeNode(String nodeId) {
final node = _nodes[nodeId];
if (node == null) return;
// Remove all edges to this node
for (final importId in node.imports.toList()) {
removeDependency(nodeId, importId);
}
// Remove all edges from this node
for (final importedById in node.importedBy.toList()) {
removeDependency(importedById, nodeId);
}
_nodes.remove(nodeId);
}