# Tree Visualizations in Kibana

**URL:** <https://discuss.elastic.co/t/tree-visualizations-in-kibana/166995>\
**Category:** Kibana\
**Created:** [February 4, 2019, 4:42pm UTC](https://discuss.elastic.co/t/tree-visualizations-in-kibana/166995 "2019-02-04T16:42:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaurav\_Bahl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaurav_bahl/32/43944_2.png) [@Gaurav\_Bahl](https://discuss.elastic.co/u/Gaurav_Bahl)\
**Post date:** [February 4, 2019, 4:42pm UTC](https://discuss.elastic.co/t/tree-visualizations-in-kibana/166995/1 "2019-02-04T16:42:41Z")

</div>

Hello everyone,

I tried to find a kibana visualization plugin to display my data in tree format or hierarchy format. But I am not able to get any. Is there any plugin for that ?  
Secondly, I have seen so many D3.js visualizations and I am thinking if we can directly integrate those in Kibana. Can you please help me in creating or using them.

Thanks,  
Gaurav Bahl

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [February 4, 2019, 10:30pm UTC](https://discuss.elastic.co/t/tree-visualizations-in-kibana/166995/2 "2019-02-04T22:30:49Z")

</div>

There is an experimental [Vega plugin in Kibana](https://www.elastic.co/guide/en/kibana/current/vega-graph.html) that may be able to do this.

You might look at the [Tree Diagram examples on the Vega homepage](https://vega.github.io/vega/examples/) for inspiration.

---

<div class="post-metadata">

**Author:** ![Gaurav\_Bahl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaurav_bahl/32/43944_2.png) [@Gaurav\_Bahl](https://discuss.elastic.co/u/Gaurav_Bahl)\
**Post date:** [February 7, 2019, 6:14pm UTC](https://discuss.elastic.co/t/tree-visualizations-in-kibana/166995/3 "2019-02-07T18:14:02Z")

</div>

Thanks Nick. I am trying to create Tree Visualization but getting certain errors. Can you help me with that, though I know Team Elastic is out of Vega 🙂

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [February 10, 2019, 5:27pm UTC](https://discuss.elastic.co/t/tree-visualizations-in-kibana/166995/4 "2019-02-10T17:27:34Z")

</div>

If the error is specific to Vega in Kibana, I might be able to help. But for general Vega errors it might be prudent to post in a Vega forum for a wider audience. Feel free to drop the error here and I can take a look.

---

<div class="post-metadata">

**Author:** ![Gaurav\_Bahl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaurav_bahl/32/43944_2.png) [@Gaurav\_Bahl](https://discuss.elastic.co/u/Gaurav_Bahl)\
**Post date:** [February 11, 2019, 8:35pm UTC](https://discuss.elastic.co/t/tree-visualizations-in-kibana/166995/5 "2019-02-11T20:35:16Z")

</div>

So I am trying to use Vega Tree Visualisations but I am getting "node is undefined" error. I used the same Json on online Vega editor but it was working fine, but when I tried to create that visualization under kibana 6.6 I am getting this error. I think that might be issue as Vega editor uses Vega 4 but Kibana 6.6 is using Vega 3.3.

Json Used:

{  
"$schema": "[https://vega.github.io/schema/vega/v3.json](https://vega.github.io/schema/vega/v3.json)",  
"width": 600,  
"height": 1600,  
"padding": 5,

"signals": [  
{  
"name": "labels", "value": true,  
"bind": {"input": "checkbox"}  
},  
{  
"name": "layout", "value": "tidy",  
"bind": {"input": "radio", "options": ["tidy", "cluster"]}  
},  
{  
"name": "links", "value": "diagonal",  
"bind": {  
"input": "select",  
"options": ["line", "curve", "diagonal", "orthogonal"]  
}  
}  
],

"data": [  
{  
"name": "tree",  
"url": "[https://raw.githubusercontent.com/vega/vega/master/docs/data/flare.json](https://raw.githubusercontent.com/vega/vega/master/docs/data/flare.json)",  
"transform": [  
{  
"type": "stratify",  
"key": "id",  
"parentKey": "parent"  
},  
{  
"type": "tree",  
"method":"tidy",  
"size": [{"signal": "height"}, {"signal": "width - 100"}],  
"as": ["y", "x", "depth", "children"]  
}  
]  
},  
{  
"name": "links",  
"source": "tree",  
"transform": [  
{ "type": "treelinks" },  
{  
"type": "linkpath",  
"orient": "horizontal",  
"shape": {"signal": "links"}  
}  
]  
}  
],

"scales": [  
{  
"name": "color",  
"type": "sequential",  
"range": {"scheme": "magma"},  
"domain": {"data": "tree", "field": "depth"},  
"zero": true  
}  
],

"marks": [  
{  
"type": "path",  
"from": {"data": "links"},  
"encode": {  
"update": {  
"path": {"field": "path"},  
"stroke": {"value": "#ccc"}  
}  
}  
},  
{  
"type": "symbol",  
"from": {"data": "tree"},  
"encode": {  
"enter": {  
"size": {"value": 100},  
"stroke": {"value": "#fff"}  
},  
"update": {  
"x": {"field": "x"},  
"y": {"field": "y"},  
"fill": {"scale": "color", "field": "depth"}  
}  
}  
},  
{  
"type": "text",  
"from": {"data": "tree"},  
"encode": {  
"enter": {  
"text": {"field": "name"},  
"fontSize": {"value": 9},  
"baseline": {"value": "middle"}  
},  
"update": {  
"x": {"field": "x"},  
"y": {"field": "y"},  
"dx": {"signal": "datum.children ? -7 : 7"},  
"align": {"signal": "datum.children ? 'right' : 'left'"},  
"opacity": {"signal": "labels ? 1 : 0"}  
}  
}  
}  
]  
}

 ![Visual](https://us1.discourse-cdn.com/elastic/original/3X/8/9/89a4bee99a318950c8bdc58cfba8256beefa26bb.png)

---

<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:** [March 11, 2019, 8:35pm UTC](https://discuss.elastic.co/t/tree-visualizations-in-kibana/166995/6 "2019-03-11T20:35:24Z")

</div>

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