# Problem about embedding visualizations. Any clue about this?

**URL:** <https://discuss.elastic.co/t/problem-about-embedding-visualizations-any-clue-about-this/113597>\
**Category:** Kibana\
**Created:** [December 29, 2017, 1:45pm UTC](https://discuss.elastic.co/t/problem-about-embedding-visualizations-any-clue-about-this/113597 "2017-12-29T13:45:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesusgn90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesusgn90/32/26998_2.png) [@jesusgn90](https://discuss.elastic.co/u/jesusgn90)\
**Post date:** [December 29, 2017, 1:45pm UTC](https://discuss.elastic.co/t/problem-about-embedding-visualizations-any-clue-about-this/113597/1 "2017-12-29T13:45:08Z")

</div>

ISSUE: [https://github.com/elastic/kibana/issues/15790](https://github.com/elastic/kibana/issues/15790)

**Kibana version** : 6.1.1

**Elasticsearch version** : 6.1.1

**Server OS version** : CentOS 7

**Browser version** : Versión 63.0.3239.84 (Build oficial) (64 bits)

**Browser OS version** : Ubuntu 16.04

**Original install method (e.g. download page, yum, from source, etc.)**: yum

**Description of the problem including expected versus actual behavior** :

I have a directive which inside execute this:

`loader.embedVisualizationWithSavedObject($("#"+$scope.visID), visualization, params)`

My directive is declared as `kbnVis`, so I use it on the HTML as follow:

`<kbn-vis vis-id="'my-awesome-id'" id="my-awesome-id"></kbn-vis>`

That's fine and working, but my problem is that whenever I go again to that view the embeder function takes a bit more time, and if you go to another tab and come back again it takes more and more time...

```auto
my-awesome-id: 1.985s
my-awesome-id: 3.112s
my-awesome-id: 4.887s
my-awesome-id: 7.068s

```

Also I noticed some strange things taking some heap memory snapshots with Chrome Dev Tools:

1. Go to TAB-A --\> take a snapshot
2. Go to TAB-B --\> take a snapshot
3. Go to TAB-A --\> take a snapshot
4. Go to TAB-B --\> take a snapshot

Those snapshots have a property called SavedVis, where I can see that is a list of visualizations that is growing up more and more.

Both TAB-A and TAB-B have some visualizations rendered as described before.

- Can I manage currently number of rendered visualizations?
- Can I prevent this situation?
- Had you knowledge about this situation?
- Is it related to the "scope" polluting or something similar?

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [December 29, 2017, 4:15pm UTC](https://discuss.elastic.co/t/problem-about-embedding-visualizations-any-clue-about-this/113597/2 "2017-12-29T16:15:16Z")

</div>

Hi,

I will ask our viz team to take a look at it. But you did already create an issue and @timroes will definitely help 🙂

Cheers!  
Bhavya

---

<div class="post-metadata">

**Author:** ![jesusgn90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesusgn90/32/26998_2.png) [@jesusgn90](https://discuss.elastic.co/u/jesusgn90)\
**Post date:** [December 29, 2017, 4:33pm UTC](https://discuss.elastic.co/t/problem-about-embedding-visualizations-any-clue-about-this/113597/3 "2017-12-29T16:33:29Z")

</div>

Yes!, thank you so much @bhavyarm I'm currently working on a workarround this and maybe I fix it until this issue advance with the Elastic team!

Regards,  
Jesús.

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [December 29, 2017, 5:59pm UTC](https://discuss.elastic.co/t/problem-about-embedding-visualizations-any-clue-about-this/113597/4 "2017-12-29T17:59:25Z")

</div>

Since this is kind of in between a question an a bug, I think it's okay you posted it in the forums and the issue tracker. Since I can't rule out yet, that this might be a bug, I would refer to the issue for further communication 🙂

---

<div class="post-metadata">

**Author:** ![jesusgn90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jesusgn90/32/26998_2.png) [@jesusgn90](https://discuss.elastic.co/u/jesusgn90)\
**Post date:** [January 3, 2018, 4:12pm UTC](https://discuss.elastic.co/t/problem-about-embedding-visualizations-any-clue-about-this/113597/5 "2018-01-03T16:12:39Z")

</div>

UPDATED: [https://github.com/elastic/kibana/issues/15843](https://github.com/elastic/kibana/issues/15843)

I know this is closed, but it doesn't work as expected. loader.embedVisualizationWithSavedObject(...); in the tag 6.1.1 returns a promise that resolves the handler. Then I try to use handler.destroy() and get this.$broadcast is not a function, so I can't fully remove the visualization. What can I do @timroes ?

---

<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 31, 2018, 4:12pm UTC](https://discuss.elastic.co/t/problem-about-embedding-visualizations-any-clue-about-this/113597/6 "2018-01-31T16:12:55Z")

</div>

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