surfaceTooltip
Returns the handlers that show a tooltip while the pointer rests on an element.
@internote/canvas-sdk/reactOn this page
import { surfaceTooltip } from '@internote/canvas-sdk/react';Not a hook, so it can be called once per dot in a loop. tip may be a function, which is then asked only when the pointer arrives: a mark of a thousand readings formats one of them, not a thousand, and none while the reader is not looking. A function returning null shows nothing.
A press or a wheel takes the card down: either is the reader moving the picture, and the card would be left pointing where the mark was.
#Signature
(
where: Addressed,
tip: SurfaceTip | (() => SurfaceTip | null),
): SurfaceTooltipProps#Parameters
whereWhich environment the element is drawn in — its context, or the key a mark is handed.
tipWhat the tooltip says, or how to work it out.
#Example
<circle cx={cx} cy={cy} r={r} {...surfaceTooltip(environmentKey, () => ({ rows: [{ label: 'x', value: '2.5' }] }))} />Declared in packages/canvas-sdk/src/react/surface-tooltip.tsx:113.