2017

US Map Data Visualization

A small class project, written in Python 3 using the web.py framework, as well as the popular PIL (python image library), which generates color-shaded maps of the USA based on csv-fed data. The user can choose low and high-value colors, which are then used to generate a gradient along which each state's color is calculated. Then the map is rendered on-the-fly and returned to them as a .jpg image.

Take a look and try it out here (note that the generation does take some time.. Python is an interpreted language and my server is the lowest tier).

This project was very fun to work on as it required a lot of thinking to get the gradient looking correct. Then the flood fill was tricky to implement--I had to save 'seed' coordinates for each state to fill the state with the calculated color.

Below is a screenshot of the menu page, which looking back, I think took some inspiration from classic game menus:

Screenshot of the map generating tool

The below map was made using the "State gsp growth" csv and shows the issue with colors that are not far enough apart (or with data whose range is small):

Map of percent growth in GSP

The below is the number of Starbucks stores per state, and you can see the huge outlier of California: it is the only state shaded completely green (Texas, for instance, is brown--only halfway up the gradient scale).

Starbucks stores per state, with California the only green state