# Vega Lite Table Output Option

**URL:** https://discuss.elastic.co/t/vega-lite-table-output-option/124428
**Category:** Kibana
**Created:** [March 18, 2018, 5:41am UTC](https://discuss.elastic.co/t/vega-lite-table-output-option/124428 "2018-03-18T05:41:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Johnnycc1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnnycc1/32/26069_2.png) [@Johnnycc1](https://discuss.elastic.co/u/Johnnycc1)
#### Post date: [March 18, 2018, 5:41am UTC](https://discuss.elastic.co/t/vega-lite-table-output-option/124428/1 "2018-03-18T05:41:40Z")

</div>

Is there a table output option for vega lite (there is like 10 "mark" options but none of them are data table / grid or something similar.

Seems so simple - any help would be appreciated.

---

<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: [March 19, 2018, 5:30pm UTC](https://discuss.elastic.co/t/vega-lite-table-output-option/124428/2 "2018-03-19T17:30:08Z")

</div>

Hi,

Vega is not meant to use pure text output like a table. So you won't find any table _mark_. Though you could of course hack that together if you want to, by placing text output at specific positions, but that won't be fun.

Might I ask, why you are looking into Vega for visualizing a table, instead of using the table visualization?

Cheers,  
Tim

---

<div class="post-metadata">

### Author: ![nyuriks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nyuriks/32/26171_2.png) [@nyuriks](https://discuss.elastic.co/u/nyuriks)
#### Post date: [March 19, 2018, 5:33pm UTC](https://discuss.elastic.co/t/vega-lite-table-output-option/124428/3 "2018-03-19T17:33:40Z")

</div>

There is an example of how to create a table with Vega Lite - [https://vega.github.io/vega-lite/examples/layer\_text\_heatmap.html](https://vega.github.io/vega-lite/examples/layer_text_heatmap.html) -- this is somewhat close to a table, but it is not the same as a true spreadsheet, because it won't resize cells if the content gets too big.

---

<div class="post-metadata">

### Author: ![Johnnycc1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnnycc1/32/26069_2.png) [@Johnnycc1](https://discuss.elastic.co/u/Johnnycc1)
#### Post date: [March 19, 2018, 8:47pm UTC](https://discuss.elastic.co/t/vega-lite-table-output-option/124428/4 "2018-03-19T20:47:50Z")

</div>

Hey Tim,

I have nested documents in elastic (if you are interest you can see how I am modelling the data in elastic you can look here --\> [https://github.com/swarmee/partySearch](https://github.com/swarmee/partySearch)). Anyways using vega, for the first time, I can query nested documents in Kibana and produce visualisations on a dashboard (this is a massive step forward - great work guys). Previously we had to run our nested aggregations then push the results into elastic for visualisations in Kibana. Below is a sanitised example of a simple vega-lite visualisation I am using.

```
{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "title": "Identification Type Used",
  "data": {
    "url": {
      "%context%": true,
      "%timefield%": "saleDate",
      "index": "real-estate-sales",
      "body": {
        "aggs": {
          "a": {
            "nested": {"path": "role.party.identification"},
            "aggs": {
              "b": {
                "terms": {
                  "field": "role.party.identification.type.keyword",
                  "size": 10
                }
              }
            }
          }
        },
        "size": 0
      }
    },
    "format": {"type": "json", "property": "aggregations.a.b.buckets"}
  },
  "mark": "bar",
  "encoding": {
    "x": {"field": "key", "type": "ordinal"},
    "y": {"field": "doc_count", "type": "quantitative"}
  }
}

```

I'm guessing the plan is to add nested aggregations to the standard visualisations eventually, however if there was a way to push the results of a vega-lite query into a table before then - that would be cool.

---

<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 16, 2018, 8:47pm UTC](https://discuss.elastic.co/t/vega-lite-table-output-option/124428/5 "2018-04-16T20:47:58Z")

</div>

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