This repo contains two elements:
- A node app that processes SF election data, matching ballots with precinct shapes
- A simple viewer web app, built in Vue, which displays the aforementioned data.
Note that this web app only calculates first-choice votes, not ranked votes.
Also, thanks to dbaron/sf-elections-rcv which I referenced in making this.
-
Run
npm install
in theprocessor
directory to install dependencies. -
Get an election JSON zip file ready. You can get them at the SF Elections website.
-
You may want to make sure your precinct shape geojson is up-to-date. It's included here as
precincts.geojson
in theprocessor
directory. I got this from DataSF – just click "Export", then select "GeoJSON." -
Run
node index.js ./dir/to/election_data.zip
and wait -
Place
output.json
in thedata
sub-directory in theviewer
directory as11-05-19.json`` – you may change this filename in
main.js```. -
To run the viewer locally, you'll just need a simple server running. For example, on macOS, head to the
viewer
directory in Terminal and runpython -m SimpleHTTPServer 8080
and you'll be able to view the web app at http://0.0.0.0:8080 in your browser.
Let me know if you have any questions!