Skip to content

Documentation / @finchart/core / index / defaultCoordinates

Function: defaultCoordinates() ​

defaultCoordinates<T>(): CoordinateAccessor<T>

Defined in: packages/core/src/data/accessors.ts:181

Reads x and y as they are.

A point that derive produces has a type that varies per registration, so it can't require a dedicated accessor. Without a coordinate accessor given separately, the default assumption is { x, y } shape.

Doesn't use ?? null — that would make "this point type has no y" the same value as "this point is whitespace," so assertReadableValue's field-name guidance would never fire and every point would become a gap. undefined has to pass through unchanged for the data gate to give accurate guidance.

Also checks finiteness — sibling accessors LineDataAccessor and HistogramAccessor reject y: NaN via assertFinite, and without that here, one NaN from a derived registration would reach an M4Decimation column and wipe out that whole column's high and low.

Type Parameters ​

T ​

T extends BaseDataPoint

Returns ​

CoordinateAccessor<T>