Skip to main content

Tooltip

Defined in: ui.ts:1550

Represents a tooltip.

Constructors

Constructor

new Tooltip(): Tooltip

Returns

Tooltip

Accessors

isVisible

Get Signature

get isVisible(): boolean

Defined in: ui.ts:1615

Returns

boolean


onTooltipClosed

Get Signature

get onTooltipClosed(): Observable<any>

Defined in: ui.ts:1619

Returns

Observable<any>


onTooltipRequest

Get Signature

get onTooltipRequest(): Observable<any>

Defined in: ui.ts:1617

Returns

Observable<any>


onTooltipShown

Get Signature

get onTooltipShown(): Observable<any>

Defined in: ui.ts:1618

Returns

Observable<any>


root

Get Signature

get root(): HTMLElement

Defined in: ui.ts:1611

Returns a tooltip element.

Returns

HTMLElement

Methods

bind()

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

Defined in: ui.ts:1569

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" | "top" | "bottom" | "right" | null

Returns

HTMLElement


hide()

hide(): void

Defined in: ui.ts:1561

Hides the tooltip. Also cancels any pending showDelayed call.

Returns

void


show()

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

Defined in: ui.ts:1588

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: ui.ts:1606

Parameters

ParameterType
dataFrameDataFrame
indexPredicateIndexPredicate
xnumber
ynumber

Returns

void