Charts
API reference

Events

Types of pointer, drag, key and crosshair events, tooltips and menu entries.

See Interaction.

/**
 * A pointer event on the script's pane. `hitId` is the topmost `g.hit` under
 * the pointer, `null` when none.
 */
export type PointerEventOf<S extends Surface> = PointerOf<S> & {
  readonly hitId: string | null;
  readonly modifiers: Modifiers;
};

Prop

Type

Prop

Type

Prop

Type

/**
 * Drag of a `draggable` hit. `Start` fires once the pointer moved past the
 * drag threshold, with the press position. `Cancel` means the browser took
 * the pointer: restore the state from before `Start`.
 */
export type DragEventOf<S extends Surface> =
  | ({ readonly type: "Start"; readonly hitId: string } & PointerOf<S>)
  | ({ readonly type: "Move"; readonly hitId: string } & PointerOf<S>)
  | ({ readonly type: "End"; readonly hitId: string } & PointerOf<S>)
  | { readonly type: "Cancel"; readonly hitId: string };

Prop

Type

Prop

Type

Tooltips and menus

/** What `onHover` shows next to the pointer: plain text, label rows or a widget. */
export type TooltipContent = string | Tooltip | Widget;

Prop

Type

Prop

Type

Prop

Type

On this page