rebuild method
void
rebuild({})
Rebuilds the entire index from the given elements.
Use this after loading a graph or performing major structural changes. Nodes include all node types: regular nodes, GroupNode, CommentNode.
Implementation
void rebuild({
required Iterable<Node<T>> nodes,
required Iterable<Connection> connections,
required List<Rect> Function(Connection) connectionSegmentCalculator,
}) {
clear();
batch(() {
for (final node in nodes) {
update(node);
}
for (final connection in connections) {
final segments = connectionSegmentCalculator(connection);
updateConnection(connection, segments);
}
});
}