From 6b9a38d2af186fff1725e62a3cd48dbd8fc7449b Mon Sep 17 00:00:00 2001 From: "Weng, Chia-Ling" <75072960+ChiaLingWeng@users.noreply.github.com> Date: Mon, 13 Nov 2023 15:47:28 +0800 Subject: [PATCH] Revert "docs: add example of rendering images in tooltips (#8048)" This reverts commit a92259eb45b3d4a9ca0002e55c8dd2e38bc1ddb8. --- examples/compiled/text_tooltip_image.png | Bin 1921 -> 0 bytes examples/compiled/text_tooltip_image.svg | 1 - examples/compiled/text_tooltip_image.vg.json | 61 ------------------- examples/specs/text_tooltip_image.vl.json | 18 ------ site/_includes/docs_toc.md | 1 - site/docs/tooltip.md | 8 --- 6 files changed, 89 deletions(-) delete mode 100644 examples/compiled/text_tooltip_image.png delete mode 100644 examples/compiled/text_tooltip_image.svg delete mode 100644 examples/compiled/text_tooltip_image.vg.json delete mode 100644 examples/specs/text_tooltip_image.vl.json diff --git a/examples/compiled/text_tooltip_image.png b/examples/compiled/text_tooltip_image.png deleted file mode 100644 index 6899736a6dcd3019ef0736d09ff8149e470b3f09..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1921 zcmZ{lc{tnI8pkuYLn@lFOjRtU2-S=&getd!DpKn(wu+^y5n4M#)Y7rmQbr81jD4q; zinX=3(prMrDb-YBDWMfbNV&iMbDw*k``mM$bKd9t^S@_N5j36QJVJL;0uQ)2%a(Dx zhC)g(n|9aVXwkp^=RqXnGtbX*@-^C#9L@NI1feuXE34?{W>j-q+l_`<6Lh{g7>!2n z?e7om&*D+*o150*I&Hnk4@_oVyN|1@?w5A4t3LFuhX>*dYHDg71Qw3;O%feBQd}%G zuoehTiX~-cA{7);hDpk6=`uzSVttpMXQrp8r#ycA;ppoooAwe+bPo&D>gw!-NlIFf z=SLb`dbH|f2fMpFH@W2FPxI ze?Kx0)(d1UclolKoLoGE!I0tov-(W$)29k@va)YoRp!KhQB=HVZx4fVpCOaULd&sA zaXpdWa`p7|!uPjCFuQZl?rOyJM4dV>=!EUb^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 --- a/examples/compiled/text_tooltip_image.svg +++ /dev/null @@ -1 +0,0 @@ -data/ffox.pngdata/gimp.pngdata/7zip.png \ No newline at end of file diff --git a/examples/compiled/text_tooltip_image.vg.json b/examples/compiled/text_tooltip_image.vg.json deleted file mode 100644 index dc2bdf82655..00000000000 --- a/examples/compiled/text_tooltip_image.vg.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega/v5.json", - "description": "A simple chart with an image tooltip.", - "background": "white", - "padding": 5, - "width": 20, - "style": "cell", - "encode": {"update": {"stroke": {"value": null}}}, - "data": [ - { - "name": "source_0", - "values": [ - {"image": "data/ffox.png"}, - {"image": "data/gimp.png"}, - {"image": "data/7zip.png"} - ] - } - ], - "signals": [ - {"name": "y_step", "value": 20}, - { - "name": "height", - "update": "bandspace(domain('y').length, 1, 0.5) * y_step" - } - ], - "marks": [ - { - "name": "marks", - "type": "text", - "style": ["text"], - "from": {"data": "source_0"}, - "encode": { - "update": { - "fill": {"value": "black"}, - "tooltip": { - "signal": "{\"image\": isValid(datum[\"image\"]) ? datum[\"image\"] : \"\"+datum[\"image\"]}" - }, - "description": { - "signal": "\"image: \" + (isValid(datum[\"image\"]) ? datum[\"image\"] : \"\"+datum[\"image\"])" - }, - "x": {"signal": "width", "mult": 0.5}, - "y": {"scale": "y", "field": "image"}, - "text": { - "signal": "isValid(datum[\"image\"]) ? datum[\"image\"] : \"\"+datum[\"image\"]" - }, - "align": {"value": "center"}, - "baseline": {"value": "middle"} - } - } - } - ], - "scales": [ - { - "name": "y", - "type": "point", - "domain": {"data": "source_0", "field": "image", "sort": true}, - "range": {"step": {"signal": "y_step"}}, - "padding": 0.5 - } - ] -} diff --git a/examples/specs/text_tooltip_image.vl.json b/examples/specs/text_tooltip_image.vl.json deleted file mode 100644 index 8cc8d163a0a..00000000000 --- a/examples/specs/text_tooltip_image.vl.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "https://vega.github.io/schema/vega-lite/v5.json", - "view": {"stroke": null}, - "description": "A simple chart with an image tooltip.", - "data": { - "values": [ - {"image": "data/ffox.png"}, - {"image": "data/gimp.png"}, - {"image": "data/7zip.png"} - ] - }, - "mark": "text", - "encoding": { - "text": {"field": "image"}, - "y": {"field": "image", "axis": null}, - "tooltip": [{"field": "image"}] - } -} diff --git a/site/_includes/docs_toc.md b/site/_includes/docs_toc.md index cadca5682be..2ee43f932b2 100644 --- a/site/_includes/docs_toc.md +++ b/site/_includes/docs_toc.md @@ -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) diff --git a/site/docs/tooltip.md b/site/docs/tooltip.md index 56ea9a255a1..8be56a8f4f3 100644 --- a/site/docs/tooltip.md +++ b/site/docs/tooltip.md @@ -64,14 +64,6 @@ To avoid that the tooltips groups the data, add an aggregate to the tooltip enco
-## 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: - -
- -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`.