Public interface for spatial index queries.
This interface exposes only read-only query methods for hit testing and spatial lookups. Mutation methods (update, remove, rebuild) are internal to the framework and not exposed through this interface.
Usage
Access via the controller:
final result = controller.spatialIndex.hitTest(point);
final nodes = controller.spatialIndex.nodesAt(point);
Reactivity
Use the version observable to react to spatial index changes:
Observer(
builder: (_) {
controller.spatialIndex.version.value;
return MyWidget();
},
)
Properties
- connectionCount → int
-
The number of connections currently indexed.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- nodeCount → int
-
The number of nodes currently indexed.
no setter
- portCount → int
-
The number of ports currently indexed.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
version
→ Observable<
int> -
Observable version counter for reactivity.
no setter
Methods
-
connectionsAt(
Offset point, {double radius = 0}) → List< Connection< C> > - Returns all connections that pass through or near the given point.
-
getConnection(
String id) → Connection< C> ? - Retrieves a connection by its ID.
-
getNode(
String id) → Node< T> ? - Retrieves a node by its ID.
-
hitTest(
Offset point) → HitTestResult - Performs hit testing at the given point in graph coordinates.
-
hitTestPort(
Offset point) → HitTestResult? - Hit tests specifically for ports at the given point.
-
nodesAt(
Offset point, {double radius = 0}) → List< Node< T> > - Returns all nodes that contain or are near the given point.
-
nodesIn(
Rect bounds) → List< Node< T> > - Returns all nodes that intersect with the given bounds.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited