Vega-Lite starter notes
Vega-Lite starter notes
Each file in this directory is a stub: $schema and data are filled in,
mark and encoding are not. Open ../index-vl.html from a server rooted at the repo
root (see hw1.md for the python -m http.server command) and you’ll see
nothing render until you fill them in — that’s expected.
These three views are static and independent. Unlike the D3 build, they do
not link to each other. Build each against what you wrote in ../index.html, not
against what was easiest to make Vega-Lite do.
A few facts about the data you’ll need, not design decisions to make:
data/world.jsonis TopoJSON. The country outlines are atobjects.countries; each feature’sidis an ISO alpha-3 code (e.g."USA"), matching theiso_codecolumn inowid-covid.csv. To color countries by a COVID value, join the two with alookuptransform.data/owid-covid.csvhas per-country rows and per-continent rollup rows, distinguished byiso_code— continent rows use codes likeOWID_AFR,OWID_ASI,OWID_EUR, etc. (iso_codestarting withOWID_). Filter to the rows the chart in question actually needs.total_cases_per_millionhas real missing values (blank cells) — decide, per your../index.html, how each chart should represent that rather than letting Vega-Lite drop them silently.