Datum paint
DatumFill, DatumPaint, DatumPaintContext, DatumPaintResolver: generated from the source of active-charts.
Exported by @workspace/. Generated from the package source; part of the index of every export.
Types#
Paint of a mark that is only a fill (a bar, a slice).
interface DatumFill {
readonly fill?: string;
}Paint of a point mark, which has a fill and an edge.
interface DatumPaint extends DatumFill {
readonly stroke?: string;
}What a resolver knows about the item it paints.
interface DatumPaintContext<TDatum = ChartDatum> {
readonly datum: TDatum;
readonly index: number;
readonly value: number;
readonly role?: ChartValueRole;
readonly seriesId: string;
readonly seriesName: string;
}A per-datum paint resolver: called for each item, returns the item's own paint or undefined for the series paint. It should be pure and cheap; the chart calls it once per item and data, and reads the cached result wherever the item's paint is shown. A result that is not a colour, or a resolver that throws, falls back to the series paint and is reported through the chart's diagnostics.
type DatumPaintResolver<
TPaint extends DatumFill = DatumFill,
TDatum = ChartDatum,
> = (context: DatumPaintContext<TDatum>) => TPaint | undefined;