Giter VIP home page Giter VIP logo

constituencymap's Introduction

ConstituencyMap

Binder

This project contains code to generate maps of the United Kingdom divided by constituency lines. One can supply constituency-level data, such as number of voters, to see the constituency break down of the data. The maps represent constituencies as equally-sized hexagons. This can be invaluable for visualising maps in a way not biased by landmass.

Static plots are generated using geopandas and matplotlib, and interactive maps are generated with altair.

Maps

The mapper classes are implemented in map/. Currently, only hex maps have been implemented. These maps are created using the fantastic tool by ODILeeds. There is a script in utils/hex_to_csv which converts the "hexjson" files created by ODILeeds into csv files.

This repo uses data from the Revoke Article 50 petition in the example files to demonstrate how to create choropleth maps.

How to use

Run the examples/, either by cloning the repo or using binder

in the root directory to see an example hexmap, using data taken from the Revoke Article 50 petition. This example file will show you how to use the HexMap class the create a choropleth map of the United Kingdom.

What are constituencies?

The United Kingdom of Great Britain and Northern Ireland operates elections under a first-past-the-post (fptp) system. The nation is split into hundreds of constituencies of roughly the same number of citizens.

In General Elections, the politician with the most votes in each constituency is elected as that constituency's representative to the House of Commons, as one of 650 Members of Parliament (MP).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.