# How to create a drilldown on dashboard for Vega-lite vis

**URL:** <https://discuss.elastic.co/t/how-to-create-a-drilldown-on-dashboard-for-vega-lite-vis/257632>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [December 4, 2020, 9:01am UTC](https://discuss.elastic.co/t/how-to-create-a-drilldown-on-dashboard-for-vega-lite-vis/257632 "2020-12-04T09:01:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Melok](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Melok](https://discuss.elastic.co/u/Melok)\
**Post date:** [December 4, 2020, 9:01am UTC](https://discuss.elastic.co/t/how-to-create-a-drilldown-on-dashboard-for-vega-lite-vis/257632/1 "2020-12-04T09:01:51Z")

</div>

> **[Screenshot](https://prnt.sc/vvls6a)**
>
> Captured with Lightshot

  
I am trying to create drilldown from vega vis to dashboard but it doesn't work. For example, for tables, this works correctly, by clicking on the magnifying glass icon, you can select the drilldown created.

Kibana version - 7.10

---

<div class="post-metadata">

**Author:** ![dosant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dosant/32/64489_2.png) [@dosant](https://discuss.elastic.co/u/dosant)\
**Post date:** [December 4, 2020, 10:35am UTC](https://discuss.elastic.co/t/how-to-create-a-drilldown-on-dashboard-for-vega-lite-vis/257632/2 "2020-12-04T10:35:37Z")

</div>

Hi @Melok,

I didn't try myself, bit the description from the [pr](https://github.com/elastic/kibana/pull/74848) that introduced drilldowns support in Vega might be helpful:

## Some tips how to test drilldows in VEGA

- Range Event:

```auto
{
$schema: https://vega.github.io/schema/vega/v5.json
marks: [{
  type: text
  encode: { update: { text: { value: "Click here" } } }
}]
signals: [ {
  on: [{
  events: click
  update: kibanaSetTimeFilter("2019", "2020")
  }]
}]}

```

- Filter Event:

```auto
{
$schema: https://vega.github.io/schema/vega/v5.json
marks: [{
  type: text
  encode: { update: { text: { value: "Click here" } } }
}]
signals: [ {
  on: [{
  events: click
  update: kibanaAddFilter({ match_phrase: { response: "200" }})
  }]
}]}

```

* * *

Basically drilldowns in Vega are tight to Kibana's filters and time range functionality. This is a guide how to use those in Vega: [https://www.elastic.co/guide/en/kibana/master/vega-tutorial-update-kibana-filters-from-vega.html](https://www.elastic.co/guide/en/kibana/master/vega-tutorial-update-kibana-filters-from-vega.html)

---

<div class="post-metadata">

**Author:** ![Melok](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Melok](https://discuss.elastic.co/u/Melok)\
**Post date:** [December 4, 2020, 10:46am UTC](https://discuss.elastic.co/t/how-to-create-a-drilldown-on-dashboard-for-vega-lite-vis/257632/3 "2020-12-04T10:46:42Z")

</div>

Thanks! But I use vega-lite.  
I can create such drilldown:

```auto
"transform": [{ 
       "calculate": "<some_url>", "as": "url"
    }]

```

...  
` "href": {"field": "url", "type": "ordinal"}`.

But kibana added built-in drilldowns created from the dashboard. It is not clear only how it works with vega-lite vis

---

<div class="post-metadata">

**Author:** ![Alexey\_Antonov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexey_antonov/32/48705_2.png) [@Alexey\_Antonov](https://discuss.elastic.co/u/Alexey_Antonov)\
**Post date:** [December 14, 2020, 2:14pm UTC](https://discuss.elastic.co/t/how-to-create-a-drilldown-on-dashboard-for-vega-lite-vis/257632/4 "2020-12-14T14:14:37Z")

</div>

I'm not sure that it's possible to use **Drilldowns** with **vega-lite**. First of all because **vega-lite** doesn't support `on` expressions yet. **Vega-lite** is only good for simple graphs, and once they become more complicated, it makes no sense to force it into more complicated usecases. Please use **vega** spec instead of **vega-lite**.

---

<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:** [January 11, 2021, 2:14pm UTC](https://discuss.elastic.co/t/how-to-create-a-drilldown-on-dashboard-for-vega-lite-vis/257632/5 "2021-01-11T14:14:45Z")

</div>

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