I’m launching Africa’s Imperial Commodities, a digital history project that explores export data from Africa to Europe in the nineteenth and twentieth centuries. The website includes essays that contextualize the available data and data visualizations that allow users to engage with the information in the underlying dataset. The three main essays on the website feature animal skin, peanut, and kola exports. There are also links to related digital projects and brief descriptions of the technology used on the website.

A screenshot from Africa’s Imperial Commodities

What went well for me was creating the data visualizations using D3.js, a JavaScript library that can build interactivity into visualizations on the web. I figured out how to write JavaScript to display scatterplots and bar graphs on the same webpage. Moreover, I built zoom functionality and tooltips into the visualizations for a better user engagement. This process was facilitated by creating a workflow that separated the HTML pages from the JavaScript and JSON files. In doing this, it was easier to replicate the visualizations with different data. Moreover, I could edit the files separately if new features needed to be added or new data needed to be appended.

The beginning of this process, however, was frustrating as D3.js requires learning a complex syntax and a vocabulary for svg elements. Even creating a non-interactive bar graph took what seemed like an unnecessary amount of time. As I learned the different parts bit by bit, I was able to build standard scatterplots and bar graphs with interactivity. The final product is not as flashy as Tableau or other data visualization software, but does come with other advantages. First, D3.js allows you to maintain control over the underlying data, so you don’t need to give it to a company. Second, D3.js can facilitate creative structures for visualizing data and allows for fine-tuning the minute details. Other data visualization software and D3.js offshoots, like Chartist.js, are more limiting in this respect. For most, accessing the benefits of D3.js in a digital history project, though, is probably not worth the time involved in learning the library.