Category: Data Journalism

Discovering CartoDB

I’m in Marrakesh, Morocco this week. While here, I’m taking a break from D3. I’ve been trying out the mapping tool CartoDB. It’s sophisticated and full of interesting features that do much of the heavy lifting on the user’s behalf.

Here’s a quick and easy map I made just now. It uses a CartoDB dataset that shows the most and least populated places across the globe. I chose the intensity visualisation to display this data. That seemed to be the most intuitive way to show population density. It’s quite easy to change the colours, background layers and other features for this map.

I’m pretty excited about exploring CartoDB in more detail. For my next project, I’m going to use it to map global passport power. Watch this space!

Super-simple D3 bar chart

No, it’s not quite a visually stunning world map or amazing graphic artistry, sadly.

BUT nevertheless – ┬áhere’s a little data visualisation that I wrote today with D3:


d3 bar chart data



It doesn’t look like much but took a ton of code to produce (well probably not, but it certainly felt like it). I had fun playing with the pretty colours, finally settling on a blue/purple scheme. The bar colours turn more blue the larger the number and more purple the smaller the number.

The dataset is just a simple array of numbers that I threw in. There’s a touch of CSS added in the document head to make the bits play nicely together. Other than that, this was an exercise in learning how to use SVGs, how to bind data onto elements in the DOM, and how to style the results in a very basic way. This is fascinating stuff. I love the way it can give me the potential to mingle coding with journalism and tell stronger, deeper stories.

I can see those gorgeous interactive maps awaiting me in the not-so-distant future… ­čśÇ

Adventures in data

data lightbulb eureka

Data journalism fascinates me. It seems to be the natural path to take if I want to intersect my existing background in freelance journalism with my newly developing skills in tech. As I progress further in my programming studies, most recently delving into the basics of Ruby, I’ve become increasingly convinced that data-storytelling could be my next career move.

Hacking together small projects is the best way to begin, so here’s my very first attempt at finding story ideas in data. I used a simple two-column dataset taken from the Socrata Opendata website. The set showed recent World Health Organisation (WHO) data, showing pure alcohol consumption around the world per capita. There were two columns, one for the country name and another for the per-capita amount in litres.

I grabbed the dataset from Socrata in .csv format. It was already fully cleaned and ready to be used. I was aware this was an easy ride. I know tables and rows this perfect aren’t usually found in normal journalistic data gathering. I uploaded the whole dataset into a tool called Silk, which arranged it nicely into ‘data cards’.

Using Silk, I was able to view the data set in a variety of ways, including bar charts, maps, pies and tables. I found that mapping the data was an obvious choice in this case, for such a geographically-focused dataset. But the below table was what really helped me find some interesting potential story ideas that could be pursued further.


As you can see above, the countries have been sorted into groups according the amounts of alcohol consumption per capita. Considering the extremes is always a useful practice when searching for newsworthy angles. In global national stereotypes of drinking, which countries would be the most obvious contenders to come top in this dataset?

Russia, Germany, the UK, and Ireland immediately came to mind. But surprisingly, it was little Luxembourg that topped the charts for global alcohol consumption, with a whopping 15.56 litres of the pure stuff per capita. I have no idea why the people of Luxembourg drink so much, but this could be the first surprising angle to pursue from the data.


The next obvious place to look was the countries where people drink the least alcohol. There are four places where the pure alcohol consumption is 0.0. Unsurprisingly, they are all Muslim majority nations. Saudi Arabia and Iran, along with Bangladesh and Somalia, all have a score of 0.0. The group of 0.0 – 0.03 litres is populated solely by Muslim countries, but there’s a surprising exception.

Qatar is missing from this group. This intrigued me. Having lived in Qatar for a couple of years, I knew that alcohol is strictly controlled there. It can be purchased in two kinds of places: the bars of five-star hotels (accessible only with a foreign passport), or the government-controlled liquor store.

The latter is heavily regulated. Expats require permission from their employers to apply for an ID and use the store, which sits far out in the desert. Plus, to be eligible for the ID, expats must be paid a salary of over 4,000 Qatari riyals per month (around 1,000 USD). This means that purchasing alcohol is impossible for many low-income foreign workers.

So how much pure alcohol per capita do they drink in Qatar? 4.40 litres per capita! That puts the strict Islamic emirate ahead of around 85 other countries, including places such as Georgia, Albania, and Jamaica, where people might be reasonably expected to consume greater amounts of booze (taking cultural, religious and historical assumptions into account). At least compared to Qatar, which outstrips every other Muslim-majority country.

Another part of the data that stood out to me was the significant different between levels in Qatar compared to the United Arab Emirates and Oman. I’ve visited both of the latter. In each I found that access to alcohol was far less restricted than in Qatar.

If I were going to pursue a story from this dataset, that’s where I’d begin searching. For the next steps, I’d look for additional data to support this early idea, to see if it’s an actual trend in Qatar or just a misleading statistic (after all, there’s “lies, damn lies and statistics.”).

The above would involve finding more sources while also talking to people on the ground in Qatar to see if they could help me trace the factors driving this aspect of the WHO data.


Mapping the island

I’m trying to figure out the best way to tackle a data story about Jamaica. I’m a newcomer to the world of data journalism, so I want to choose a plan of attack that’s not overwhelming but still gives me a good chance to learn and showcase new skills.

Here’s my first idea, which I’m currently in the process of fleshing out. I thought of creating a story entitled something simple e.g., ‘This is Jamaica’. It would have a map of the island at the top, which would include pinpoints using address data scraped from a page of Google search results. I could do this using for the scraping process.

Then I’d put the scraped data into a Google spreadsheet and finally use Google Fusion Tables to get it into the form of a map. There would probably be some data cleaning involved, which could be done once the data was safely in the spreadsheet. I’ll choose some data that isn’t too extensive, e.g. mapping all the coffee shops and bakeries in Jamaica that have wifi, for example’s sake.

After the map was ready, I’d like to make some graphs that display the country’s ‘vital signs’. These could include data such as GDP, employment rates, FDI, tourist inflows, amount of new businesses registered foreign aid, national debt, etc. A lot of this data could be taken from the World Bank’s website. It would give a overall picture of Jamaica’s present situation on the global stage.

I’m also interested in figuring out a way to visualise some aspects of data from the Good Country Index, but perhaps that’s better saved for another project altogether.


Delving into data

My journey into tech has been full of fits and starts. I’ve tried learning code with Codecademy and Treehouse, enrolled on a WordPress course using Skillcrush, and attempted to get better with the command line. But I keep getting distracted, and so far it’s been limited progress (even though my HTML and CSS skills have improved). I think my learning style requires a real-world approach to tech, i.e. learning bit by bit as I progress along with an actual project. Fortunately this is a common way to do things in the tech world.

A few months ago I became interested in the idea of combining story-telling and tech. There’s lots of buzz about this at the moment. Data journalism is popular, especially on sites like the Guardian data blog and the Atlantic. But how to get into this new field? I needed to find an interesting and timely question that could be answered and illustrated by data. The data also had to be readily accessible in its raw form (although I just stumbled across a great tool called, which scrapes data from anywhere on the web. This seems almost too good to be true. My next post will be about my attempts to use it).

I also want to keep my data story-telling focused around my core topic of places. That should be easy enough, as cites and countries produce boundless amounts of data on all aspects of life. The key is finding the focus and narrowing it down. I may start with one of the countries on my recent travel list, perhaps Jamaica, Indonesia, the USA or Turkey. But now it’s time to tinker with some more tools, explore some data sets and try to come up with a few projects. Hopefully I’ll have something to show for this soon.