ChartSpec
Defined in: packages/pixi-charts/src/spec/ChartSpec.ts:293
The declarative spec consumed by import(’./render.js’).render.
Roughly inspired by Vega-Lite’s grammar — type + data + encoding
options— without committing to its full algebra. Future chart types add their own per-type rules in import(’./validate.js’).validateChartSpec, not new top-level fields.
Example
Section titled “Example”const spec: ChartSpec = { type: 'line', data: rows, encoding: { x: { field: 'date', type: 'temporal' }, y: { field: 'revenue', type: 'quantitative' }, },};Properties
Section titled “Properties”animation?
Section titled “animation?”
optionalanimation?:AnimationOptions
Defined in: packages/pixi-charts/src/spec/ChartSpec.ts:307
Animation configuration. See AnimationOptions.
data: readonly
Record<string,unknown>[]
Defined in: packages/pixi-charts/src/spec/ChartSpec.ts:301
The rows to plot. Declared ReadonlyArray<Record<string, unknown>> to
signal the library does not mutate consumer data and to force
type-narrowing at use sites rather than implicit any access.
encoding
Section titled “encoding”encoding:
ChartEncoding
Defined in: packages/pixi-charts/src/spec/ChartSpec.ts:303
Channel-to-field mapping. See ChartEncoding.
options?
Section titled “options?”
optionaloptions?:ChartOptions
Defined in: packages/pixi-charts/src/spec/ChartSpec.ts:305
General presentation options. See ChartOptions.
type:
ChartType
Defined in: packages/pixi-charts/src/spec/ChartSpec.ts:295
Which chart type to render.