Skip to content

ScaleSpec

ScaleSpec = object

Defined in: spec/scale.ts:54

One channel’s mapping from data values to visual positions.

Every field is optional: an omitted kind lets the renderer infer one from the field’s type, and an omitted domain lets it read the extent off the data. Nothing here is expressed in output units — see ScaleKind.

optional base?: number

Defined in: spec/scale.ts:72

Base for "log". Default 10.


optional clamp?: boolean

Defined in: spec/scale.ts:66

Clamps out-of-domain values to the nearest bound instead of dropping them.


optional domain?: readonly Value[]

Defined in: spec/scale.ts:60

Explicit domain. Absent means “derive it from the data”, which is what a renderer normally does.


optional exponent?: number

Defined in: spec/scale.ts:70

Exponent for "pow". Default 1.


optional kind?: ScaleKind

Defined in: spec/scale.ts:55


optional nice?: boolean

Defined in: spec/scale.ts:64

Rounds a derived numeric domain outward to human-readable bounds.


optional padding?: number

Defined in: spec/scale.ts:74

Fraction of a band left empty between adjacent bands. 0 to 1.


optional reverse?: boolean

Defined in: spec/scale.ts:68

Reverses the direction of the mapping.


optional scheme?: ColorSchemeSpec

Defined in: spec/scale.ts:76

Colour channels only.


optional zero?: boolean

Defined in: spec/scale.ts:62

Extends a derived numeric domain to include zero.