ScaleDiverging<Y> class final Diverging scales

Diverging scales are similar to linear scales, but the input domain and output range always have exactly three elements.

Diverging scales are typically used for a color encoding; see d4_scale_chromatic. These scales do not expose ScaleContinuousNumberExtension.invert and ScaleLinear.interpolate methods. There are also ScaleDivergingLog, ScaleDivergingPow, and ScaleDivergingSymlog variants of diverging scales.

Implemented types
Implementers
Available extensions

Constructors

ScaleDiverging({List<num>? domain, required Y interpolator(num)})
Constructs a new diverging scale with the specified domain and interpolator function.

Properties

clamp bool
getter/setter pairinherited
domain List<num>
The scale's domain that specifies the input values.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
interpolator ↔ Y Function(num)
The scale’s interpolator.
getter/setter pairinherited
range List<Y>
See ScaleLinear.range.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unknown ↔ Y?
getter/setter pairinherited

Methods

call(num? x) → Y?
Given a value from the domain, returns the corresponding value from the range.
inherited
copy() ScaleDiverging<Y>
Returns an exact copy of this scale.
override
nice([num count = 10]) → void
Extends the domain so that it starts and ends on nice round values.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
tickFormat([num count = 10, String? specifier]) String Function(num)
Returns a number format function suitable for displaying a tick value, automatically computing the appropriate precision based on the fixed interval between tick values.
inherited
ticks([num count = 10]) List<num>
Returns approximately count representative values from the scale’s domain.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

dynamic({List<num>? domain, Interpolator<num> interpolator = identity}) ScaleDiverging<Object?>
number({List<num>? domain, Interpolator<num> interpolator = identity}) ScaleDiverging<num>