Class: CategoricalScale
Defined in: scales/scale.ts:152
A categorical (factor) axis. Internally it is linear over a band domain[-0.5, n-0.5], so factor i sits at the band centre and norm(i) equals the ordinary linear projection — the GPU transform needs no special handling, and a layer plotting at integer indices lands on band centres automatically. "Categorical-ness" lives only in the ticks/labels (one per factor).
Implements
Constructors
Constructor
new CategoricalScale(factors?): CategoricalScale;Defined in: scales/scale.ts:157
Parameters
| Parameter | Type | Default value |
|---|---|---|
factors | string[] | [] |
Returns
CategoricalScale
Properties
domain
domain: Range;Defined in: scales/scale.ts:156
Implementation of
factors
factors: string[];Defined in: scales/scale.ts:155
log
readonly log: false = false;Defined in: scales/scale.ts:154
Implementation of
type
readonly type: "categorical" = "categorical";Defined in: scales/scale.ts:153
Implementation of
Methods
formatTick()
formatTick(value): string;Defined in: scales/scale.ts:175
Default label formatter for a tick value.
Parameters
| Parameter | Type |
|---|---|
value | number |
Returns
string
Implementation of
invert()
invert(t): number;Defined in: scales/scale.ts:168
Parameters
| Parameter | Type |
|---|---|
t | number |
Returns
number
Implementation of
norm()
norm(value): number;Defined in: scales/scale.ts:162
Parameters
| Parameter | Type |
|---|---|
value | number |
Returns
number
Implementation of
ticks()
ticks(): Tick[];Defined in: scales/scale.ts:172
Auto ticks appropriate for this scale type.
Returns
Tick[]