A quick web tool that suggests World Cup games to watch in your community based on foreign-born populations. This combines US Census data, with a match schedule to suggest the best games to watch based on the population of people near where you live.
This is created in two parts: a HTML/JSS/CSS scrollytelling site using scrollama.js, and a Svelte-based "recommender" that manages the interactive component logic and state.
cd svelte-recommendernpm install
cd svelte-recommendernpm run dev
Updating this to the latest World Cup is a series of automated and manual steps:
- Open up the notebook at
census-data/data-generation.ipynband follow those instructions - Copy-and-paste the data in
census-data/country-recs-jsontosvelte-recommender/src/data/recommendations.json - Open up the
census-data/map-generation.ipynband run it to generate the new maps; copy them tosvelte-recommender/public/images/map-raw-pop/ - Go through each country alpha-3 to generate and save the map to
svelte-recommender/public/images/map-raw-pop/ - Update
svelte-recommender/src/data/teams.jswith all the team names and metadata you find - Test out the svelte app in
svelte-recommender(check out the README.md in that dir for more info) - Copy the generated JS and CSS files from
svelte-recommender/dist/to the appropriate directories here - Rewrite the narrative in the
index.htmland images configured inscripts/scrolling.js - Redesign the app's graphic design to match the current tournament a bit
- Run
npm run buildto build the static files (tosvelte-recommender/dist). Copy the .js toscripts/and the .css to/styles/
Once the svelte interactive is built into static JS and CSS, this is ready to deploy to a flat HTML server. I deployed it via GitHub Pages for the free hosting.