Link<T> class Links

The link shape generates a smooth cubic Bézier curve from a source point to a target point.

The tangents of the curve at the start and end are either vertical (see Link.vertical) or horizontal (see Link.horizontal). See also radial links.

Constructors

Constructs a new link generator using the specified curve and the given source, target, x and y accessors.
Link.horizontal(T source(Link<T>, [List<Object?>?]), T target(Link<T>, [List<Object?>?]), num x(T, [List<Object?>?]), num y(T, [List<Object?>?]))
Shorthand for Link.new with curveBumpX; suitable for visualizing links in a tree diagram rooted on the top edge of the display.
Link.vertical(T source(Link<T>, [List<Object?>?]), T target(Link<T>, [List<Object?>?]), num x(T, [List<Object?>?]), num y(T, [List<Object?>?]))
Shorthand for Link.new with curveBumpY; suitable for visualizing links in a tree diagram rooted on the top edge of the display.

Properties

context Path?
Optional context for rendering the generated link (see Link.call) as a sequence of path method calls.
getter/setter pairinherited-setter
digits num?
The maximum number of digits after the decimal separator.
getter/setter pairinherited-setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source ↔ T Function(Link<T>, [List<Object?>?])
The source accessor.
getter/setter pairinherited
target ↔ T Function(Link<T>, [List<Object?>?])
The target accessor.
getter/setter pairinherited
x num Function(T, [List<Object?>?])
The x-accessor.
getter/setter pair
y num Function(T, [List<Object?>?])
The y-accessor.
getter/setter pair

Methods

call([List<Object?>? args]) String?
Generates a link for the given args.
constX(num x) → void
Defines the Link.x-accessor as a constant function that always returns the specified value.
constY(num y) → void
Defines the Link.y-accessor as a constant function that always returns the specified value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

horizontalWithDefaults({List<num> source(Link<List<num>>, [List<Object?>?]) = linkSource, List<num> target(Link<List<num>>, [List<Object?>?]) = linkTarget, num x(List<num>, [List<Object?>?]) = pointX, num y(List<num>, [List<Object?>?]) = pointY}) Link<List<num>>
Equivalent to Link.horizontal, except that if source, target, x, y are not specified, the respective defaults will be used.
verticalWithDefaults({List<num> source(Link<List<num>>, [List<Object?>?]) = linkSource, List<num> target(Link<List<num>>, [List<Object?>?]) = linkTarget, num x(List<num>, [List<Object?>?]) = pointX, num y(List<num>, [List<Object?>?]) = pointY}) Link<List<num>>
Equivalent to Link.vertical, except that if source, target, x, y are not specified, the respective defaults will be used.
withDefaults({required CurveFactory curve, List<num> source(Link<List<num>>, [List<Object?>?]) = linkSource, List<num> target(Link<List<num>>, [List<Object?>?]) = linkTarget, num x(List<num>, [List<Object?>?]) = pointX, num y(List<num>, [List<Object?>?]) = pointY}) Link<List<num>>
Equivalent to Link.new, except that if source, target, x, y are not specified, the respective defaults will be used.