Skip to content

Interface: Datum ​

Defined in: packages/core/src/renderer.ts:7

One bin of a chart's aggregated data, flattened so renderers can hand it straight to a plotting library.

Properties ​

PropertyModifierTypeDescription
baselinereadonlynumberThe aggregate with no filters at all, for drawing "everything" behind a selection. NaN if unknown.
countreadonlynumberRows in the bin.
extra?readonlyReadonly<Record<string, number>>The chart's extra aggregates for this bin, by name (see ChartSpec.extra).
indexreadonlynumberBin index in the dimension (row-major for grids).
keyreadonlystringCategory key, or a "lo–hi" label for numeric bins.
valuereadonlynumberThe aggregate (count, sum or mean). NaN when a mean has no values.
x0readonlynumberNumeric bin edges along x; NaN for categories.
x1readonlynumberUpper bin edge along x (exclusive).
y0?readonlynumberGrid dimensions only: the y bin's lower edge.
y1?readonlynumberGrid dimensions only: the y bin's upper edge (exclusive).
ykey?readonlystringGrid dimensions only: the y axis bin.

Released under the MIT License.