Skip to content

Changes in Vega Tooltip 0.9

Dominik Moritz edited this page Apr 25, 2018 · 3 revisions

Vega Tooltip 0.9 and above use some new capabilities in Vega 3.3 and Vega-Lite 2.4. Learn the new API at https://github.com/vega/vega-tooltip#usage-and-apis. Read about the background behind these changes at https://github.com/vega/vega/issues/1198. The awesome thing about these changes in that you can define the format of tooltips in one place (the spec), if you don't use Vega Tooltip, your users still get the same tooltips with native HTML tooltips, and you could use another extension that implements the Vega tooltips handler API.

FAQ

How do I install Vega Tooltip in Embed?

If you use Vega-Embed 3.7 and above, you will already have Vega-Tooltip installed so just remove any existing Vega Tooltip. You can customize Vega Tooltip in Vega Embed. We recommend upgrading.

I don't see any tooltips. Why?

Vega Tooltip now uses Tooltips defined in Vega. https://github.com/vega/vega/issues/1198 explains why we do this. This means that you have to define the tooltip mark property in Vega or use the tooltip channel in Vega-Lite.

How do I customize tooltips now? Where is fields?

You now customize tooltips in Vega and Vega-Lite itself. In Vega, use expressions to format tooltips. In Vega-Lite, use the format field definition property.

Do I have to use Vega Tooltip?

No. That's the awesome thing about the changes. You can use the implementation you like (including just native HTML tooltips with the title attribute). However, we think that you will like our implementation.