One overlooked bi-product of a general election is the fantastic dataset it creates. Raw numbers, percentages, historical comparisons, geographies, outliers…it’s got the works. Working at one of the counting centres in Cornwall I thought it’d be interesting to have a look at the county’s electorate.

I’ve also been looking for an excuse to play with the D3.js Force Directed graphs. These contain nodes (circles) and links (lines) which are given a gravity, charge and friction force to make for a nice little dynamic diagram. It requires learning Javascript but incredibly rewarding when you finally manage to produce something.

In 2010 Cornwall was split 50/50 with 3 of the 6 constituencies held by the Conservatives, the other 3 held by Lib Dems. This year (2015) the conservatives convincingly netted all 6 constituencies. I thought I’d look for further stories using the node-link diagram...

Click on the image below and once the page has loaded, click refresh to make Cornwall’s electorate dance, hold and drag to see how the forces pull and repel other parties. Click a circle to display the constituency, party and number of votes. They are't labelled so guess which huddle of blobs is 2010 and which is 2015. (The growth of the purples should give it away - scary for a county heavily subsidized by Europe!)