Simple elections results chloropleth for the web, using javascript, OpenStreetMap, and LeafLet.
Clone me.
- Download Election Results in spreadsheet format as dataexport.xls from the Chicago Board of Election Commissioners (current as of offical results).
- Download precinct and (optionally) ward boundaries as GeoJSON from the City of Chicago Data Portal
- Run scripts to trim the Chicago geojson.
- precincts.mjs
- wards.mjs
- Use LibreOffice Calc or equivalent to export the results as a comma separated values (*.csv).
- Run script extendPrecincts.mjs to merge the CSV data into the precinct GeoJSON properties.
- Customize
- the color palette in docs/palette.mjs and the tests in test/TestPalette.mjs
- the precinct coloring and the legend in docs/app.mjs
Resources