GraphViewDefaultBehavior class
A default implementation of graph view behavior with standard visualization features.
This implementation provides a complete set of basic graph visualization features including node rendering, link visualization, and user interaction handling. It serves both as a ready-to-use behavior and as a base class for custom behaviors.
The default behavior includes:
- Standard node rendering with labels and tooltips
- Link visualization with arrow indicators
- Basic interaction handling like selection and drag operations via event callbacks
- Mouse hover effects
To customize specific aspects, extend this class and override only the
methods that need different behavior (e.g., override onTap to handle taps).
The default implementation provides a solid foundation for most graph
visualization needs.
See also:
- GraphViewBehavior, which defines the interface implemented by this class
- GraphNodeViewBehavior, for node-specific behavior
- GraphLinkViewBehavior, for link-specific behavior
- Implemented types
Constructors
- GraphViewDefaultBehavior({GraphLinkRouting linkRouting = GraphLinkRouting.straight})
-
Creates a default view behavior with optional
linkRoutingconfiguration.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- linkRouting → GraphLinkRouting
-
The routing style to use for links in this behavior.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createLinkViewBehavior(
) → GraphLinkViewBehavior -
Creates the behavior configuration for link rendering.
override
-
createNodeViewBehavior(
) → GraphNodeViewBehavior -
Creates the behavior configuration for node rendering.
override
-
getConnectionPoints(
GraphNode source, GraphNode target, Widget sourceWidget, Widget targetWidget) → GraphConnectionPoints? -
Calculates connection points between two nodes.
override
-
hitTestLink(
covariant GraphLinkImpl link, Offset position) → bool -
Tests if a link contains the given position.
override
-
hitTestNode(
covariant GraphNodeImpl node, Offset position) → bool -
Tests if a node contains the given position.
override
-
isEquivalentTo(
GraphViewBehavior other) → bool -
Compares this behavior with another for content equality.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDoubleTap(
GraphTapEvent event) → void -
Called when entities are double-tapped.
override
-
onDragEnd(
GraphDragEndEvent event) → void -
Called when a drag operation on entities completes.
override
-
onDragStart(
GraphDragStartEvent event) → void -
Called when a drag operation starts on entities.
override
-
onDragUpdate(
GraphDragUpdateEvent event) → void -
Called during a drag operation on entities.
Use
event.deltafor positional changes.override -
onHoverEnd(
GraphHoverEndEvent event) → void -
Called when the mouse pointer leaves an entity's area.
override
-
onHoverEnter(
GraphHoverEvent event) → void -
Called when the mouse pointer enters an entity's area.
override
-
onHoverMove(
GraphHoverEvent event) → void -
Called when the mouse pointer moves within an entity's area.
override
-
onSelectionChange(
GraphSelectionChangeEvent event) → void -
Called when the selection changes.
override
-
onTap(
GraphTapEvent event) → void -
Called when entities are tapped (single or double).
override
-
onTooltipHide(
GraphTooltipHideEvent event) → void -
Called when an entity's tooltip is hidden.
override
-
onTooltipShow(
GraphTooltipShowEvent event) → void -
Called when an entity's tooltip is shown.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited