# Is there a Vega equivalent to the C #include directive

**URL:** <https://discuss.elastic.co/t/is-there-a-vega-equivalent-to-the-c-include-directive/266805>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [March 10, 2021, 12:31pm UTC](https://discuss.elastic.co/t/is-there-a-vega-equivalent-to-the-c-include-directive/266805 "2021-03-10T12:31:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kayak007](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kayak007/32/147597_2.png) [@Kayak007](https://discuss.elastic.co/u/Kayak007)\
**Post date:** [March 10, 2021, 12:31pm UTC](https://discuss.elastic.co/t/is-there-a-vega-equivalent-to-the-c-include-directive/266805/1 "2021-03-10T12:31:29Z")

</div>

Hi,

Couldn't find any reference to an existing way to include code from a file in a Kibana Vega visualisation, like the #include directive in C.

I have several Vega visualisations for which part of the code is the same but evolves frequently. So I have to modify each visualisation each time there's a change.

The idea would be to have this part in a text file that would be "included" in the Kibana Vega code and just modify the code in the text file instead of each visualisation.  
If there's another way to do it, I'd be happy to know.

Thanks.

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [March 10, 2021, 12:46pm UTC](https://discuss.elastic.co/t/is-there-a-vega-equivalent-to-the-c-include-directive/266805/2 "2021-03-10T12:46:14Z")

</div>

To my knowledge, no.

A good place to ask this or recommend a feature request would be on the [Vega GitHub](https://github.com/vega/vega/issues) page.

---

<div class="post-metadata">

**Author:** ![Kayak007](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kayak007/32/147597_2.png) [@Kayak007](https://discuss.elastic.co/u/Kayak007)\
**Post date:** [March 10, 2021, 12:57pm UTC](https://discuss.elastic.co/t/is-there-a-vega-equivalent-to-the-c-include-directive/266805/3 "2021-03-10T12:57:23Z")

</div>

Thanks, I'll try that.

---

<div class="post-metadata">

**Author:** ![Kayak007](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kayak007/32/147597_2.png) [@Kayak007](https://discuss.elastic.co/u/Kayak007)\
**Post date:** [March 10, 2021, 3:54pm UTC](https://discuss.elastic.co/t/is-there-a-vega-equivalent-to-the-c-include-directive/266805/4 "2021-03-10T15:54:25Z")

</div>

Tried it.  
Apparently it's considered to be a Kibana issue...

Will try on the Kibana GitHub page.

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [March 10, 2021, 5:34pm UTC](https://discuss.elastic.co/t/is-there-a-vega-equivalent-to-the-c-include-directive/266805/5 "2021-03-10T17:34:14Z")

</div>

Vega doesn't offer the functionality you are asking for and Kibana hasn't added to Vega to do this.

You could open a [Kibana issue](https://github.com/elastic/kibana/issues) (feature request) also but I think it's more likely we wouldn't add it unless Vega does.

---

<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:** [April 7, 2021, 5:34pm UTC](https://discuss.elastic.co/t/is-there-a-vega-equivalent-to-the-c-include-directive/266805/6 "2021-04-07T17:34:31Z")

</div>

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