Tells you how many votes you have based on your (or another) UK constituency. Try it out here.
Uses turnout and electorate figures from the 2017 General Election (data).
Before running for the first time, the SQLite3 database should be created and populated. The easiest way to do this is using SQLite3 batch mode:
$ sqlite3 -batch constituencies.db < constituencies.sql
If you decide to name the database something other than constituencies.db
or locate it somewhere other than the project's root directory, make sure to update its path in lib/database.js
.
Next, install all of the node dependencies:
$ npm install
Finally, run the server:
$ node index.js
- I took the detailed results by constituency dataset from the House of Commons Library's full results and analysis of the 2017 UK General Election.
- I took the average turnout accross all 650 constituencies, and worked out, from that, the average percentage of the vote that a voter in the average constituency had.
- I compared this figure to the actual percentage of the vote that a voter in each constituency had to see how far away the values were from each other.
Copyright (c) Alexander Nielsen, 2018. Licenced under MIT licence.