Skip to main content

Home > blockly > Tooltip

Tooltip namespace

Functions

FunctionDescription
bindMouseEvents(element)Binds the required mouse events onto an SVG element.
createDom()Create the tooltip div and inject it onto the page.
getCustomTooltip()Gets the custom tooltip function.
getDiv()Returns the HTML tooltip container.
getTooltipOfObject(object)Returns the tooltip text for the given element.
hide()Hide the tooltip.
isVisible()Returns whether or not a tooltip is showing
setCustomTooltip(customFn)Sets a custom function that will be called if present instead of the default tooltip UI.
unbindMouseEvents(element)Unbinds tooltip mouse events from the SVG element.

Variables

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

Type Aliases

Type AliasDescription
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).
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.