Skip to main content

Tooltip

Defined in: js-api/src/widgets/tooltip.ts:22

Represents a tooltip.

Constructors​

Constructor​

new Tooltip(): Tooltip

Returns​

Tooltip

Accessors​

isVisible​

Get Signature​

get isVisible(): boolean

Defined in: js-api/src/widgets/tooltip.ts:89

Whether a tooltip is currently shown.

Returns​

boolean


onTooltipClosed​

Get Signature​

get onTooltipClosed(): Observable<any>

Defined in: js-api/src/widgets/tooltip.ts:96

Fires after the tooltip closes.

Returns​

Observable<any>


onTooltipRequest​

Get Signature​

get onTooltipRequest(): Observable<any>

Defined in: js-api/src/widgets/tooltip.ts:92

Fires when a tooltip is about to be shown.

Returns​

Observable<any>


onTooltipShown​

Get Signature​

get onTooltipShown(): Observable<any>

Defined in: js-api/src/widgets/tooltip.ts:94

Fires after a tooltip is shown.

Returns​

Observable<any>


root​

Get Signature​

get root(): HTMLElement

Defined in: js-api/src/widgets/tooltip.ts:84

Returns a tooltip element.

Returns​

HTMLElement

Methods​

bind()​

bind(element, tooltip?, tooltipPosition?): HTMLElement

Defined in: js-api/src/widgets/tooltip.ts:41

Associated the specified visual element with the corresponding item. Example: https://public.datagrok.ai/js/samples/ui/tooltips/tooltips

Parameters​

ParameterType
elementHTMLElement
tooltip?string | (() => string | HTMLElement | null) | null
tooltipPosition?"left" | "right" | "top" | "bottom" | null

Returns​

HTMLElement


hide()​

hide(): void

Defined in: js-api/src/widgets/tooltip.ts:33

Hides the tooltip. Also cancels any pending showDelayed call.

Returns​

void


show()​

show(content, x, y, options?): void

Defined in: js-api/src/widgets/tooltip.ts:60

Shows the tooltip at the specified position.

Any pending delayed show is cancelled first. Passing null/undefined for content hides the tooltip and cancels any pending show — ideal for hover handlers where a single call replaces the show+hide+debounce quartet:

onMouseMove(e) {
const t = getTooltipFor(e); // string | HTMLElement | null
ui.tooltip.show(t, e.x + 16, e.y + 16, {delay: 200});
}

Parameters​

ParameterType
contentstring | HTMLElement | null | undefined
xnumber
ynumber
options?ITooltipOptions

Returns​

void


showRowGroup()​

showRowGroup(dataFrame, indexPredicate, x, y): void

Defined in: js-api/src/widgets/tooltip.ts:79

Shows the standard tooltip for the rows of [dataFrame] that satisfy [indexPredicate].

Parameters​

ParameterType
dataFrameDataFrame
indexPredicateIndexPredicate
xnumber
ynumber

Returns​

void