Published

May 11, 2025

Building a regional election results dashboard in Python with Plotly Dash

What were the regional results of the UK general election? This application visualises the result of the United Kingdom’s 2024 General Election result in terms of the geographic regions of the UK, e.g. Wales, East Midlands, Scotland. The electorate of the United Kingdom (i.e. people with the right to vote) cast ballots to elect a single candidate to become a Member of Parliament (MP) for each constitency (geographic areas of roughly equal population size). There are 650 constituencies in the United Kingdom, each constituency sends one winning candidate to take their seat in the legislative branch of the government, the UK Parliament.

Features

  • Average MP majority - the average difference in number of votes cast for the first place candidate and the second place candidate
  • Seats that Changed Party - the total number of constituency seats that were previously held by an MP from a different political party
  • Total Votes Case - the number of valid ballots that were counted in a selected region
  • Electorate Turnout - the proportion of registered voters who cast a ballot in the election
  • Donut visualisation - showing the percentage of constituency seat won by each political party
  • Treemap visualisation - showing the proportion of seats that were held or gained by each political party

Screenshot

Regional Election Results Dashboard

GitHub Repo

https://github.com/jwr42/dash-election-app