How to Auto-Generate 50 State Maps in Tableau

How to Auto-Generate 50 State Maps in Tableau

By Ben SullinsOctober 28, 2016
Note: The following is a guest post by Tableau enthusiast Ben Sullins.

Recently I fell in love with the small-multiples types of graphs that show each individual state level metrics separated into a grid-style layout. Being the data hacker that I am, I decided to use my rusty JavaScript skills to auto-generate 50 individual state-level maps from one Tableau viz.

Here’s how I did it:

  1. Build a Tableau viz with a map of the United States (or whichever country you wish)
  2. Use JavaScript to generate an image for every state from that Tableau viz
  3. Place these images on a page and style accordingly so they are responsive to the user’s screen size

1. Build a Tableau Viz

Here what I’ve done is take the regional view that comes with the Tableau Desktop samples. It shows obesity rates for every county in the US. Once we have this, we really are done with Tableau at this point. Simply publish this to Tableau Server or Tableau Public and move on to the next step.

2. Use JavaScript

Before we dive in here, remember what master Yoda says about the force of JavaScript:

“You must unlearn what you have learned” – Yoda

Read more…

How to Auto-Generate 50 State Maps in Tableau

Note: The following is a guest post by Tableau enthusiast Ben Sullins. Recently I fell in love with the small-multiples types of graphs that show each individual state level metrics separated into a grid-style layout. Being the data hacker that I am, I decided to use my rusty JavaScript skills to auto-generate 50 individual state-level maps from one Tableau viz.

 

The following two tabs change content below.

Eric Axelrod

President & Chief Architect at DIGR
I have helped companies bring new data driven products to market, drive efficiency out of their supply chain, execute strategic plans, and drive top line and bottom line growth by enabling every business function with actionable analytics. I can transform a business which is lacking critical insight into an agile, strategic, data driven organization.

Leave a Reply