scales
property maps visually encoded data values to pixel positions with attributes, such as color. See the D3 scales documentation for additional background information about scales.scales
property JSON format:domain
-to-range
transform:linear
: Quantitative, continuous scale that preserves proportion among data items.log
: Quantitative scale that applies a logarithmic transform to the data.ordinal
: Discrete domain and range scale.pow
: Quantitative scale that applies an exponential transform to the input data.quantize
: Quantitative, discrete scale that divides input data into segments.sqrt
: Quantitative scale that applies an square root transform to the input data.threshold
: Discrete scale that maps arbitrary domain subsets to discrete range values.blend
: Blends colors by category. Works only for discrete output scales (ordinal, quantize, and threshold).density
: Performs count aggregation per pixel and applies the supplied color based on the normalization of the per-pixel aggregated counts over a specified range. The range is determined by the required minDensityCnt
and maxDensityCnt
properties. minDensityCnt
and maxDensityCnt
can be explicit integer values or one of the following keywords that automatically compute statistical information about the per-pixel counts:min
max
-1stStdDev
-2ndStdDev
1stStdDev
2ndStdDev
pct
: Apply a color range based on percentage accumulation for a specific category.nullValue
null
.x
and y
. For the x
scale, linearly transform input data values between -100
and 999
to the visualization area width
. For the y
scale, linearly transform input data values between 0
and 500
to the visualization area height
. The width
and height
range values are pre-defined literals that reference the width
and height
properties.linear
x: y = mx + b
.log
y = m log(x) + b
.log(0) = -∞
, a log scale domain must be strictly-positive or strictly-negative. The domain must not include or cross zero. A log scale with a positive domain has a well-defined behavior for positive values. A log scale with a negative domain has a well-defined behavior for negative values. For a negative domain, input and output values are implicitly multiplied by -1
. The behavior of the scale is undefined if you compute a negative value for a log scale with a positive domain, and vice versa.log
scale values must be positive. Default = base 10
.pow
y = mx^k + b
, where k
is the exponent. Power scales also support negative domain values, and input value and resulting output value are then multiplied by -1.1
.sqrt
sqrt
scale values must be positive.ordinal
quantize
y = m round(x) + b.
threshold
domain
field specifies the domain of input data values. For quantitative data, this can take the form of a two-element array."range": [0, 500]
or "range": ['a', 'b', 'c']
."range": "width"
or "range": "height"
.0
and 100
among five visual output colors.width
and height
string literals that map to the Width and Height Properties.width
height
height
. The direction of the range, top-to-bottom or bottom-to-top, is determined by to the scale type.y
scale that linearly maps input values between 0
and 500
to the height of the visualization area.default
scales property specifies the output value to use when the input domain value does not map to the range.default
property is not applicable to the threshold
scale type, which maps domain values outside of the range to either the lowest or highest range value.density
minDensityCnt
and maxDensityCnt
properties. minDensityCnt
and maxDensityCnt
can be explicit integer values or one of the following keywords that automatically compute statistical information about the per-pixel counts:min
max
-1stStdDev
-2ndStdDev
1stStdDev
2ndStdDev
density
accumulators must be between 0 and 1 inclusive.blend
pct
pointcolor
:minDensityCnt
and maxDensityCnt
properties. After normalization, minDensityCnt
== 0
and maxDensityCnt
== 1
.minDensityCnt
and maxDensityCnt
can have explicit integer values or use one of the following keywords to compute statistical information about per-pixel counts: min
, max
, -1stStdDev
, -2ndStdDev
, 1stStdDev
, 2ndStdDev
.