Here in the US, we typically use top level domains such as .com, .gov, and .org. I guess we were one of the first countries to start using web domains in a big way, and therefore we kind of got squatter's rights. As other countries started using the web, they wanted their own space, so there are now "top-level domains" for each country -- France is .fr, Russia is .ru, Germany is .de, and so on. Some are easy to guess, and some (such as .de) might be a surprise - at least to English speakers. In this blog post, I use some of the data we ship with SAS, to create a world map labeled by the country code top-level domain (ccTLD).
But first, credit where credit is due ... I saw the original version of this infographic, which was conceived and designed by John Yunker, posted on reddit. It's sort of a combination of a word cloud, and a map. I found it very interesting, but quite cumbersome to try to read the legend at the bottom of the screen, to figure out what country names went with the ccTLD abbreviations - both because the legend had so much text in it, and also because the text was very small and you have to blow it up to full size to read it.
I bet you think, just because I'm "The Graph Guy," that I'm going to try to create my own version of this infographic, eh? ... If so, then you know me pretty well, hahaha! But first, since we'll be working with the world map, here's a random picture of one of my friends (John) holding up the Earth. :)
And now, on to the nitty-gritty details... In my version of the infographic, I wanted to add mouse-over text to each country, so users can quickly/easily see the country names. And I also wanted to show a light outline of each country's border, to help put the text labels into a more direct geospatial context. Here's a list of what I used to create my map:
- I used the mapsgfk.world dataset (which is shipped with SAS/Graph) as my map.
- I used the corresponding mapsgfk.world_attr attribute dataset to get the 2-character ISO country code abbreviation for each country.
- I then used Proc SQL to merge in the population for each country, from the sashelp.demographics dataset (this was a little tricky, because the key variable I was joining the two tables by was character in one dataset, and numeric in the other).
- I created a string containing the HTML tags for the mouse-over text and Google search drilldowns for each country in the dataset.
- I used the %centroid() macro to calculate the approximate lat/long center coordinate of each country.
- I then created an annotate dataset to place the 2-character ISO country code on each country, with the size of the text based on the population.
- I then used Proc GMap to draw the map, and display the annotated labels on it.
My map came out pretty nice, imho. Below is a small snapshot image of a portion of it - click on it to see the full size interactive version, where you can mouse-over each country to see the country name, and click each country to launch a Google search for for more information about that country's ccTLD.
And now, here's a little mission/challenge to give you an excuse to try out my map. Can you find the country of Tuvalu? Where is it, what is its ccTLD, and why is it significant? (leave your answer in a comment!)