ScaleQuantize<Y> class final Quantize scales

Quantize scales are similar to linear scales, except they use a discrete rather than continuous range.

The continuous input domain is divided into uniform segments based on the number of values in (i.e., the cardinality of) the output range. Each range value y can be expressed as a quantized linear function of the domain value x: y = m round(x) + b. See the quantized choropleth for an example.

Implemented types

Constructors

ScaleQuantize.new({List<num>? domain, required List<Y> range})
Constructs a new quantize scale with the specified domain and range.

Properties

domain List<num>
The scale's domain that specifies the input values.
getter/setter pairoverride
hashCode int
The hash code for this object.
no setterinherited
range List<Y>
The scale's range that specifies the output values.
getter/setter pairoverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
thresholds List<num>
Returns the list of computed thresholds within the domain.
no setter
unknown ↔ Y?
getter/setter pair

Methods

call(num? x) → Y?
Given a value in the input domain, returns the corresponding value in the output range. For example, to apply a color encoding:
override
copy() ScaleQuantize<Y>
Returns an exact copy of this scale.
override
invertExtent(Y y) → (num, num)
Returns the extent of values in the domain (x0, x1) for the corresponding value in the range: the inverse of call. This method is useful for interaction, say to determine the value in the domain that corresponds to the pixel location under the mouse.
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