Skip to content

Instantly share code, notes, and snippets.

@joninvski
Created November 2, 2020 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joninvski/72aa03d7dc3748df5437a37f93468556 to your computer and use it in GitHub Desktop.
Save joninvski/72aa03d7dc3748df5437a37f93468556 to your computer and use it in GitHub Desktop.
Vega-Lite spec from Mon Nov 02 2020
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"url": "https://covid.ourworldindata.org/data/owid-covid-data.csv",
"format": {"parse": {"date": "date"}}
},
"transform": [
{
"filter": {
"or": [
{"field": "iso_code", "equal": "PRT"},
{"field": "iso_code", "equal": "USA"},
{"field": "iso_code", "equal": "ESP"},
{"field": "iso_code", "equal": "NOR"},
{"field": "iso_code", "equal": "DNK"},
{"field": "iso_code", "equal": "NLD"},
{"field": "iso_code", "equal": "ITA"},
{"field": "iso_code", "equal": "DEU"},
{"field": "iso_code", "equal": "BRA"},
{"field": "iso_code", "equal": "SWE"}
]
}
}
],
"repeat": ["total_deaths_per_million","new_deaths_smoothed_per_million", "total_cases_per_million", "new_cases_smoothed_per_million", "positive_rate"],
"columns": 2,
"spec": {
"width": 600,
"height": 400,
"encoding": {
"x": {"field": "date", "type": "temporal"},
"y": {"field": {"repeat": "repeat"}, "type": "quantitative"},
"color": {"field": "iso_code", "type": "nominal"}
},
"mark": "line"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment