Skip to content

Commit

Permalink
Revert "docs: add example of rendering images in tooltips (vega#8048)"
Browse files Browse the repository at this point in the history
This reverts commit a92259e.
  • Loading branch information
ChiaLingWeng committed Nov 13, 2023
1 parent 1fa287a commit 6b9a38d
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 89 deletions.
Binary file removed examples/compiled/text_tooltip_image.png
Binary file not shown.
1 change: 0 additions & 1 deletion examples/compiled/text_tooltip_image.svg

This file was deleted.

61 changes: 0 additions & 61 deletions examples/compiled/text_tooltip_image.vg.json

This file was deleted.

18 changes: 0 additions & 18 deletions examples/specs/text_tooltip_image.vl.json

This file was deleted.

1 change: 0 additions & 1 deletion site/_includes/docs_toc.md
Expand Up @@ -374,6 +374,5 @@
- [Tooltip Based on Encoding]({{site.baseurl}}/docs/tooltip.html#encoding)
- [Tooltip Based on Underlying Data Point]({{site.baseurl}}/docs/tooltip.html#data)
- [Tooltip channel]({{site.baseurl}}/docs/tooltip.html#channel)
- [Tooltip image]({{site.baseurl}}/docs/tooltip.html#tooltip-image)
- [Disable tooltips]({{site.baseurl}}/docs/tooltip.html#disable-tooltips)
- [Vega Tooltip plugin]({{site.baseurl}}/docs/tooltip.html#plugin)
8 changes: 0 additions & 8 deletions site/docs/tooltip.md
Expand Up @@ -64,14 +64,6 @@ To avoid that the tooltips groups the data, add an aggregate to the tooltip enco

<div class="vl-example" data-name="bar_tooltip_aggregate"></div>

## Tooltip image

To display an image in a tooltip you can use the [Vega Tooltip plugin](#plugin). Vega Tooltip requires the special field name `image` to indicate that the field values should be rendered as images instead of displayed as text. The image tooltip can be specified either by setting the `tooltip` property of the mark definition (as detailed above) or by passing the field _as an array_ to the tooltip encoding channel, as in the example below:

<div class="vl-example" data-name="text_tooltip_image"></div>

In addition to providing the path to an image, the Vega Tooltip plugin can also render base64 encoded images prefixed with `data:image/png;base64,` [similarly to how these are rendered inside HTML image tags](https://www.w3docs.com/snippets/html/how-to-display-base64-images-in-html.html). To change the maximum size of the rendered tooltip images, you can adjust the `max-width` and `max-height` properties of the CSS selector `#vg-tooltip-element img`.

## Disable tooltips

To disable tooltips for a particular single view specification, you can set the `"tooltip"` property of a mark definition block to `null`.
Expand Down

0 comments on commit 6b9a38d

Please sign in to comment.