Skip to content

Documentation / @ripl/charts / applySegmentInteraction

Function: applySegmentInteraction() ​

applySegmentInteraction<TElement, TPayload>(element, options): void

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

Wires a chart segment's full hover treatment: the tooltip and highlight transition of applyHoverHighlight, plus the typed enter/leave/click events and the chart-wide highlight every segmented chart emits alongside them.

Type Parameters ​

Type ParameterDescription
TElement extends Element<Partial<BaseState>, ElementEventMap>The element type the hover is attached to.
TPayload extends InteractionPointThe chart's interaction event payload.

Parameters ​

ParameterTypeDescription
elementTElementThe segment element to make interactive.
optionsOmit<HoverHighlightOptions, "onEnter" | "onLeave" | "onClick"> & HoverHighlightStates<TElement> & SegmentInteractionOptions<TPayload>The hover treatment, together with the events the segment reports.

Returns ​

void