# Is it possible to integrate JavaScript and Kibana?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-integrate-javascript-and-kibana/213940>\
**Category:** Kibana\
**Created:** [January 6, 2020, 7:37pm UTC](https://discuss.elastic.co/t/is-it-possible-to-integrate-javascript-and-kibana/213940 "2020-01-06T19:37:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anelson-edge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anelson-edge/32/52865_2.png) [@anelson-edge](https://discuss.elastic.co/u/anelson-edge)\
**Post date:** [January 6, 2020, 7:37pm UTC](https://discuss.elastic.co/t/is-it-possible-to-integrate-javascript-and-kibana/213940/1 "2020-01-06T19:37:41Z")

</div>

I am in a quandary here.  
I would like to have JavaScript abilities (like buttons)  
_AND_  
Kibana for global filters and the selected timerange.

I could write my GUI using JS to talk directly to ES, but then I lose Kibana filters.

I could write my GUI using Kibana + Vega, but then I can't have buttons AFAICT -- see this post: [https://github.com/elastic/kibana/issues/30626](https://github.com/elastic/kibana/issues/30626).

Or to put my question in more concrete terms, try this Vega example in Kibana and notice the lack of buttons: [https://vega.github.io/editor/#/examples/vega/nested-bar-chart](https://vega.github.io/editor/#/examples/vega/nested-bar-chart)

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [January 6, 2020, 7:41pm UTC](https://discuss.elastic.co/t/is-it-possible-to-integrate-javascript-and-kibana/213940/2 "2020-01-06T19:41:01Z")

</div>

Have you considered developing a custom visualization plugin for Kibana? It sounds like you want access to the Kibana context, but more control than Vega. That is what the plugin system is for.

---

<div class="post-metadata">

**Author:** ![anelson-edge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anelson-edge/32/52865_2.png) [@anelson-edge](https://discuss.elastic.co/u/anelson-edge)\
**Post date:** [January 6, 2020, 10:59pm UTC](https://discuss.elastic.co/t/is-it-possible-to-integrate-javascript-and-kibana/213940/3 "2020-01-06T22:59:11Z")

</div>

Thank you for responding @wylie.  
My JS skills are limited and writing a custom Kibana plugin sounds a bit daunting.  
I did watch the youtube video by Luc Laverdure , and I struggled to follow his wizardry.  
I was hoping to add just a tiny amount of interactivity using snippets of JS in my Vega viz.  
I wish I could convince my manager to give me the time to it would take me to write a custom Kibana plugin, but I don't foresee that happening.

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [January 6, 2020, 11:21pm UTC](https://discuss.elastic.co/t/is-it-possible-to-integrate-javascript-and-kibana/213940/4 "2020-01-06T23:21:35Z")

</div>

Your other option might be Canvas, it also has some support for interactivity.

---

<div class="post-metadata">

**Author:** ![anelson-edge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anelson-edge/32/52865_2.png) [@anelson-edge](https://discuss.elastic.co/u/anelson-edge)\
**Post date:** [January 6, 2020, 11:54pm UTC](https://discuss.elastic.co/t/is-it-possible-to-integrate-javascript-and-kibana/213940/5 "2020-01-06T23:54:12Z")

</div>

I could try Canvas. Sometimes the SQL language is too limited (relative to the Elasticsearch Query Language), but I'd be happy to try it.

I found this post: [Kibana Canvas - Support for Interactive features](https://discuss.elastic.co/t/kibana-canvas-support-for-interactive-features/202651) which is really what I want -- especially the click to filter.

Is there some example you can point me to of the "limited" interactivity support that you refer to?

---

<div class="post-metadata">

**Author:** ![anelson-edge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anelson-edge/32/52865_2.png) [@anelson-edge](https://discuss.elastic.co/u/anelson-edge)\
**Post date:** [January 7, 2020, 12:04am UTC](https://discuss.elastic.co/t/is-it-possible-to-integrate-javascript-and-kibana/213940/6 "2020-01-07T00:04:20Z")

</div>

Also, Vega solved many problems for me which is why I was hoping for a Vega solution.  
Vega let me do the joins on small data, pick out buried fields from complicated responses to Elasticsearch and in general let me ETL my data for effective visualization.

Here is a sample of my Query and the Vega to interpret the response that I'm not sure I can say in Canvas (maybe the query, but the Vega transform is quite lovely) . 🙂

[https://gist.github.com/anelson-vidscale/5406d0b15b15adb3df47be9d180cbf51](https://gist.github.com/anelson-vidscale/5406d0b15b15adb3df47be9d180cbf51)

---

<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:** [February 4, 2020, 12:04am UTC](https://discuss.elastic.co/t/is-it-possible-to-integrate-javascript-and-kibana/213940/7 "2020-02-04T00:04:30Z")

</div>

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