Skip to content

Instantly share code, notes, and snippets.

@XaviTorello
Last active January 3, 2019 13:38
Show Gist options
  • Save XaviTorello/1417e2e16cdd8beb438fb5b578e59807 to your computer and use it in GitHub Desktop.
Save XaviTorello/1417e2e16cdd8beb438fb5b578e59807 to your computer and use it in GitHub Desktop.
CCH via Vega-Lite
{
"$schema": "https://vega.github.io/schema/vega-lite/v3.json",
"width": 360,
"data": {
"url": "https://code.gisce.net/empowering.js/cch.json",
"name": "source",
"format": {"type": "json"}
},
"selection": {
"a": {
"type": "single",
"on": "click",
"fields": ["_vgsid_"],
"resolve": "global",
"empty": "all"
},
"tooltip": {
"type": "single",
"nearest": true,
"on": "mouseover",
"encodings": [
"x"
],
"empty": "none"
},
"grid": {
"type": "interval",
"bind": "scales",
"encodings": ["x"]
}
},
"mark": {
"type":"line",
"point": true
},
"encoding": {
"x": {"field": "date", "type": "temporal"},
"y": {"field": "value", "type": "quantitative"},
"color": {
"condition": {"selection": "a", "value": "steelblue"},
"value": "grey"
}
},
"config": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment