Scale kind, e.g. 'linear', 'log', 'utc', 'band', 'point', 'ordinal'.
Input domain. Categories for band/ordinal scales, endpoints for continuous ones.
OptionalrangeOutput range in pixels (or colors, for a color scale).
OptionalbandwidthWidth of one band, for band scales only.
OptionalstepDistance between band starts, for band scales only.
OptionalapplyMaps a domain value to its output value.
OptionalinvertMaps an output value back to the domain. Absent on band/ordinal scales.
A scale descriptor as returned by
plot.scale(name).Plot exposes a plain object rather than a d3 scale: the configuration fields (
type,domain,range, and — for band scales —bandwidthandstep) plusapply, and, when the scale is invertible,invert. Ordinal and band scales carry noinvert, which is why valueAtPixel maps a pixel back to a category by walking the domain instead.The descriptor deliberately has no
label: Plot keeps the axis label in the DOM (g[aria-label="x-axis label"]), and readAxisLabel reads it from there.