# How to compile Vega-Lite project to Vega?

**URL:** https://discuss.elastic.co/t/how-to-compile-vega-lite-project-to-vega/259837
**Category:** Kibana
**Tags:** vega
**Created:** [December 29, 2020, 11:03pm UTC](https://discuss.elastic.co/t/how-to-compile-vega-lite-project-to-vega/259837 "2020-12-29T23:03:30Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Ganymede](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Ganymede](https://discuss.elastic.co/u/Ganymede)
#### Post date: [December 29, 2020, 11:03pm UTC](https://discuss.elastic.co/t/how-to-compile-vega-lite-project-to-vega/259837/1 "2020-12-29T23:03:30Z")

</div>

Hello all,

Literally title.  
I have a working project in Vega-Lite and want to add "Vega only features" ontop of it.

Is it possible to compile the Vega-Lite script and look at the resulting Vega output?  
As far as I'm aware Vega-Lite gets already converted to Vega automatically but I don't know where to look at the resulting code.

So far I haven't found any clue on how to it. But I'm certain this is possible.

Thanks in advance 🙂

---

<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: [December 30, 2020, 2:59pm UTC](https://discuss.elastic.co/t/how-to-compile-vega-lite-project-to-vega/259837/2 "2020-12-30T14:59:08Z")

</div>

If you click the wrench icon in the Kibana vega editor, we offer a "compile to Vega" option.

---

<div class="post-metadata">

### Author: ![Ganymede](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Ganymede](https://discuss.elastic.co/u/Ganymede)
#### Post date: [December 31, 2020, 11:50am UTC](https://discuss.elastic.co/t/how-to-compile-vega-lite-project-to-vega/259837/3 "2020-12-31T11:50:52Z")

</div>

Hi, thanks for the input.  
Unfortunately the only options I see are HJSON \<\> JSON reformat options. (Kibana 7.9).

Is there an alternative to compile the code?

But good to know that this feature exists. I will investigate why the option doesn't show up in my editor and only the 2 reformat options.

Thank you very much 🙂

---

<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: [December 31, 2020, 6:10pm UTC](https://discuss.elastic.co/t/how-to-compile-vega-lite-project-to-vega/259837/4 "2020-12-31T18:10:24Z")

</div>

You're right, that is definitely not present any more. There are two other workarounds I could suggest:

1. You can type into your browser console `VEGA_DEBUG.vega_spec` which is the spec that actually gets rendered. There's an equivalent `VEGA_DEBUG.vegalite_spec` too. Assuming you have an ES query, this will contain the _results_ of your query in array form.
2. You can convert your spec to JSON and then use the online Vega-Lite editor to convert to Vega.

---

<div class="post-metadata">

### Author: ![Ganymede](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Ganymede](https://discuss.elastic.co/u/Ganymede)
#### Post date: [January 1, 2021, 6:50pm UTC](https://discuss.elastic.co/t/how-to-compile-vega-lite-project-to-vega/259837/5 "2021-01-01T18:50:18Z")

</div>

Thank you so much for the clarification on that. I stumbled over this approach - kind of. But now it's very clear on how to proceed.

Thanks again! 🙂

---

<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 29, 2021, 6:50pm UTC](https://discuss.elastic.co/t/how-to-compile-vega-lite-project-to-vega/259837/6 "2021-01-29T18:50:39Z")

</div>

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