NodeFlowConfig class
Reactive configuration class for NodeFlow behavioral properties.
Visual properties like minimap appearance, colors, and styling are configured through NodeFlowTheme and MinimapTheme.
Plugin Configuration
Plugins are passed pre-configured. Built-in plugins are included
by default. Customize or add plugins via the plugins parameter:
NodeFlowConfig(
plugins: [
MinimapPlugin(visible: true, interactive: true),
LodPlugin(enabled: false),
AutoPanPlugin(config: AutoPanConfig.fast),
DebugPlugin(mode: DebugMode.spatialIndex),
StatsPlugin(),
],
);
Default Plugins
If no plugins are provided, these defaults are used:
- AutoPanPlugin - autopan near edges (normal mode)
- DebugPlugin - debug overlays (disabled by default)
- LodPlugin - level of detail (disabled by default)
- MinimapPlugin - minimap overlay
- SnapPlugin - grid and alignment snapping (disabled by default)
- StatsPlugin - graph statistics (nodeCount, connectionCount, etc.)
Snapping
Snapping is configured through SnapPlugin with snap delegates:
// Toggle snapping with 'N' key or programmatically
controller.snap?.toggle();
controller.snap?.enabled = true;
// Access grid snap settings
controller.snap?.gridSnapDelegate?.gridSize = 10.0;
// Configure in plugins
NodeFlowConfig(
plugins: [
SnapPlugin([
SnapLinesDelegate(), // Alignment guides
GridSnapDelegate(gridSize: 10.0), // Grid snap fallback
]),
// ... other plugins
],
);
Constructors
-
NodeFlowConfig({double portSnapDistance = 8.0, double minZoom = 0.5, double maxZoom = 2.0, bool scrollToZoom = true, bool showAttribution = true, List<
NodeFlowPlugin> ? plugins})
Properties
- 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
- pluginRegistry → PluginRegistry
-
Registry of plugins.
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
Methods
-
copyWith(
{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
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
{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
-
defaultPlugins(
) → List< NodeFlowPlugin> - Default plugins for a new config.