Help

Lookup fields and Vega-Lite

Topic Labels: Extensions
1317 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Romain_Bochet
4 - Data Explorer
4 - Data Explorer

hello,

i’m trying to use the vega-Lite block but something eludes me: when I try to use as x: a lookup field, it just doesnt work.
Here’s my very basic code:
{
“$schema”: “https://vega.github.io/schema/vega-lite/v4.json”,
“title”: “XXX”,
“width”: “container”,
“height”: “container”,
“mark”: “bar”,
“encoding”: {
“x”: {
“field”: “CAFF.agence”,
“type”: “nominal”
},
“y”: {
“aggregate”: “count”,
“type”: “quantitative”
}
}
}

And here is the result : graph

obviously CAFF.agence is well defined… And it works if I try on a non-lookup field. When I try other types, the graph preview doesnt print, so I guess that’s not the issue ; anyway CAFF.agence should be a town name (like, “Paris”).

Is it a limitation of the vega-lite block? Or is it my understanding of the “type” ?

Thanks

1 Reply 1

Hi Romain, and welcome to the community.

It’s more likely your lack of experience with Vega-Lite and/or Airtable itself - here’s a good example where a very deep dive into the nuances of field relationships was critical in finding the right mix of Vega declarations.

I would bet there’s a way to build exactly what you need; it’s just a matter of understanding the Vega-Lite docs at a deeper level like encoding channels.