Skip to content

Documentation / @ripl/charts / HoverHighlightStates

Type Alias: HoverHighlightStates<TElement> ​

HoverHighlightStates<TElement> = { highlight: StateOf<TElement>; restore: StateOf<TElement>; } | { highlight?: undefined; restore?: undefined; }

Defined in: charts/src/core/interaction.ts:77

The pair of states a hover transitions between, given together or not at all: an element handed a highlight without the restore that undoes it would be stranded highlighted once the pointer left.

Type Parameters ​

Type ParameterDescription
TElement extends ElementThe element type the states are applied to.

Union Members ​

Type Literal ​

{ highlight: StateOf<TElement>; restore: StateOf<TElement>; }

highlight ​

highlight: StateOf<TElement>

Target state applied while hovered.

restore ​

restore: StateOf<TElement>

Target state applied when the pointer leaves, undoing highlight.


Type Literal ​

{ highlight?: undefined; restore?: undefined; }

highlight? ​

optional highlight?: undefined

Omitted for a chart whose hover treatment is carried entirely by onEnter/onLeave.

restore? ​

optional restore?: undefined

Omitted alongside highlight.