ScaleThreshold<X, Y> class final Threshold scales

Threshold scales are similar to quantize scales, except they allow you to map arbitrary subsets of the domain to discrete values in the range.

The input domain is still continuous, and divided into slices based on a set of threshold values. See this choropleth for an example.

Implemented types

Constructors

ScaleThreshold({required List<X> domain, required List<Y> range})
Constructs a new threshold scale with the specified domain and range.

Properties

domain List<X>
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
unknown ↔ Y?
getter/setter pair

Methods

call(X? x) → Y?
Given a value in the input domain, returns the corresponding value in the output range. For example:
override
copy() ScaleThreshold<X, Y>
Returns an exact copy of this scale.
override
invertExtent(Y y) → (X?, X?)
Returns the extent of values in the domain (x0, x1) for the corresponding value in the range, representing the inverse mapping from range to domain.
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