CategoricalAxis
An axis ruled in names.
@internote/canvas-sdkOn this page
import { CategoricalAxis } from '@internote/canvas-sdk';Position i + 1 is names[i]. A discrete numeric axis is a categorical axis whose names are numbers, with stops holding the numbers they are.
#Fields
kindMarks a categorical axis, as against an axis ruled in numbers.
'categories'labelsWhat the axis calls each name wherever it writes one — its ticks, a tooltip, a readout — in the names' order, where the author renamed them (a graph's
x-tick-labels:). A name not renamed carries itself.string[]Only the text changes: a cell is still matched against names, so bindings and colour maps keep reading DEM while the reader sees Democrat.
namesThe names, in order.
string[]presetThe preset the names came from, when they came from one. It lets a cell match by its three-letter form.
monthsweekdaysstopsFor a discrete numeric axis, the numbers the names are, ascending.
number[]Everything about the axis's shape is a categorical axis's: the stops stand at 1…n whatever the gaps between the values are. What differs is the reading: a cell is matched as a number, so 800, 800.0 and a column holding either land on the same stop.
ticksWhat each tick writes: the short form for a preset, the name itself otherwise.
string[]Declared in packages/canvas-sdk/src/data/categories.ts:60.