ScaleLinear<Y> class final Linear scales

Linear scales map a continuous, quantitative input domain to a continuous output range using a linear transformation (translate and scale).

If the range is also numeric, the mapping may be inverted (see ScaleContinuousNumberExtension.invert). Linear scales are a good default choice for continuous quantitative data because they preserve proportional differences. Each range value y can be expressed as a function of the domain value x: y = mx + b.

Implemented types

Constructors

ScaleLinear.new({List<num> domain = const [0, 1], required List<Y> range, required Interpolate<Y> interpolate})
Constructs a new linear scale with the specified domain, range and interpolate, and clamping disabled.

Properties

clamp bool
Whether or not the scale currently clamps values to within the range.
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
interpolate ↔ Interpolate<Y>
The scale’s range interpolator factory.
getter/setter pairinherited
range List<Y>
The scale's range that specifies the output values.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unknown ↔ Y?
The output value of the scale for null (or double.nan) input values.
getter/setter pairinherited

Methods

call(num? x) → Y?
Given a value from the domain, returns the corresponding value from the range.
inherited
copy() ScaleLinear<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 = const [0, 1], List<Object?> range = const <num>[0, 1], Interpolate<Object?> interpolate = interpolate}) ScaleLinear<Object?>
number({List<num> domain = const [0, 1], List<num> range = const [0, 1], Interpolate<num> interpolate = interpolateNumber}) ScaleLinear<num>