public class QuantizeScale extends DiscreteQuantitativeScale<QuantizeScale>
The input domain is still continuous, and divided into uniform segments based on the number of values in (the cardinality of) the output range.
The mapping is linear in that the output range value y can be expressed as a
linear function of the input domain value x:
y = mx + b.
The input domain is typically a dimension of the data that you want to visualize, such as the height of students (measured in meters) in a sample population.
The output range is typically a dimension of the desired output visualization, such as the height of bars (measured in pixels) in a histogram.
The default quantize scale has the default domain [0,1] and the default range [0,1]. Thus, the default quantize scale is equivalent to the round function for numbers; for example quantize(0.49) returns 0, and quantize(0.51) returns 1.
If the domain is set with an array containing more than two numbers, only the first and last number are used.
If the elements in the domain array are not numbers, they will be coerced to numbers; this coercion happens similarly when the scale is called.
Thus, a quantize scale can be used to encode any type that can be converted to numbers.
Modifier | Constructor and Description |
---|---|
protected |
QuantizeScale() |
invertExtent, invertExtent
apply, apply, apply, copy, domain, domain, domain, domain, range, range, range, range
Copyright © 2015 gwt-d3. All rights reserved.