A discrete scale that maps categorical values to a discrete range.
Useful for encoding categorical data with colors or shapes.
Summary
Functions
Applies the scale to a categorical value
Returns 0: an ordinal scale has no bandwidth
Identity: an ordinal scale never extrapolates
Sets the domain (list of categories)
Not applicable for ordinal scales
Creates a new ordinal scale
Returns the scale unchanged
Identity: an ordinal scale has no padding
Sets the range (list of output values)
Returns the domain values as ticks
Sets the value to return for unknown domain values
Types
Functions
Applies the scale to a categorical value
@spec bandwidth(t()) :: 0
Returns 0: an ordinal scale has no bandwidth
Identity: an ordinal scale never extrapolates
Sets the domain (list of categories)
Not applicable for ordinal scales
@spec new() :: t()
Creates a new ordinal scale
Returns the scale unchanged
Identity: an ordinal scale has no padding
Sets the range (list of output values)
Returns the domain values as ticks
Sets the value to return for unknown domain values