# Vega Image + Link display in Kibana

**URL:** https://discuss.elastic.co/t/vega-image-link-display-in-kibana/183877
**Category:** Kibana
**Tags:** vega
**Created:** [June 3, 2019, 4:25am UTC](https://discuss.elastic.co/t/vega-image-link-display-in-kibana/183877 "2019-06-03T04:25:28Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![AditiKhalatkar](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@AditiKhalatkar](https://discuss.elastic.co/u/AditiKhalatkar)
#### Post date: [June 3, 2019, 4:25am UTC](https://discuss.elastic.co/t/vega-image-link-display-in-kibana/183877/1 "2019-06-03T04:25:28Z")

</div>

Hi,

I am trying to get a visualization in Vega. I am able to get the result in Vega-editor, however not able to achieve the same in Kibana. Kindly guide.

The only difference between the two is that when I try to click on the image, it directs me to google in editor but the link is not working in Kibana

This is the Vega specification

```
{
  "$schema": "https://vega.github.io/schema/vega/v3.json",
  "description": "Navigation Bar Buttons.",
  "autosize": "pad",
  "padding": 5,
  "height": 100,
  "layout": {"padding": 20, "bounds": "full", "align": "each"},
  "marks": [
    {
      "type": "group",
      "encode": {"update": {"width": {"value": 270}, "height": {"value": 100}}},
      "marks": [
        {
          "type": "image",
          "encode": {
            "enter": {
              "url": {
                "value": "https://github.com/AditiKhalatkar/Images/blob/master/Home_Tab.png?raw=true"
              }
            },
            "update": {"href": {"value": "https://www.google.com"}}
          }
        }
      ]
    },
    {
      "type": "group",
      "encode": {"update": {"width": {"value": 270}, "height": {"value": 100}}},
      "marks": [
        {
          "type": "image",
          "encode": {
            "enter": {
              "url": {
                "value": "https://github.com/AditiKhalatkar/Images/blob/master/Home_Tab.png?raw=true"
              }
            }
          }
        }
      ]
    }
  ]
}

```

I have tried other vega-lite specifications in Kibana, the links work for those.

P.S : Is there any difference between vega and vega-lite settings for external url? I have added

`vega.enableExternalUrls: true`

in kibana.yml

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [June 3, 2019, 5:56pm UTC](https://discuss.elastic.co/t/vega-image-link-display-in-kibana/183877/2 "2019-06-03T17:56:18Z")

</div>

I tried [your script in the Vega Online Editor](https://vega.github.io/editor/#/url/vega/N4KABGBEAkDODGALApgWwIaQFxUQFzwAdYsB6UgN2QHN0A6agSz0QFcAjOxge1IRQyUa6SgGY6AK1jcAdpAA04KABNkCAE6NCeHnJyQAcugqNaO2WABC6dVdYFZsOgqWR097rEYAvZNiiE6MoKYK6BysqMMtT+AKyKEJAopvj+AIwADBkJUAA26ACe3Pb+wJDhkdH+AEzZUOzFMsqw-pAAZqy5uSFuuaZ6UMjoSJAAvjmQGOoA1i04ANpKEKAQq1B4BYR++tTqxYQua4nIMvDcqqWQrITK6HjbYGUA7ozKLJcU6LmsD9UA7BlxrhkCk8B8vj90llRjCcmtJjZZv5FkdVitUatIBstq1GBhqH44RjICczhccOiMZiTvd1KUllTMax1N0KQzGZjPt8HkkCMQyKQmCwOHQzqhSABBSI6ADSiC+d2mNlIAEl8WpSOxctx2KQMLBaaQABLcVDIAD6ABV0JxCNEAPzqdBPAC8eHUkPZjNGXtR419RyuNzuDzKiHUyDa4O5rXwRBI5CeSYY3G41FyyFFprGPo5uYx+bWAF0Gf61pTMdiebt9odA6TzqGg7d7pcXm9ENHITh-oD5MDQV2HplAbCvQiZnMwCiMRXUVjNjy8egCXWqSTTo36RzjjJadud4lmazHgH11zu7g+QnBcw2JwxZLpYw5Qq8Er1Kr1bBNdrdfrDRNM0rRtOg7WoR1nTdD0-DPI5C29OCELWZCwBLFClBLUYgA) but the link does not work there either.

Are you sure this is the correct Vega code?

---

<div class="post-metadata">

### Author: ![AditiKhalatkar](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@AditiKhalatkar](https://discuss.elastic.co/u/AditiKhalatkar)
#### Post date: [June 3, 2019, 6:05pm UTC](https://discuss.elastic.co/t/vega-image-link-display-in-kibana/183877/3 "2019-06-03T18:05:40Z")

</div>

Thanks for trying the code!  
Just to confirm one more time, I am pasting the output of my Vega Online Editor response.  
 ![Tab_Structure](https://us1.discourse-cdn.com/elastic/original/3X/b/8/b83a80efa6055e8af01a277fdbd734232a5bc80d.jpeg)

When I click on Yelllow Dot (This is edited picture), it gets directed to [google.com](http://google.com) in my editor.

Kindly let me know if I am going wrong somewhere or if some other output is needed.

[Vega Editor Link](https://vega.github.io/editor/#/url/vega/N4KABGBEAkDODGALApgWwIaQFxUQFzwAdYsB6UgN2QHN0A6agSz0QFcAjOxge1IRQyUa6SgGY6AK1jcAdpAA04KABNkCAE6NCeHnJyQAcugqNaO2WABC6dVdYFZsOgqWR097rEYAvZNiiE6MoKYK6BysqMMtT+AKyKEJAopvj+AIwADBkJUAA26ACe3Pb+wJDhkdH+AEzZUOzFMsqw-pAAZqy5uSFuuaZ6UMjoSJAAvjmQGOoA1i04ANpKEKAQq1B4BYR++tTqxYQua4nIMvDcqqWQrITK6HjbYGUA7ozKLJcU6LmsD9UA7BlxrhkCk8B8vj90llRjCcmtJjZZv5FkdVitUatIBstq1GBhqH44RjICczhccOiMZiTvd1KUllTMax1N0KQzGZjPt8HkkCMQyKQmCwOHQzqhSABBSI6ADSiC+d2mNlIAEl8WpSOxctx2KQMLBaaQABLcVDIAD6ABV0JxCNEAPzqdBPAC8eHUkPZjNGXtR419RyuNzuDzKiHUyDa4O5rXwRBI5CeSYY3G41FyyFFprGPo5uYx+bWAF0Gf61pTMdiebt9odA6TzqGg7d7pcXm9ENHITh-oD5MDQV2HplAbCvQiZnMwCiMRXUVjNjy8egCXWqSTTo36RzjjJadud4lmazHgH11zu7g+QnBcw2JwxZLpYw5Qq8Er1Kr1bBNdrdfrDRNM0rRtOg7WoR1nTdD0-DPI5C29OCELWZCwBLFClBLUYgA)

Can you share your Vega Editor Response? When I clicked on the link you provided, I got the above response.

Thanks.

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [June 3, 2019, 6:19pm UTC](https://discuss.elastic.co/t/vega-image-link-display-in-kibana/183877/4 "2019-06-03T18:19:17Z")

</div>

Ah, I see now. The link was not working for me because I had the renderer set to `canvas` in the Editor. The renderer is configurable in Kibana. See the script below.

```auto
{
  "$schema": "https://vega.github.io/schema/vega/v3.json",
  config: {
    kibana: {
      renderer: svg
      }
  },
  "description": "Navigation Bar Buttons.",
  "autosize": "pad", 
  "padding": 5,
  "height": 100,
  "layout": {"padding": 20, "bounds": "full", "align": "each"},
  "marks": [
    {
      "type": "group",
      "encode": {"update": {"width": {"value": 270}, "height": {"value": 100}}},
      "marks": [
        {
          "type": "image",
          "encode": {
            "enter": {
              "url": {
                "value": "https://github.com/AditiKhalatkar/Images/blob/master/Home_Tab.png?raw=true"
              }
            },
            "update": {"href": {"value": "https://www.google.com"}}
          }
        }
      ]
    },
    {
      "type": "group",
      "encode": {"update": {"width": {"value": 270}, "height": {"value": 100}}},
      "marks": [
        {
          "type": "image",
          "encode": {
            "enter": {
              "url": {
                "value": "https://github.com/AditiKhalatkar/Images/blob/master/Home_Tab.png?raw=true"
              }
            }
          }
        }
      ]
    }
  ]
}

```

---

<div class="post-metadata">

### Author: ![AditiKhalatkar](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@AditiKhalatkar](https://discuss.elastic.co/u/AditiKhalatkar)
#### Post date: [June 3, 2019, 6:24pm UTC](https://discuss.elastic.co/t/vega-image-link-display-in-kibana/183877/5 "2019-06-03T18:24:50Z")

</div>

Great! Its working now. Thanks a lot.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 1, 2019, 6:24pm UTC](https://discuss.elastic.co/t/vega-image-link-display-in-kibana/183877/6 "2019-07-01T18:24:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
