{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "data": {
    "url": "data/cars.json",
    "format": {
      "type": "json"
    }
  },
  "selection": {
    "pointer": {
      "type": "single",
      "on": "click",
      "fields": [
        "_vgsid_",
        "Cylinders"
      ],
      "resolve": "global"
    }
  },
  "mark": "rect",
  "encoding": {
    "y": {
      "field": "Origin",
      "type": "ordinal"
    },
    "x": {
      "field": "Cylinders",
      "type": "ordinal"
    },
    "color": {
      "condition": {
        "selection": "pointer",
        "aggregate": "count",
        "field": "*",
        "type": "quantitative"
      },
      "value": "grey"
    }
  }
}
