Skip to main content

Tooltip

Functions

FunctionDescription
setCustomTooltipSets a custom function that will be called if present instead of the default tooltip UI.
getCustomTooltipGets the custom tooltip function.
isVisibleReturns whether or not a tooltip is showing
getDivReturns the HTML tooltip container.
getTooltipOfObjectReturns the tooltip text for the given element.
createDomCreate the tooltip div and inject it onto the page.
bindMouseEventsBinds the required mouse events onto an SVG element.
unbindMouseEventsUnbinds tooltip mouse events from the SVG element.
hideHide the tooltip.

Variables

VariableDescription
LIMITMaximum width (in characters) of a tooltip.
OFFSET_XHorizontal offset between mouse cursor and tooltip.
OFFSET_YVertical offset between mouse cursor and tooltip.
RADIUS_OKRadius mouse can move before killing tooltip.
HOVER_MSDelay before tooltip appears.
MARGINSHorizontal padding between tooltip and screen edge.

Type Aliases

Type AliasDescription
TipInfoA type which can define a tooltip. Either a string, an object containing a tooltip property, or a function which returns either a string, or another arbitrarily nested function which eventually unwinds to a string.
CustomTooltipA function that renders custom tooltip UI. 1st parameter: the div element to render content into. 2nd parameter: the element being moused over (i.e., the element for which the tooltip should be shown).