codimd
codimd copied to clipboard
Vega-Lite chart gives `TypeError: e is undefined`
trafficstars
The following Vega-Lite spec gives TypeError: e is undefined.
```vega
{
"config": {"view": {"continuousWidth": 300, "continuousHeight": 300}},
"data": {
"url": "https://cdn.jsdelivr.net/npm/[email protected]/data/cars.json"
},
"mark": "circle",
"encoding": {
"color": {"field": "Origin", "type": "nominal"},
"x": {
"axis": {"title": {"expr": "measure"}},
"field": "x",
"type": "quantitative"
},
"y": {"field": "Horsepower", "type": "quantitative"}
},
"params": [
{
"name": "measure",
"bind": {
"input": "select",
"options": ["Miles_per_Gallon", "Acceleration", "Displacement"],
"name": "X-axis column "
},
"value": "Miles_per_Gallon"
}
],
"transform": [
{"calculate": "datum[measure]", "as": "x"},
{"filter": {"param": "measure"}}
]
}
```