{"id":16533590,"url":"https://github.com/af/votesplit2011","last_synced_at":"2026-06-05T06:31:03.753Z","repository":{"id":34310770,"uuid":"38227853","full_name":"af/votesplit2011","owner":"af","description":"How did \"vote-splitting\" affect the 2011 Canadian election?","archived":false,"fork":false,"pushed_at":"2015-09-24T16:21:12.000Z","size":1172,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T07:03:56.187Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://aaronfranks.com/votesplit2011","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/af.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-29T04:33:01.000Z","updated_at":"2015-09-24T19:35:49.000Z","dependencies_parsed_at":"2022-09-03T01:06:53.090Z","dependency_job_id":null,"html_url":"https://github.com/af/votesplit2011","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/af/votesplit2011","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/af%2Fvotesplit2011","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/af%2Fvotesplit2011/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/af%2Fvotesplit2011/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/af%2Fvotesplit2011/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/af","download_url":"https://codeload.github.com/af/votesplit2011/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/af%2Fvotesplit2011/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33932048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T18:15:21.745Z","updated_at":"2026-06-05T06:31:03.737Z","avatar_url":"https://github.com/af.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 2011 Canadian Election Vote Splitting\n\nHow did so-called \"vote splitting\" affect the 2011 Canadian federal election?\nThis visualization aims to help you answer that question by interactively playing\nwith different hypothetical changes in voter behaviour.\n\n[Check out the online version](http://af.github.io/votesplit2011)\n\n\n## Generating Election results CSV\n\n* Download [this zip\nfile](http://www.elections.ca/scripts/OVR2011/34/data_donnees/pollresults_resultatsbureau_canada.zip)\nwith full riding-by-riding results from Elections Canada (it's linked [from\nhere](http://www.elections.ca/scripts/resval/ovr_41ge.asp?prov=\u0026lang=e)).\n\n* Join all of the poll results csv files into one mega-csv with `cat pollresults_* \u003e joined.csv`\n* Convert this csv's encoding from `iso-8859-1` to `utf8` with\n  `iconv -f iso-8859-1 -t utf-8 joined.csv \u003e joined-utf8.csv`\n\n* We need to cut out a lot of fat from this csv, and sum up each riding's totals.\n  Run `data_munging/csv_consolidator.js joined.csv \u003e trimmed_results.csv` (you may need\n  to bring `joined.csv` into the same directory, of course).\n\n\n## Generating Map TopoJSON\n\nFirst, download and unzip the shapefile from\nhttps://www12.statcan.gc.ca/census-recensement/2011/geo/bound-limit/bound-limit-2011-eng.cfm\n\nYou'll want to choose \"Federal Electoral Districts\" and \"Cartographic Boundary File\"\n\nThen run the following (you will need to `npm install topojson` first):\n\n```\ntopojson -p +districtId,districtName,+totalVotes,+CPC,+LPC,+NDP,+GPC,+BQ \\\n    --simplify-proportion 0.4 -q 3000 \\\n    -e trimmed_results.csv --id-property=+FEDUID,+districtId \\\n    -o districts.topojson \\\n    gfed000b11a_e.shp\n```\n\nThe [topojson CLI reference](https://github.com/mbostock/topojson/wiki/Command-Line-Reference)\nhas more tips that can likely reduce the filesize further.\n\n\n## Running locally\n\n```\nnpm install\nnpm start\n```\n\nAnd then visit `localhost:8080` in your browser.\n\nAlternately, `npm build` will create the js/css files for you if you want to deploy\nto a static hosting site (like Github pages).\n\n\n## Misc links and alternate data sources\n\n* Alternate Election boundary topojson:\nhttps://github.com/opennorth/represent-canada-data/blob/master/topojson/fed_ed_federal_electoral_districts.topojson\n\n* Alternate (slightly less useful) data source:\nhttp://geogratis.gc.ca/api/en/nrcan-rncan/ess-sst/6d1d8f90-1c25-5fd0-880d-138d27c8cb57.html\n\n* https://en.wikipedia.org/wiki/Results_by_riding_of_the_Canadian_federal_election,_2011\n* http://www.elections.ca/res/cir/maps/images/ERMap_41.pdf\n* http://www.cbc.ca/news2/politics/canadavotes2011/ (wikipedia results are more accurate)\n* https://www.sfu.ca/~aheard/elections/results.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faf%2Fvotesplit2011","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faf%2Fvotesplit2011","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faf%2Fvotesplit2011/lists"}