NodeFlowConfig class

Reactive configuration class for NodeFlow behavioral properties.

Visual properties like minimap appearance, colors, and styling are configured through NodeFlowTheme and MinimapTheme.

Extension Configuration

Extensions are passed pre-configured. Built-in extensions are included by default. Customize or add extensions via the extensions parameter:

NodeFlowConfig(
  extensions: [
    MinimapExtension(config: MinimapConfig(visible: true, interactive: true)),
    LodExtension(config: LODConfig.disabled),
    AutoPanExtension(config: AutoPanConfig.fast),
    DebugExtension(mode: DebugMode.spatialIndex),
    StatsExtension(),
  ],
);

Default Extensions

If no extensions are provided, these defaults are used:

Constructors

NodeFlowConfig({bool snapToGrid = false, double gridSize = 20.0, double portSnapDistance = 8.0, double minZoom = 0.5, double maxZoom = 2.0, bool scrollToZoom = true, bool showAttribution = true, List<NodeFlowExtension>? extensions})

Properties

extensionRegistry ExtensionRegistry
Registry of extensions.
final
gridSize → Observable<double>
Grid size for snapping calculations
final
hashCode int
The hash code for this object.
no setterinherited
maxZoom → Observable<double>
Maximum allowed zoom level
final
minZoom → Observable<double>
Minimum allowed zoom level
final
portSnapDistance → Observable<double>
Distance threshold for port snapping during connection
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollToZoom → Observable<bool>
Whether trackpad scroll gestures should cause zooming.
final
showAttribution bool
Whether to show attribution label
final
snapToGrid → Observable<bool>
Whether to snap node positions to grid
final

Methods

copyWith({bool? snapToGrid, double? gridSize, double? portSnapDistance, double? minZoom, double? maxZoom, bool? scrollToZoom, bool? showAttribution}) NodeFlowConfig
Create a copy with different initial values
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
snapToGridIfEnabled(Offset position) Offset
Helper method to snap coordinates to grid if enabled
toggleSnapping() → void
Toggle grid snapping for nodes
toString() String
A string representation of this object.
inherited
update({bool? snapToGrid, double? gridSize, double? portSnapDistance, double? minZoom, double? maxZoom, bool? scrollToZoom}) → void
Update multiple properties at once

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

defaultConfig NodeFlowConfig
Default configuration factory
no setter

Static Methods

defaultExtensions() List<NodeFlowExtension>
Default extensions for a new config.