Skip to content

Instantly share code, notes, and snippets.

@algomaster99
Created May 27, 2020 19:30
Show Gist options
  • Save algomaster99/6dbb9dc35e0fc81aecc9ad028b44336e to your computer and use it in GitHub Desktop.
Save algomaster99/6dbb9dc35e0fc81aecc9ad028b44336e to your computer and use it in GitHub Desktop.
Vega-Lite spec from Thu May 28 2020
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "Plot showing a 30 day rolling average with raw values in the background.",
"width": 400,
"height": 300,
"data": {"url": "data/seattle-weather.csv"},
"transform": [{
"frame": [-15, 15],
"window": [
{
"field": "temp_max",
"op": "mean",
"as": "rolling_mean"
}
]
}
],
"layer": [
{
"mark": {"type": "point", "opacity": 0.3},
"encoding": {
"x": {
"title": "Date",
"field": "date",
"type": "temporal"
},
"y": {
"title": "Max Temperature",
"field": "temp_max",
"type": "quantitative"
}
}
},
{
"mark": {
"color": "red",
"size": 3,
"type": "line"
},
"encoding": {
"x": {
"field": "date",
"type": "temporal"
},
"y": {
"field": "rolling_mean",
"type": "quantitative"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment