Skip to content

Instantly share code, notes, and snippets.

@simonw
Created March 26, 2018 15:10
Show Gist options
  • Select an option

  • Save simonw/adee6214f56277f710868337d96ef53d to your computer and use it in GitHub Desktop.

Select an option

Save simonw/adee6214f56277f710868337d96ef53d to your computer and use it in GitHub Desktop.
Some combined Seattle weather graphs - from following https://vega.github.io/vega-lite/tutorials/explore.html
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": {
"url": "data/seattle-weather.csv",
"format": {
"type": "csv"
}
},
"vconcat": [
{
"mark": "line",
"width": 600,
"encoding": {
"x": {
"timeUnit": "monthyear",
"field": "date",
"type": "temporal"
},
"y": {
"aggregate": "mean",
"field": "precipitation",
"type": "quantitative"
}
}
},
{
"mark": "line",
"width": 600,
"encoding": {
"x": {
"timeUnit": "yearmonth",
"field": "date",
"type": "temporal"
},
"y": {
"aggregate": "max",
"field": "temp_max",
"type": "quantitative"
}
}
},
{
"mark": "bar",
"encoding": {
"x": {
"timeUnit": "yearmonth",
"field": "date",
"type": "ordinal"
},
"y": {
"aggregate": "count",
"field": "*",
"type": "quantitative"
},
"color": {
"field": "weather",
"type": "nominal"
}
}
},
{
"mark": "bar",
"encoding": {
"x": {
"bin": {
"maxbins": 20
},
"field": "precipitation",
"type": "quantitative"
},
"y": {
"aggregate": "count",
"field": "*",
"type": "quantitative"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment