codimd icon indicating copy to clipboard operation
codimd copied to clipboard

Vega-Lite chart gives `TypeError: e is undefined`

Open joelostblom opened this issue 3 years ago • 0 comments
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"}}
  ]
}
```

Open the Chart in the Vega Editor

joelostblom avatar Mar 30 '22 15:03 joelostblom