Everybody except for me gets excited by maps. My eldest daughter (six) demonstrates a geographical knowledge which dwarves my own but that’s OK – it just doesn’t bother me. Professionally, my datasets include millions of rows of postcode data, but we just don’t leverage it, as it’s not really a critical factor for us.
In spite of this blissful ignorance, the creation of a Hex Map has long been on my Tableau “To Do List”. #MakeoverMonday often, inevitably, has an American edge, and I’m tired of America continuing to be damn big and with States in silly places. I need to embrace Hex Maps to enable me to handle future US datasets in a way that doesn’t look awkward.
Fig 1.1: Alaska and Hawaii. A pain in the ass.
Hex Maps overcome these geographical challenges by squeezing all States into one view, in which they all share equal space. My original post collating Hex Map related articles from across the community contains plenty of additional detail. Coincidentally, a blog from Rachel at The Data School was shared today relating to Hex Maps, so I followed that guide, step-by-step, to tick this one of the list.
Or so I thought…..
Rachel’s article refers to a post from 2015 by Matt Chambers, and links his original source data file and even the hexagonal shape file Matt used. Excellent! However, the issue I found (see above) was that outlying States, like Washington, Oregon and District of Columbia have been “clipped” – I can’t see the full hexagon. No amount of fiddling with sizing would resolve this, so I cleared the worksheet and tried again a couple of times to no avail.
I was confident that I’d followed Rachel’s steps, so I stepped back and did two things. Firstly I published my Tableau workbook to make it available to the Twittersphere. I then engaged with Matt himself to see if he could stop the error of my ways:
Immediately after posting, I went to Matt’s original article to see if something was amiss, and then a fundamental difference in process became apparent. In Rachel’s guide, the Row and Column Measures from Matt’s Hex Map coordinate file are converted to Discrete, whereas Matt keeps them Continuous. The old “Blue versus Green Pill” stuff can really make a difference:
Not only are the hexagons representing Washington, Oregon and District of Columbia now fully depicted, but I now realise that pesky remote States Hawaii and Alaska didn’t even make it onto the Discrete view!
Now follows a quick summary of how the view was created. First, I connected to Superstore Sales’ Orders table and shoved State on Detail. This puts Longitude on Columns and Latitude on Rows. Remove them! You get this attractive row of 49 marks:
Next, add a New Data Source and pull in Matt’s hexmap xlsx file. In this case, a relationship is automatically created between the State fields in the separate sources:
Now it’s a case of dragging Matt’s nicely named “Row” and “Column” Measures to the corresponding area:
Now whilst I’m not Mr. Geography, I know something isn’t right here. America’s dangly bits (Florida and Georgia) don’t dangle like that! As per Matt’s guide, I need to reverse the Rows axis:
With that done, Row and Column Headers removed, and all gridline crap set to None, things look better. When the Marks are set to Shape, the custom hexagon is used and things are resized, they look even better. Finally adding labels and tidying them up makes my first hex map! The published workbook includes worksheets for both the Discrete and Continuous versions, and you can compare the two with Story Point:
Thanks to Rachel for posting something which got me to finally test out this type of mapping, and for Matt for being so prompt in responding to my plea for help. I’m pleased to tick something off that “To Do List” at last!