DirectGraph constructor
- Key? key,
- required List<
NodeInput> list, - required Size defaultCellSize,
- required EdgeInsets cellPadding,
- Clip clipBehavior = Clip.hardEdge,
- bool centered = false,
- NodeCellBuilder? nodeBuilder,
- double contactEdgesDistance = 5.0,
- MatrixOrientation orientation = MatrixOrientation.Horizontal,
- double maxScale = 2.5,
- double minScale = 0.25,
- EdgePathBuilder? pathBuilder,
- EdgeStyleBuilder? styleBuilder,
- OverlayBuilder? overlayBuilder,
- EdgeLabels? edgeLabels,
- GestureBackgroundTapCallback? onCanvasTap,
- GestureEdgeTapDownCallback? onEdgeTapDown,
- GestureEdgeTapUpCallback? onEdgeTapUp,
- GestureEdgeLongPressStartCallback? onEdgeLongPressStart,
- GestureEdgeLongPressEndCallback? onEdgeLongPressEnd,
- GestureEdgeLongPressMoveUpdateCallback? onEdgeLongPressMoveUpdate,
- GestureEdgeForcePressStartCallback? onEdgeForcePressStart,
- GestureEdgeForcePressEndCallback? onEdgeForcePressEnd,
- GestureEdgeForcePressPeakCallback? onEdgeForcePressPeak,
- GestureEdgeForcePressUpdateCallback? onEdgeForcePressUpdate,
- GestureEdgeTapDownCallback? onEdgeSecondaryTapDown,
- GestureEdgeTapUpCallback? onEdgeSecondaryTapUp,
- GestureNodeTapDownCallback? onNodeTapDown,
- GestureNodeTapUpCallback? onNodeTapUp,
- GestureNodeLongPressStartCallback? onNodeLongPressStart,
- GestureNodeLongPressEndCallback? onNodeLongPressEnd,
- GestureNodeLongPressMoveUpdateCallback? onNodeLongPressMoveUpdate,
- GestureNodeForcePressStartCallback? onNodeForcePressStart,
- GestureNodeForcePressEndCallback? onNodeForcePressEnd,
- GestureNodeForcePressPeakCallback? onNodeForcePressPeak,
- GestureNodeForcePressUpdateCallback? onNodeForcePressUpdate,
- GestureNodePanStartCallback? onNodePanStart,
- GestureNodePanUpdateCallback? onNodePanUpdate,
- GestureNodePanDownCallback? onNodePanDown,
- GestureNodeTapDownCallback? onNodeSecondaryTapDown,
- GestureNodeTapUpCallback? onNodeSecondaryTapUp,
Draw direct graph using list of NodeInput's as source.
Use defaultCellSize to provide default cell size for each node. You can always provide
custom cell size for specific node using NodeInput.size parameter inside each of instances.
Use cellPadding to set padding between nodes. Note, that increasing cellPadding will
increase edges length, which might be useful if you need more space to add overlays or labels.
If clipBehavior clipBehavior of internal InteractiveViewer and Stack.
Defaults to Clip.hardEdge.
transformationController is TransformationController instance for internal InteractiveViewer.
Can be used to programmatically control graphs view.
contentWrapperBuilder builder function to add wrapper for internal
InteractiveViewer content. Useful when you need to add internal padding or
to center content using MediaQuery.
centered if set to true all node outcomes will be centered relatively to it's parent
as much as it's possible in rectangular space. Defaults to false.
nodeBuilder builder function to customize node Widget.
contactEdgesDistance distance between backward and forward oriented edge
on their contact. If set to 0.0 contact edges collide into one just like two
backward or two forward oriented edges. Defaults to 5.0.
maxScale maxScale value for internal InteractiveViewer.maxScale. Defaults to 2.5.
minScale minScale value for internal InteractiveViewer.minScale. Defaults to 0.25.
pathBuilder is a Path provider function to draw custom shaped edges. If provided
arrows wont be added. May be used to highlight particular relations.
paintBuilder is a Paint provider function to customize color, width and style
of edges. May be used to highlight particular relations.
overlayBuilder builder function to create interactive overlays on top of graph.
For instance, tooltips, hovers or node detail panels.
edgeLabels details to add text (or custom widget) labels to edges.
onCanvasTap any point on canvas tap handler. Useful to cancel actions related
to other handlers. For instance, hide tooltip.
orientation draw graph with MatrixOrientation.Horizontal orientation or
MatrixOrientation.Vertical. Defaults to MatrixOrientation.Horizontal.
onEdgeTapDown,onEdgeTapUp,onEdgeLongPressStart,onEdgeLongPressEnd,
onEdgeLongPressMoveUpdate,onEdgeForcePressStart,onEdgeForcePressEnd,
onEdgeForcePressPeak,onEdgeForcePressUpdate,
onEdgeSecondaryTapDown,onEdgeSecondaryTapUp gesture events for
edges interactions. See GestureDetector for details. No pan/drag events since it conflicts
with InteractiveViewer's pan events.
onNodeTapDown,onNodeTapUp,onNodeLongPressStart,
onNodeLongPressEnd,onNodeLongPressMoveUpdate,onNodeForcePressStart,
onNodeForcePressEnd,onNodeForcePressPeak,onNodeForcePressUpdate,
onNodePanStart,onNodePanUpdate,onNodePanDown,
onNodeSecondaryTapDown,onNodeSecondaryTapUp gesture events for nodes.
See GestureDetector for details.
Implementation
DirectGraph({
super.key,
required this.list,
required this.defaultCellSize,
required this.cellPadding,
this.clipBehavior = Clip.hardEdge,
this.centered = false,
this.nodeBuilder,
this.contactEdgesDistance = 5.0,
this.orientation = MatrixOrientation.Horizontal,
this.maxScale = 2.5,
this.minScale = 0.25,
this.pathBuilder,
this.styleBuilder,
this.overlayBuilder,
this.edgeLabels,
this.onCanvasTap,
this.onEdgeTapDown,
this.onEdgeTapUp,
this.onEdgeLongPressStart,
this.onEdgeLongPressEnd,
this.onEdgeLongPressMoveUpdate,
this.onEdgeForcePressStart,
this.onEdgeForcePressEnd,
this.onEdgeForcePressPeak,
this.onEdgeForcePressUpdate,
this.onEdgeSecondaryTapDown,
this.onEdgeSecondaryTapUp,
this.onNodeTapDown,
this.onNodeTapUp,
this.onNodeLongPressStart,
this.onNodeLongPressEnd,
this.onNodeLongPressMoveUpdate,
this.onNodeForcePressStart,
this.onNodeForcePressEnd,
this.onNodeForcePressPeak,
this.onNodeForcePressUpdate,
this.onNodePanStart,
this.onNodePanUpdate,
this.onNodePanDown,
this.onNodeSecondaryTapDown,
this.onNodeSecondaryTapUp,
});