SankeyDiagramWidget class

A widget that wraps an interactive Sankey diagram

The SankeyDiagramWidget integrates gesture detection for tapping nodes and renders the diagram using a CustomPaint widget. It takes a SankeyDataSet as its data source, a node colors map, and an optional selectedNodeId along with a callback onNodeSelected which is called when a node is tapped.

The size parameter specifies the drawing area for the diagram. The showLabels parameter controls whether node labels are displayed. The showTexture parameter controls whether texture patterns are drawn on links.

Inheritance

Constructors

SankeyDiagramWidget({Key? key, required SankeyDataSet data, required Map<String, Color> nodeColors, int? selectedNodeId, dynamic onNodeSelected(SankeyNode?)?, Size size = const Size(1000, 600), bool showLabels = true, bool showTexture = true})
const

Properties

data SankeyDataSet
The dataset containing nodes and links
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
nodeColors Map<String, Color>
Map of node labels to their display colors
final
onNodeSelected → dynamic Function(SankeyNode?)?
Callback invoked when a node is tapped (or null is passed when tapping empty space)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedNodeId int?
ID of the currently selected node, if any
final
showLabels bool
Whether to display node labels
final
showTexture bool
Whether to display texture patterns on links
final
size Size
The size of the diagram canvas
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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