Skip to content

Core Reference

Core config is shared by all tooltip modules.

OptionDefaultDescription
selectorModule-specificCSS selector used to find tooltip targets.
prefetchsmartData fetch strategy: smart, all, or none.
prefetchThreshold15Element count used by smart prefetch behavior.
visualPreloadhoverOptional visual dependency warmup strategy: hover, init, or none.
debugTimingsfalseLogs tooltip lifecycle timing checkpoints to the browser console.
themeautoTippy theme: auto, light, dark, material, translucent, or light-border.
tooltipWidthModule-specificOptional fixed max width in pixels.
tooltipHeightNoneOptional fixed max height in pixels.
constrainToViewporttrueKeeps large tooltips within the visible viewport.
tippyOptionsModule defaultsOptions passed to the main Tippy instance.
nestedTippyOptionsModule defaultsOptions passed to nested popovers.

Visual Preload

prefetch controls data requests. visualPreload is separate: it warms optional rendering dependencies used by visual sections, such as the MyGene D3 gene track and ideogram.

ts
GeneTooltip.init({
  visualPreload: 'hover'
});
ValueBehavior
hoverDefault. Starts loading visual dependencies on the first hover or focus before the tooltip render path needs them.
initStarts loading visual dependencies immediately after init(). Useful for demo pages or apps where first-hover smoothness matters more than initial page idle work.
noneLeaves visual dependencies fully lazy.

Timing Debug

Use debugTimings while diagnosing lifecycle or performance issues.

ts
GeneTooltip.init({
  debugTimings: true
});

When enabled, Bio Tooltips logs relative timing checkpoints for events such as onShow, cache hits, content rendering, visual rendering, D3/Ideogram loading, and nested tooltip attachment. Leave this disabled in production unless you are actively debugging.

Tippy Options

Any supported Tippy.js option can be passed through tippyOptions.

ts
GeneTooltip.init({
  tippyOptions: {
    placement: 'right',
    delay: [100, 50]
  }
});

The library sets interactive defaults so users can pin, scroll, copy, and click links inside tooltips.

Cleanup

init() returns a cleanup function. Use it when a framework unmounts a component or when a page replaces the tooltip targets.

ts
const cleanup = ChemicalTooltip.init();
cleanup();