You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recommend using Vega-Embed, which already comes with this tooltip plugin.
You can install Vega tooltip directly with npm install vega-tooltip.
Using Vega-tooltip with a CDN
You can import vega-tooltip directly from jsDelivr. Replace [VERSION] with the version that you want to use.
<!-- Import Vega 5 & Vega-Lite 4 (does not have to be from CDN) --><scriptsrc="https://cdn.jsdelivr.net/npm/vega@5"></script><scriptsrc="https://cdn.jsdelivr.net/npm/vega-lite@4"></script><scriptsrc="https://cdn.jsdelivr.net/npm/vega-tooltip@[VERSION]"></script>
Usage and APIs
If you use Vega-Embed, you don't need to install Vega Tooltip! Vega Embed already comes with Vega Tooltip. You can however pass tooltip customizations.
vegaEmbed("#vis",spec,{tooltip: {theme: 'dark'}}).then(function(result){// result.view contains the Vega view}).catch(console.error);
If you want to use a different version of the tooltip handler, you can override the default handler with the handler from Vega Tooltip (and you need to install it separately).
varhandler=newvegaTooltip.Handler();vegaEmbed("#vis",spec,{tooltip: handler.call}).then(function(result){// result.view contains the Vega view}).catch(console.error);