rebuild method
void
rebuild({
- required Iterable<
Node< nodes,T> > - required Iterable<
Connection> connections, - required Iterable<
Annotation> annotations, - required List<
Rect> connectionSegmentCalculator(),
Rebuilds the entire index from the given elements.
Use this after loading a graph or performing major structural changes.
Implementation
void rebuild({
required Iterable<Node<T>> nodes,
required Iterable<Connection> connections,
required Iterable<Annotation> annotations,
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);
}
for (final annotation in annotations) {
updateAnnotation(annotation);
}
});
}