CategoricalAxis

An axis ruled in names.

@internote/canvas-sdkInterface
On 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

kindRequired
Marks a categorical axis, as against an axis ruled in numbers.
'categories'
labels
What 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.

namesRequired
The names, in order.
string[]
preset
The preset the names came from, when they came from one. It lets a cell match by its three-letter form.
monthsweekdays
stops
For 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.

ticksRequired
What each tick writes: the short form for a preset, the name itself otherwise.
string[]

Declared in packages/canvas-sdk/src/data/categories.ts:60.

Last updated