By looking into Rody's template, I found something to tweak. I created here two versions of the hex map. Both uses smaller data sizes. Note that originally each hexagon needs 6 points thus 6 rows of data. Here you go.
1.Label without extra 51 rows
Rody used an extra 51 rows solely for the state labels. I found a way to label without the extra rows.
First, drag avg(X) and avg(Y) to Columns and Rows shelves respectively with State in Details and Point in Path, while the data mark is Polygon.
Second, use avg(Y) for the vertical position of the label. Put Abbreviation in Label shelf. So we get the labels right in the middle. Note we need to select Circle as mark and make the color 100% transparent.
Third, blend with a data file and use a select measure to color the hexagons.
In Rody's hex map, each state requires 6 rows per polygon thus per state. Here I applied densification to the construction of the hexagons. Thus only 2 rows are required per hexagon or per state.
Here are the steps.
Step 1
Create one-mark-per-state data set where each mark is positioned at the center of one hexagon.
We got 51 rows here: 50 states + DC.
Step 2
Load the data set into Tableau and union with itself. We got 102 rows here. That's all we need.
The resulting data set is like below.
Step 3
Create Point field to be 1 and 6. Then create Point (bin) from Point to go from 1 to 6.
Step 4
Create X and Y for each of the 6 vertices of hexagons.
Step 5
To trigger densification, we need put Point(bin) on Row shelf first. Right click and select Show Missing Values. Then drag it to the Path shelf of Polygon data marks.
Step 6
Use Dual Axis to label the hexagons. The labeling is easy because we have already the coordinates of the center of the hexagons. Note we need to select a circle mark and make the color 100% transparent.
Step 7
Blend with a data file and use a select measure to color the map.
BTW, Joshua Mulligan's spatial file-based hex map is really cool. One may not need all these above. I wrote these simply for personal research interest and show one of the many ways to create a hex map.
And I noticed someone left a message at the end of Rody's article asking for detailed steps. If someone is creating hex map for other countries or regions, he may not have the luxury to create or find spatial files. Hope this can help.
The workbook can be downloaded from here.
Add a comment