Add new comment

Infographic in D3: US Import and Export Tourism Data

I have always meant to play around with data visualization, and in the past a number of people mentioned the d3 javascript library. After working on PackerShack nonstop for the last few months, I really needed something else to tinker with for a little while. So, why not give d3 a try! And that's what I did.

The hardest part of data visualization is not necessarily the visualization itself, but where in the world do I get the raw data. Thankfully, most existing d3 visualizations out there cited their data sources, and after some googling and poking around, I finally found a good starting point. If you happen to be looking for interesting data, I would highly recommend starting with Worldbank's site or a government agency. I found the tourism-related data I ended up using here: http://tinet.ita.doc.gov/research/reports/recpay/index.html. They have data on inflowing and outflowing dollars to other countries to and from the US broken down by year. Not surprisingly, the data is not ready for computer consumption, but that's nothing a small python script can't handle.

Admittedly, a simple bar chart is probably the easiest way to go and most likely the most informative to whoever is looking at the data. However, I really wanted to have a world map in my visualization and arrows flying around between different countries. Vanity! I came across http://www.naturalearthdata.com/downloads. This is the go-to place for SVG maps.

Click on the image below to play around with our US Tourism Map. If you have any technical questions about how a certain thing was done, don't hesitate to drop me a line in the comments.