stolsky / election-results-map

A simple application that visualizes election results and their background information in various ways.
GNU General Public License v3.0
0 stars 0 forks source link
d3js geojson

Election Results Map

A simple application that visualizes election results and their background information in various ways.


Table of Contents

Usage
Used data
Libraries and tools
Unit tests
Class Diagram


Usage


When you move the mouse over a region, the corresponding data is displayed in a window. You can specify which data should be displayed in this window by selecting the appropriate category. Currently there are two categories positioned on the top right of the screen: the voter turnout as "Turnout" and the distance of the election results to each other as "Distance of results".

Turnout

The voter turnout is visualized with a colored scale representing a turnout between 50 and 90 percent. The colors from red to green are assigned to this interval accordingly.

Distance of results (Euclidean distance)

The election result of a region is interpreted as a point (or n-tuple with the length of 5 to 6 in our case). This way we can calculate the difference between two results with the Euclidean distance. Now we can color the difference between the result of one region and the results of all other regions. The colors from yellow to red are used to visualize these differences.

View the demo


Resources


For this application, the results of the federal elections in Germany are used. The goal is to test our application with data from 2002, 2005, 2009, 2013, 2017 and 2021.

Open-Data

Election results

Geo Data

Population structure data

Data on population structure will be included in the future.


Libraries and tools


To present the data at hand, we use D3.js to display the bar charts and plot the GeoJSON data.

To import the CSV files we use Papa Parse.


Unit tests


We use the assertion library Chai (with the BDD style "expect") with the test framework Mocha. All the tests are stored in the directory "test".


Class Diagram


current diagram