parameterOf

Reads one control node into a Parameter: its name, range, step, starting value and format, taking them from a bound data column or a written options: list where it has one.

@internote/canvas-sdkFunction
On this page
import { parameterOf } from '@internote/canvas-sdk';

Three ways a parameter learns what it ranges over, in precedence order:

  • options: — the stops written out. A selector's own, and the only way to a parameter of names with no dataset behind it;
  • column: — a column. The cells are the stops, their span is the range, and what they ARE decides the format. What the author wrote for range: is not consulted: a parameter over #pop.year that also ranged [-10, 10] would be two claims about the same thing;
  • range:/step: — the ladder, and format: alone says how it reads.

Returns null for a control with no parameter name, and for one bound to a column that has not arrived: an attached dataset resolves to nothing until the host fills its rows in.

#Signature

(
    node: CompiledNode,
    datasets: Record<string, ChalkDataset> | undefined,
): Parameter | null

#Parameters

node
A slider, selector, cue.slider or cue.selector node.
datasets
The document's datasets, which an column: column is read from.

Declared in packages/canvas-sdk/src/parameters/index.ts:192.

Last updated