rebuildFromNodes method
Rebuilds only nodes from the given iterable. Also rebuilds all port spatial items.
Implementation
void rebuildFromNodes(Iterable<Node<T>> nodes) {
// Clear existing nodes and their ports
for (final nodeId in _nodes.keys.toList()) {
_grid.remove(NodeSpatialItem(nodeId: nodeId, bounds: Rect.zero).id);
_removePortsForNode(nodeId, notify: false);
}
_nodes.clear();
// Add new nodes (update() also adds their ports)
batch(() {
for (final node in nodes) {
update(node);
}
});
}