Skip to main content

Interface: NearestHoverOptions

Defined in: packages/sdvplot/src/interact/nearest.ts:17

Options for nearestHover.

Properties​

dimension?​

readonly optional dimension?: "x" | "y" | "xy"

Defined in: packages/sdvplot/src/interact/nearest.ts:21

"xy" (the default): nearest in the plane. "x" / "y": nearest along that axis alone, ignoring the other.


label?​

readonly optional label?: (id) => { lines: readonly string[]; swatch?: string; } | null

Defined in: packages/sdvplot/src/interact/nearest.ts:27

The tooltip for a hovered id, shown at its point; null shows none. Default: no tooltip.

Parameters​

id​

string

Returns​

{ lines: readonly string[]; swatch?: string; } | null


padding?​

readonly optional padding?: number

Defined in: packages/sdvplot/src/interact/nearest.ts:25

A margin inside the svg's bounds, in px, where the pointer hovers nothing. Default 0.


points​

readonly points: readonly HoverPoint[]

Defined in: packages/sdvplot/src/interact/nearest.ts:19

Every hoverable mark's centre. Points with a non-finite coordinate are skipped.


radius?​

readonly optional radius?: number

Defined in: packages/sdvplot/src/interact/nearest.ts:23

Farthest hover, in px: Euclidean for "xy", along the axis for "x" / "y". Default: unlimited.