Project Demo

This is a visualization of car crash data from the USA between the years 1994 and 2013, built with Processing. A video demo can be seen below, and the code can be found here.

About

Inspiration

The initial reason I wanted to look at car crash data was to draw attention to the number of people that die every year in car accidents and highlight how much of an improvement self-driving cars would be if they were implemented into our society. After looking a bit more deeply at the dataset, I was surprised at some of the trends and decided to break the data out by state instead of comparing it against that of autonomous vehicles (which would introduce massive inaccuracies in scaling due to the low number of autonomous vehicles on the road). It becomes clear that driving has become progressively much safer between 1994 and 2013 (and presumably onward—the data only went up to 2013).

Technical Summary

To visualize the data, the first step was creating a different .csv file for each state and loading them all into Processing. In order to display the data, I created 50 different images – one for each state – and calculated a number for each data point between 0 and 255 based on where that particular data point fell between the minimum and maximum values in that category (year/type). Once these values were calculated, I subtracted that value (between 0 and 255) from 255 for the green and blue values and tinted the image of each state accordingly. The way that the code is written makes it trivial to change the dataset to something else and map it across the different states by year.

For the interface, I decided it was most impactful if it was interactive, so I used a group of radio buttons to allow the user to change the active category of data being displayed, and made it so that the left and right arrow keys scroll through the yearly data. I used a library for the radio buttons so that I wouldn't have to reinvent the wheel. The colour red was selected because it is an inherently negative colour, and I wanted it to be immediately apparent which states had higher values when compared to the others.

Overall, I’m satisfied with the results of my visualization—it opened my eyes to certain trends that I would not have noticed without a visual aid.