StatsExtension class
Reactive graph statistics extension.
Provides a facade over the controller's observable properties, making it convenient to access graph statistics in one place. All properties are reactive through the controller's underlying MobX observables.
This extension uses void as its config type since it doesn't require
any configuration.
Usage with Granular Observers
// Each stat can have its own Observer for fine-grained updates
Row(
children: [
Observer(builder: (_) => Text('${controller.stats.nodeCount} nodes')),
Observer(builder: (_) => Text('${controller.stats.zoomPercent}%')),
],
)
Summary Helpers
Observer(builder: (_) => Text(controller.stats.summary));
// Output: "25 nodes, 40 connections"
- Inheritance
-
- Object
- NodeFlowExtension<
void> - StatsExtension
Constructors
- StatsExtension()
- Creates a stats extension.
Properties
- avgConnectionsPerNode → double
-
Average number of connections per node. Reactive.
no setter
- bounds → Rect
-
Bounding rectangle containing all nodes. Reactive.
no setter
- boundsArea → double
-
Total area of the graph bounds. Reactive.
no setter
- boundsCenter → Offset
-
Center point of the graph. Reactive.
no setter
- boundsHeight → double
-
Height of the graph bounds. Reactive.
no setter
- boundsSummary → String
-
Bounds summary: "2400 × 1800 px"
no setter
- boundsWidth → double
-
Width of the graph bounds. Reactive.
no setter
- commentCount → int
-
Number of CommentNode instances. Reactive.
no setter
- config → Null
-
The configuration for this extension.
no setteroverride
- connectionCount → int
-
Total number of connections. Reactive.
no setter
-
connections
→ ObservableList<
Connection> -
The connections observable list for direct reactive access.
no setter
- density → double
-
Node density (nodes per 1,000,000 square units). Reactive.
no setter
- groupCount → int
-
Number of GroupNode instances. Reactive.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasSelection → bool
-
Whether any item is selected. Reactive.
no setter
- id → String
-
Unique identifier for this extension.
no setteroverride
- isLargeGraph → bool
-
Whether this is considered a "large" graph (> 100 nodes). Reactive.
no setter
- isMultiSelection → bool
-
Whether multiple items are selected. Reactive.
no setter
- labeledConnectionCount → int
-
Number of connections that have labels. Reactive.
no setter
- lockedNodeCount → int
-
Number of locked nodes. Reactive.
no setter
- lodLevel → String
-
Current LOD level name: 'minimal', 'standard', or 'full'.
no setter
- nodeCount → int
-
Total number of nodes in the graph. Reactive.
no setter
-
nodes
→ ObservableMap<
String, Node> -
The nodes observable map for direct reactive access.
no setter
-
nodesByType
→ Map<
String, int> -
Breakdown of nodes by their type property. Reactive.
Example:
{'process': 5, 'decision': 3, 'start': 1}no setter - nodesInViewport → int
-
Number of nodes currently visible in the viewport. Reactive.
no setter
- pan → Offset
-
Current pan offset in graph coordinates. Reactive via viewport observable.
no setter
- regularNodeCount → int
-
Number of regular nodes (excluding groups and comments). Reactive.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedConnectionCount → int
-
Number of selected connections. Reactive.
no setter
-
selectedConnectionIds
→ ObservableSet<
String> -
The selected connection IDs observable set for direct reactive access.
no setter
- selectedCount → int
-
Total selected items (nodes + connections). Reactive.
no setter
- selectedNodeCount → int
-
Number of selected nodes. Reactive.
no setter
-
selectedNodeIds
→ ObservableSet<
String> -
The selected node IDs observable set for direct reactive access.
no setter
- selectionSummary → String
-
Selection summary: "3 nodes, 2 connections selected" or "Nothing selected"
no setter
- summary → String
-
Quick graph summary: "25 nodes, 40 connections"
no setter
-
viewport
→ Observable<
GraphViewport> -
The viewport observable for direct reactive access.
no setter
- viewportSummary → String
-
Viewport summary: "100% at (0, 0)"
no setter
- visibleNodeCount → int
-
Number of visible (non-hidden) nodes. Reactive.
no setter
- zoom → double
-
Current zoom level (e.g., 1.0, 0.5, 2.0). Reactive via viewport observable.
no setter
- zoomPercent → int
-
Zoom as integer percentage (e.g., 100, 50, 200). Reactive via viewport observable.
no setter
Methods
-
attach(
NodeFlowController controller) → void -
Called when the extension is attached to a controller.
override
-
detach(
) → void -
Called when the extension is detached from the controller.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onEvent(
GraphEvent event) → void -
Called when a graph event occurs.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited