Tooltip for Vega & Vega-Lite
A tooltip plugin for Vega and Vega-Lite visualizations.
The current version works with Vega 3 and Vega-Lite 2. For Vega 2 and Vega-Lite 1, use the old version of Vega-Tooltip.
Author
Vega Tooltip was built by Zening Qu and Sira Horradarn, with significant help from Dominik Moritz and Kanit "Ham" Wongsuphasawat.
Demo
http://vega.github.io/vega-tooltip/
Installing
NPM
If you use NPM, run command 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 3 & Vega-Lite 2 (does not have to be from CDN) -->
<script src="https://cdn.jsdelivr.net/npm/vega@3"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@2"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-tooltip@[VERSION]"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/vega-tooltip@[VERSION]/build/vega-tooltip.min.css">
APIs
For Vega-Lite: vegaTooltip.vegaLite(vgView, vlSpec[, options])
For Vega: vegaTooltip.vega(vgView[, options])
Tutorials
Run Instructions
- In the project folder
vega-tooltip
, type commandnpm install
to install dependencies. - Then, type
npm start
. This will build the library and start a web server. - In your browser, navigate to
http://localhost:8000/
, where you can see various Vega-Lite and Vega visualizations with tooltip interaction.