https://github.com/ttitcombe/constituencymap-d3
A map of UK parliamentary constituencies created in D3
https://github.com/ttitcombe/constituencymap-d3
choropleth choropleth-map d3 d3-js d3js election election-data map political-science politics uk united-kingdom
Last synced: about 2 months ago
JSON representation
A map of UK parliamentary constituencies created in D3
- Host: GitHub
- URL: https://github.com/ttitcombe/constituencymap-d3
- Owner: TTitcombe
- License: mit
- Created: 2020-03-26T19:46:36.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-28T12:32:35.000Z (about 6 years ago)
- Last Synced: 2024-12-27T12:11:36.844Z (over 1 year ago)
- Topics: choropleth, choropleth-map, d3, d3-js, d3js, election, election-data, map, political-science, politics, uk, united-kingdom
- Language: JavaScript
- Size: 428 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ConstituencyMap
A map of UK parliamentary constituencies created in D3

## How to run
1. Clone this repository
2. Navigate to the [`map`](./map) directory in the repository and run a server. This can be done by:
- Using a plugin on a JavaScript IDE
- Run `python -m http.server` in the terminal
3. Navigate in a browser to the localhost which contains the application
## TODO
- [x] Offset constituency circles on alternate rows
- [x] Fit map to SVG size
- [ ] Do this dynamically (without hard-coded numbers)
- [x] Combine map data with 2019 parliamentary results (pre-JS/d3)
- [ ] Do this step in D3
- [ ] Fill in missing constituencies in hexmap
- [x] Colour circles by party
- [ ] Add legend
- [ ] Use hexagons instead of circles
- [ ] Make constituencies interactive
## Data
- `uk_hex.csv`
- Coordinates of UK parliamentary constituencies (2017 boundaries) in hexmap format
- Created by [ODILeeds](https://odileeds.org/projects/hexmaps/constituencies/),
released under MIT license
- `HoC-ge2019.csv`
- Results of the 2019 UK General Election
- Provided by [HoC library](https://commonslibrary.parliament.uk/research-briefings/cbp-8749/)
- `combined_ge2019.csv`
- Merged `uk_hex.csv` and `HoC-ge2019.csv`
- Removed some unused fields, such as individual part votes, from combined dataset
- **Note**: Not all constituencies are present in both files.
I believe this is because the ODI map uses the old (2017) boundaries.
The hexmap will need to be updated.