Context menu elements
CartesianPoint, CategoricalSlice, HeatmapCell, HierarchyElement and 3 more: generated from the source of active-charts.
Exported by @workspace/. Generated from the package source; part of the index of every export.
Types#
Cartesian data point — the active point at the moment the context menu was opened on a line, area, bar, scatter, histogram, waterfall, box-plot, candlestick, ohlc, range-area, range-bar, dumbbell, or lollipop chart.
The element resolves to null when the user opens the menu over empty plot area with no nearby data point.
interface CartesianPoint<TDatum = Record<string, unknown>> {
datum: TDatum;
xKey: string;
yKey: string;
seriesIndex: number;
seriesName: string;
datumIndex: number;
}Categorical slice — the slice/segment the user right-clicked on a pie, donut, funnel, nightingale, or radial-bar chart.
index is the row index into the chart's data array (pre-legend filtering). fraction is the slice's share of the visible total [0..1]. category is the resolved label (may be null when no category was provided).
interface CategoricalSlice<TDatum = Record<string, unknown>> {
datum: TDatum;
index: number;
value: number;
category: string | null;
fraction: number;
}Heatmap cell — the (x, y) intersection the user right-clicked.
datum is null for sparse cells (no data row at this intersection). value mirrors that nullability — present only when the underlying row has a numeric color field.
interface HeatmapCell<TDatum extends ChartDatum = ChartDatum> {
datum: TDatum | null;
x: string;
y: string;
value: number | null;
}Hierarchy element — a node in a treemap, sunburst, or org chart. path is the root-to-node chain, inclusive of the node itself (path[path.). depth mirrors path. and is provided for ergonomic predicates.
interface HierarchyElement<TExtra = unknown> {
node: HierarchyNode<
TExtra extends Record<string, unknown> ? TExtra : Record<string, unknown>
>;
depth: number;
path: HierarchyNode<
TExtra extends Record<string, unknown> ? TExtra : Record<string, unknown>
>[];
}Radar data point — one (series, axis) intersection. Returned when the user right-clicks near a vertex on a radar chart.
interface RadarPoint<TDatum = Record<string, unknown>> {
datum: TDatum;
variable: string;
value: number;
seriesIndex: number;
seriesName: string;
}Sankey element — discriminated union between a node and a link. kind distinguishes the two; consumers branch on it to access the matching payload.
type SankeyElement<TNodeExtra = unknown, TLinkExtra = unknown> =
| {
kind: 'node';
node: NodeDatum<
TNodeExtra extends Record<string, unknown>
? TNodeExtra
: Record<string, unknown>
>;
}
| {
kind: 'link';
link: LinkDatum<
TLinkExtra extends Record<string, unknown>
? TLinkExtra
: Record<string, unknown>
>;
};Timeline element — the event the user right-clicked on a timeline chart. index is the position of the event in the chart's data array.
interface TimelineElement<TEvent = unknown> {
event: TEvent;
index: number;
}