---
id: "packages/active-charts/all-exports/context-menu-elements"
title: "Context menu elements"
description: "CartesianPoint, CategoricalSlice, HeatmapCell, HierarchyElement and 3 more: generated from the source of active-charts."
url: "/packages/active-charts/all-exports/context-menu-elements"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:context-menu-elements"
---

# Context menu elements

Exported by `@workspace/active-charts`. Generated from the package source; part of [the index of every export](/packages/active-charts/all-exports).

## Types

**CartesianPoint**

```ts
interface CartesianPoint<TDatum = Record<string, unknown>> {
  datum: TDatum;
  xKey: string;
  yKey: string;
  seriesIndex: number;
  seriesName: string;
  datumIndex: number;
}
```

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.

**CategoricalSlice**

```ts
interface CategoricalSlice<TDatum = Record<string, unknown>> {
  datum: TDatum;
  index: number;
  value: number;
  category: string | null;
  fraction: 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
`categoryKey` was provided).

**HeatmapCell**

```ts
interface HeatmapCell<TDatum extends ChartDatum = ChartDatum> {
  datum: TDatum | null;
  x: string;
  y: string;
  value: number | null;
}
```

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 `colorKey` field.

**HierarchyElement**

```ts
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>
  >[];
}
```

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.length - 1] === node`). `depth` mirrors
`path.length - 1` and is provided for ergonomic predicates.

**RadarPoint**

```ts
interface RadarPoint<TDatum = Record<string, unknown>> {
  datum: TDatum;
  variable: string;
  value: number;
  seriesIndex: number;
  seriesName: string;
}
```

Radar data point — one (series, axis) intersection. Returned when
the user right-clicks near a vertex on a radar chart.

**SankeyElement**

```ts
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>
      >;
    };
```

Sankey element — discriminated union between a node and a link.
`kind` distinguishes the two; consumers branch on it to access the
matching payload.

**TimelineElement**

```ts
interface TimelineElement<TEvent = unknown> {
  event: TEvent;
  index: number;
}
```

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.
