# Vega Kibana Tree Visualization ignore missing parent node

**URL:** https://discuss.elastic.co/t/vega-kibana-tree-visualization-ignore-missing-parent-node/256712
**Category:** Kibana
**Tags:** vega
**Created:** [November 25, 2020, 8:47pm UTC](https://discuss.elastic.co/t/vega-kibana-tree-visualization-ignore-missing-parent-node/256712 "2020-11-25T20:47:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ejmath12](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ejmath12/32/82068_2.png) [@ejmath12](https://discuss.elastic.co/u/ejmath12)
#### Post date: [November 25, 2020, 8:47pm UTC](https://discuss.elastic.co/t/vega-kibana-tree-visualization-ignore-missing-parent-node/256712/1 "2020-11-25T20:47:24Z")

</div>

Is there a way to gracefully handle missing parent node in kibana/vega tree visualization? For example, if the below json represents data, since X is non existent parent is it possible to ignore that link?

```auto
[
  {"id": "A", "parent": null},
  {"id": "B", "parent": "A"},
  {"id": "C", "parent": "X"}
]

```

---

<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: [November 25, 2020, 9:08pm UTC](https://discuss.elastic.co/t/vega-kibana-tree-visualization-ignore-missing-parent-node/256712/2 "2020-11-25T21:08:53Z")

</div>

This is more of a Vega question than a Kibana question, but we can try to answer. I think this is technically possible, but I don't see why you would want to: the format you've shown is what Vega expects for their [tree layout examples](https://vega.github.io/vega/examples/tree-layout/).

If you want to change it, you can [filter it out rows with missing parents](https://vega.github.io/vega/docs/transforms/filter/), or [impute a different value for the parent](https://vega.github.io/vega/docs/transforms/impute/), or maybe come up with some other Vega formula.

---

<div class="post-metadata">

### Author: ![ejmath12](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ejmath12/32/82068_2.png) [@ejmath12](https://discuss.elastic.co/u/ejmath12)
#### Post date: [November 25, 2020, 9:18pm UTC](https://discuss.elastic.co/t/vega-kibana-tree-visualization-ignore-missing-parent-node/256712/3 "2020-11-25T21:18:45Z")

</div>

Yes, the format here works, but I believe the transform to convert this to tree(stratify) throws error missing: X (as X is not in the ids). Let me go through your suggestions to see if they help.

---

<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: [November 25, 2020, 9:34pm UTC](https://discuss.elastic.co/t/vega-kibana-tree-visualization-ignore-missing-parent-node/256712/4 "2020-11-25T21:34:32Z")

</div>

Sounds like you might be configuring something incorrectly. The docs for stratify are here: [https://vega.github.io/vega/docs/transforms/stratify/](https://vega.github.io/vega/docs/transforms/stratify/)

---

<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: [December 23, 2020, 9:34pm UTC](https://discuss.elastic.co/t/vega-kibana-tree-visualization-ignore-missing-parent-node/256712/5 "2020-12-23T21:34:38Z")

</div>

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