Skip to content

Interface: ChartSpec<F, View> ​

Defined in: packages/core/src/dashboard.ts:42

A chart: what to group by, what to aggregate, and how to draw it. Plain and serializable apart from renderer.

Type Parameters ​

Type ParameterDefault type
F extends string-
Viewunknown

Properties ​

PropertyModifierTypeDescription
dimensionreadonlyDimensionInput<F>What to group rows by: a bin, category or top spec, a bare field name, or an [x, y] pair.
extra?readonlyReadonly<Record<string, AggregateSpec<F>>>More aggregates over the same bins, by name. Each bin's results arrive in Datum.extra, e.g. { lat: mean("paleolat") } to place a map dot where its rows were in the past.
id?readonlystringFilter key and chart id. Defaults to the field name ("x×y" for grids), made unique.
renderer?readonlyRenderer<View>Overrides the dashboard's renderer for this chart.
value?readonlyAggregateSpec<F>Defaults to count().
view?readonlyViewPassed to the renderer untouched.

Released under the MIT License.