Help

Vega-lite fold - not working

Topic Labels: Extensions
Solved
Jump to Solution
1420 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Btbml
7 - App Architect
7 - App Architect

I just found the vega-lite block today and am trying to get a stacked bar graph using 2 fields. I stumbled onto the fold example (Fold | Vega-Lite) and was able to convert it to stacked instead of columns… and it looks like exactly what I want inside the vega-lite editor. But inside airtable, it seems that it doesn’t like the return “key” and “value” from the fold command. Gives the error:

value is not a valid transform name, inline data name, or field name from the Table1 table:

Anyone know if I’m doing something wrong, if this is missing functionality in airtable, or a bug?

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "title": "Table1",
  "width": "container",
  "height": "container",
  
  "transform": [{"fold": ["Field1","Field2"]}],
  "mark": "bar",
  "encoding": {
    "x": {
      "field": "NAME",
      "type": "nominal"
    },
    "y": {
      "type": "quantitative",
      "field": "value"
    },
    "color": {
      "field": "key", 
      "type": "nominal", 
      "scale": {"range": ["#c49712", "#999"]
      }
    }
  }
}

Edit- Add link to fold example

1 Solution

Accepted Solutions
Btbml
7 - App Architect
7 - App Architect

Support got back. Correct line should be

“transform”: [{“fold”: [“Field1”,“Field2”], “as”:[“key”, “value”]}]

See Solution in Thread

1 Reply 1
Btbml
7 - App Architect
7 - App Architect

Support got back. Correct line should be

“transform”: [{“fold”: [“Field1”,“Field2”], “as”:[“key”, “value”]}]