#Data15: Pimp My Viz 2: Electric Boogaloo Follow-Up

October 26, 2015
10-26-2015 12-40-14 PM

I had a blast bringing back my weird point-of-view on making dashboards a little more fun to #Data15. Last year, I focused more on custom design and making things look as little like Tableau as possible. This year, I went a little more in the direction of doing some calculations and interactions that are a little more advanced. Let’s take a look at what I did!

But first, here’s the video I couldn’t get to play in my session:

Viz #1- Buzzfeed’s Most Viral Numbers

Ok, ok. Before you get too mad at me, yes. I admit it. I pimped my own viz. But it was out of desparation! All the vizzes submitted to me for Pimp My Viz were already too pimped out! Stop getting so good at Tableau, people! (Actually, don’t stop. It’s awesome.)

So here’s some stuff I did to make this dashboard a little more pimpin’

Design

Calculations

Viz #2- Price of Gold Over Time

This is a pimped out version of a viz originally by former Tableau intern and wunderkind Quinn Schiller. You may remember him as the badass who figured out how to use pages to make animated gifs in Tableau. In honor of that, GIFs were one of the key features when I made over his Price of Gold dashboard (which has some excellent annotations and storytelling in it!). Here’s what I did:

OMG! A useful application for gifs?!?!?!


You’ve gotta be kitten me!

It’s true! I thought of a useful application for gifs! I know I’m not alone in lamenting that using animation on the Pages shelf in Tableau doesn’t not work once published to Tableau Public or Server. But, we can use gifs to work around this! Check it out:

How is this done? It’s actually pretty simple:

  1. Create the gif. I used Camtasia, which I have for recording training videos, but that’s a pretty hefty piece of software. There’s plenty of free tools to create screen capture GIFs, so pick whichever one works best for you.
  2. Host the gif online (again, Imgure FTW!) and embed it on your dashboard as a web object.
  3. Float the sheet that you are animating on top of the web object. What we are basically doing is a variation on this trick I wrote about last year, to leave your viewers with a message when filters make your vizzes disappear.
  4. Last, we need to create a button to make the viz disappear and show the animated gif behind it. To do this, I created a calculation that equals “Null” for everything. I made a button out of it by creating a sheet, putting the calc on text, and setting a square shape in the background. I edited the text label to say “See/Stop Animation”. I added to my dashboard with a dashboard action that effects the scatter plot on click and where clearing the filter excludes everything. This is what makes the chart disappear and the gif behind it reveal itself.

5 Easy Ways to Pimp Your Viz

To end the session, I gave a rapid fire list of 5 easy ways to Pimp Your Viz. This was based on a blog post I did earlier in the year, but here are those steps again, just if you need a refresher:

  1. Colors. Don’t be satisfied with the default Tableau blue! I like using sites like Colourlovers to choose color palettes that aren’t built into Tableau. I also like that they limit their palettes to 5 colors, which makes you really think about how you are using your color. Ryan Sleeper wrote a pretty fantastic blog post about color a couple years ago that is still a great resource.
  2. Marks Card Magic. Along with changing the color, there’s plenty you can do with the Marks card to pimp out your viz a bit. Make your bars fatter! Add labels! The stuff I did to the bars in the BuzzFeed viz above is a good example of how simple changes on the marks card can make a pretty strong impact when it comes to making a viz look custom.
  3. Add a banner. A good title for your viz is a MUST. And you might as well take that opportunity to make a banner. Banners are great because you can communicate what the theme of your dashboard is and set the tone for what people are about to see. My typical banner strategy is to find an image related to what the dashboard is about, crop it, blur it, and add the title in a custom font. I often use Adobe Illustrator for this, but a few people in the viz design community have confessed to me they just use Powerpoint for this and it gets the job done. For a web based solution where you can create some REALLY gorgeous graphics for your vizzes, I highly recommend Canva. It’s a web based drag-and-drop design tool that’s super intuitive and has stock images built right in for you to use. I actually use it all the time for designing gig posters for my band and am just now starting to use it for viz work. But I have a feeling it’s going to be my go-to from now on.
  4. Clean up the tooltips. SWEET MOTHER OF GOD JUST CLEAN UP YOUR TOOLTIPS, OK?!?! You should NEVER EVER EVER publish a viz with default tooltips. I assure you, they look like unreadable crap 100% of the time. In my session, I said that if you don’t clean up your tooltips, little fairies will fly into your bedroom at night and punch you in the face. I’m not joking. Although, the little fairy might be me in a tutu and fair wings, but I assure you, you’ll get punched. In the face. You don’t want that do you? So just clean up your tooltips, ok?
  5. Thoughtful Interaction. A dashboard without interaction is like pizza without cheese…. an ABOMINATION. Think through how people might want to interact with the data you are presenting them and try to make the order of operations make sense. Make the order that you click things go from left-to-right and top-to-bottom since people in the Western world read that way. Have a friend look at your dashboard and just watch what they try to click on and make those the areas where you put your interaction. The more people play with your viz, the more they’ll remember it!
  6. Finally, let’s wrap this up with some of my favorite tweets about my session.

    Need more pimping? You can also watch the original Pimp My Viz session from TC14 in Seattle and read the followup!

Pimp My Viz TC14: Now Available for your Viewing Pleasure

April 23, 2015

Great news, everyone! All of the session from Tableau Conference 2014 in Seattle are now online for your viewing pleasure, including my super fun Pimp My Viz presentation. Check it out, learn some cool tips, and get thinking of ideas of vizzes to submit for *hopefully* Pimp My Viz 2015!

Data House of Horrors Followup!

October 20, 2014

Thanks to the lovely folks at import.io for showing a super fun time last Thursday at our Halloween special webinar! If you logged on, you probably caught some of our “fancy dress” but in case you weren’t, this happened:


Loading

Getting ready to get spooky with data on our @importio webinar!

View on Instagram

If you didn’t make it, never fear! It was recorded and you can watch the whole thing here:

I wanted to go a little more into detail about how to build this dashboard, so I’ll break it down piece by piece so that you can recreate it!

Bar Chart

Building the first bar chart is pretty easy. To start, put [Costume Category] on rows. Since there are duplicate rows (due to having one row for every word in a title), instead of using [Number of Records] we are going to do a CountDistinct([Prod ID]). You can do this by right-click dragging [Prod ID] to the columns shelf and then selecting Count Distinct, or by clicking the drop down menu on the Prod ID pill and then going to Measure>Count(Distinct). This means Tableau is now only counting each costume once.

blog1

Histogram

Making the price histogram was also very simple. All you have to do is select [Price] in the Measures pane and then hit the histogram button in Show Me.blog2

If the bins that your histogram selects are too big or small you can edit them by finding [Price(Bin)] in the Dimensions pane, clicking the drop down and clicking “Edit”. This will allow you to change your bins to whatever size you’d like.
blog3

Lastly, instead of doing a count on price, which will make for duplicate rows because of the join with the words, switch out [CNT(Price)] on the Rows shelf with [CNTD(Prod Id)].

Word Cloud

To create the word cloud, drag the [Words] on to text and [Number of Records] on size. At first, you’ll get a treemap. This is a good point to filter out some of the words to keep them mucking out the word cloud. I filtered out words like costume, adult, the, of, etc. You can just over over a square and click “Exclude”. Once you do that, you can switch the marks card from “Automatic” to “Text” to get a word cloud.
blog4

Another thing I wanted to do was filter to only the top 30 words; that way nothing is too small. Since we already filtered on [Words] when we excluded “adult” and “costume” and the like, we can create a duplicate field for words and filter on that. If you click the drop down menu on [Words] you will find the Duplicate option. Click on this and drag it to the Filters shelf. Once you are there, click the tab that says “Top” and choose “By field:” and set it to the Top 30 by [Number of Records].
blog5

Table

The table is pretty simple. Drag [Item] to rows and [Price] to label. Easy peasy. I also put [Prod Id] on Detail in the Marks card (you’ll see why later) and [Description] in the tooltip.

Hover Help Ghost

This is a trick I use all the time as it’s a great way to add context to your dashboard without taking up too much space. It’s been well documented before so I won’t go into too much detail. The only real thing I did differently was change the shape to a custom shape that looks like a little ghost. Read more about utilizing custom shapes here.

The “Sexy” button

To create this, I first went through all the words and created groups so that words like “Babe” and “Flirty” fell into the “Sexy” group and all other words counted as “Everything else”
blog6

With the groups created and renamed to [Sexy Words] I created the “Sexy” button by dragging out [Sexy Words] to the text on the marks card and then editing the label by clicking on the Text button and editing it to say “Click here to bring back”. Then I put [Sexy Words] on filter and filtered to only show words in the “Sexy” group. Then, I edited the formatting to have borders and colors to make it look button like.

Dashboard Interactions

Tableau Public is great for rapidly creating a lot of different charts types like we did above, but the real power comes in making these charts interact with each other. This is done through “Dashboard Actions.” Now that all of our sheets are created, we can create a new dashboard and drag everything onto it. Then we can create a series of dashboard actions by going to Dashboard>Actions in the menu. Here’s all the actions I created:

Design considerations

I wanted the theme to be really obvious, so I did a bit of design work to make everything match the Halloween theme. First, I set the background color to all of my sheets and the dashboard to black and set the other colors to fit a theme. I based everything off of this color scheme:

Trick_or_Treat
Color by COLOURlovers

I even created custom color palettes in Tableau so that I could use those colors as a gradient in the data.

Another thing I did was create a set of custom titles out of a custom font I found on DaFont called “Scary Halloween”
blog8

I also added a little tombstone image to the dashboard for the costume picture to load on top of.

So, that’s basically it! Our finished product looks pretty neat:

Learn About Tableau

So, that’s it! I hope you enjoyed the webinar and the dashboard!

#Data14- Pimp My Viz follow-up

September 16, 2014



I had SOOOOOO MUCH FUN being Xzibit for a day and getting to pimp some vizzes last week! Thanks to everyone who came and hung out with me. For those who missed it, here are the vizzes I pimped and some information about what I did with them.

Mat Hughes’ music dashboard

/r/tableau regular, Mr. Mat Hughes, sent me this great little dashboard of his music listening as tracked by last.fm. I wanted to make it more obnoxiously obvious that it was about music, so when I was done, it looked like this:

Learn About Tableau

Here’s some of the stuff I did:

Lari’s Disney Dashboard

The story behind this dashboard is that Lari McEdward, Tableau instructional video extraordinaire, and her sister were trying to choose a Disney movie to watch and resolved to make the decision by choosing the movie with the best songs. They judged all the songs and created this pretty-in-pink viz. Here’s my pimped version:


Learn About Tableau

Here’s some of the stuff I did:

Tweet me if you want more info on any of this. Hopefully you picked up some fun tricks that’ll make your dashboards a little more pimpin! To close, here’s some tweets:

“In case you were wondering what my data skirt was saying today…” @jeweloree explaining her music data on her skirt! HA! #data14 #datanerd

— Kristie Bauer (@kristiekbauer) September 10, 2014

@jeweloree teaching a valuable lesson – “what is pimping?” #data14 pic.twitter.com/ibGIz0fL9a

— Graeme Crawford (@n1jimmy) September 11, 2014

@jeweloree has fun ways of showing filter fails. #data14 #tableau pic.twitter.com/RiG1Wv0LTW

— Kristie Bauer (@kristiekbauer) September 10, 2014

@jeweloree this is BY FAR my favorite text I’ve received at #data14 pic.twitter.com/tpyUQQ2anO

— Mat Hughes (@MatHughesTweets) September 10, 2014

How to Scrape with import.io

April 25, 2014

Earlier this week, I did a webinar with import.io talking about how I used it to scrape the KEXP playlist. You can read more about it on their blog and watch the video here:

Pop Viz: 4 Years of Reddit and Using the JS API

April 14, 2014
Happy Cakeday to ME!

Last Saturday was my 4th “Cakeday” on everyone’s favorite time waster, Reddit! To celebrate another year of distraction, I wanted to update my Cakeday Karma Count dashboard from last year. I’ve learned a lot of tricks since then, so this new and improved dashboard has a couple of upgrades:

  1. Getting the data was way easier.
    Last year (and I shudder thinking about this) all my data was hand inputted into a spreadsheet. Now that I’ve learned a little more about the beautiful world of web scraping via import.io, I was able to get all this data in just a couple minutes!
  2. I learned how to use Imgur URL Parameters.
    This is actually a fairly new discovery for me. I found out about it when one of the students in my DDJ class was playing with Reddit data and wanted an easy way to resize all the Imgur links. Just adding an “m” to the end of the ID made it easy for me to switch between the three images that change in the URL object without having to manually resize all of them.
  3. I learned how to use Tableau’s Javascript API to have URL actions work both on a Web page object on the dashboard and in a new tab!
    This is by far the best discovery. Mad props to JSAPI genius Michael Kovner for helping me with this solution. When I made the dashboard last year, I wanted people to be able to open up the links to my posts, but it would load where the image changed instead of in a new window. Turns out just a few lines of javascript can fix it! More about the solution after the viz!

If you click on a bubble, you’ll notice the picture change. If you click on the box/arrow symbol thingy in the table, it’ll open up the link to that post in a new window (pop-up blockers may mess with this). Try it out!



So here’s how the double URL action works.

I created a normal URL action that changes the picture while editing the dashboard. The action that controls opening a post in a new tab is done completely in the Javascript API. All I had to do before publishing is make sure that the sheet that I wanted to control this action had the proper URL dimension I wanted to use.

After I published the dashboard, I created a javascript file called reddit.js that looked like this:

window.onload = function() {

var sheetDiv = document.getElementById("visualization");
var sheetURL = "http://public.tableausoftware.com/views/reddit/4years";
var sheetOptions = {
hideTabs: true,
hideToolbar: true,
width: "900px",
height: "1200px",
onFirstInteractive: function() {
}
};
viz = new tableauSoftware.Viz(sheetDiv, sheetURL, sheetOptions);

viz.addEventListener('marksselection', function(event) {
if(event.getWorksheet().getName() === "Post table") {
event.getMarksAsync().then(function(marks) {
if(marks.length === 0) {
return;
}
link = marks[0].getPairs().get('Link').value;
window.open(link, '_blank');
});
}
});
};

Let’s dissect what some of these parts are. The first section there is really just setting up that this script is generating a viz and we are going to do stuff to it. If you wanted to re-purpose this code for your own viz, you would replace the “sheetURL” with your viz and the width and height with what your dashboard is sized to. The second part is the event that controls the URL action. This function tells the viz to open a URL dimension named “Link” from a sheet called “Post Table” in a new window. If you wanted to use this on your own dashboard it would look like this:

viz.addEventListener('marksselection', function(event) {
if(event.getWorksheet().getName() === "SHEET NAME HERE") {
event.getMarksAsync().then(function(marks) {
if(marks.length === 0) {
return;
}
link = marks[0].getPairs().get('URL DIMENSION NAME HERE').value;
window.open(link, '_blank');
});

Once you have the code written, you’ll need to save the javascript file somewhere on your site. Then, when you are embedding, you’ll reference the Javascript API and your javascript file and call up the visualization like this:

(script src="http://public.tableausoftware.com/javascripts/api/tableau_v8.debug.js")(/script)
(script type="text/javascript" src="reddit.js")(/script)
(div id="visualization")(/div)

Note: all the parentheses are supposed to be triangle brackets… I can’t put them in that way or WordPress will think I’m trying to actually use them. 😛

That’s pretty much it! Thanks again to Michael Kovner for the awesome script and to my pal Josh Buchacher who helped me figure out how to embed this properly on my blog!

Quick tip: Sort by combined fields

March 19, 2014

This is a pretty simple tip, but it’s something I see new users struggle with all the time. Sometimes, sorting is a pain. Actually, most times sorting is a pain, especially when you are dealing with multiple dimensions.

JUST PUT THE BIGGEST ONE ON TOP!! GAHHHHH!

For example, I was working with some music data and I wanted to show a simple bar chart of the top songs and which album they were from. When I first dragged in the pills, it came out looking like this:

WHY?!

So… we have some problems. Some songs are on more than one album (e.g. a studio album and a live album). Also, there are a bunch of different songs with the same name (e.g. “Home”). So sorting this way won’t work. Doing it by album is even worse because many albums have multiple songs played from them:

WHYYYY?

So… what can we do? We have multiple songs on a album and multiple albums featuring a song. How do we get a unique dimension to sort on so they aren’t grouped? We combine the fields! It’s a simple process, just select the dimensions you want to combine, right click and select “Combine”

Easy peasy!

Now we can add this new combined field to the rows shelf and everything is magical. We can even hide the header so that the end viewer is none the wiser.

YAYYYYYYYY!

Hopefully this will help you sort through frustrations with sorting!

Adventures in DateParse

February 21, 2014

One of the things I was most excited for with the launch of Tableau 8.1 was the new DATEPARSE function. I just knew that someday this magical function would make my life easier. Today was that day!

I’m getting ready to build a visualization based on the playlist of my favorite local radio station, KEXP. They have recorded every song they have played since 2001. It’s pretty amazing. I scraped the playlist for all the songs they played in 2013 (over 300k!) using my favorite web scraping tool, import.io.

From the playlist table scraper I built, time was included in the table, but not date. However, the date for each row can be derived from the source page URL, which always contains the date and hour. Here’s what the data looks like:

Apparently they play crazy death metal at 1 in the morning.

I thought about how I would try to extract the date from that string in Excel, some combination of MID, DATE, and other functions) but then I realized that this is the PERFECT use case for using DATEPARSE. To start, I needed to extract just the date part of the URL string. I did that using the MID string function. I haven’t used string or date calculations very much, so I did them as two separate calculations at first, just so I could check that it was working as I expected to. The MID calculation takes the string that you specify as the first argument, in this case my source URL, and takes out a chunk of text starting on the character number that you specify in the second argument. There is an optional third argument, in which you specify how many characters you want to select, but in this case the length of characters varies, so by leaving this third argument out, I’m basically saying “Grab everything to the right of the 30th character.”

I put this calculation on the rows shelf just to do a sanity check and make sure the strings came out as I expected them to.

Sanity checks are always a good idea.

Next is the fun part! DATEPARSE is super easy to use and incredibly flexible. The first argument, you specify what the format is. In this case, it’s “yyyy/MM/dd/hha”, where y is year, M is month (not to be confused with m which is minute!), d is day, h is hour, and a specifies “period” or AM vs PM. You can find a reference for unicode date symbols here. The great thing about DATEPARSE is that even though my months are only one digit and my days can be one or two digits, it still totally understood what I was doing. Here’s what the calculation looked like:

YEAH TABLEAU! PARSE THAT SHIZZ

And here is another sanity check with the date string pulled from the URL on the left and the actual parsed date on the right!

IT'S BEAUTIFUL :')

Yay! It works! Since I know that it works now, I made it more efficient by combining these two calculations into one.

I feel so l33t with this calc right now, guys.

And now I can do all kinds of fun stuff with the dates! In conclusion, DATEPARSE freaking rules and doing all your datetime formulas in Excel is totally outdated.

You didn't think I'd post without a gif, right?

Pop Viz: America’s Regional Tastes

December 17, 2013

When Allrecipes reached out to Tableau to create a dashboard about Thanksgiving recipe trends, I was salivating… not just because of all the appetizing recipes but because this is some deliciously juicy data! The Allrecipes data team (shout out to my man Bob, who is awesome!) provided me with data on page views for Thanksgiving recipes broken up by state (based on IP address) and category (turkey, stuffing, pie, etc.). Here’s the viz:

Learn About Tableau

It was a super fun viz to make and I learned some useful techniques via my own personal Tableau master and desk neighbor Dan Hom about the new 8.1 ranking feature. Here’s what I did:

The Map

map
Obviously, the main feature of this viz is the map. Getting it to display the data for just the top recipe was a bit of a challenge, but once you get the technique down, it’s really useful. Here’s what I did:

  1. Write the calculations for Rank and for hiding everything but #1. There are two calculations I needed to write to create this view. The first one uses one of my favorite new 8.1 features, the Rank table calculation. Anyone who has ever struggled with all the hackery involved in getting Index to behave like Rank is going to be overjoyed with this new function. The calculation was simply RANK([Page Views]), since page views are what I was ranking my recipes on. The second calculation was to hide any data that isn’t the number one ranked recipe. I’m not sure what the intricacies are that keep you from using a simple filter on Rank, but you can’t. So, Dan showed me how to use a LOOKUP calculation instead. That calculation was LOOKUP([Rank],0) where Rank is the calculation I wrote to rank the recipes.
  2. Build out a chart sorting the recipes by state. I wanted to start out building a bar graph instead of jumping right into a map because it’s easier to see what’s going on. I dragged State and Recipe to the rows shelf and Page Views to the columns shelf. Then, I sorted descending. I also dropped Recipe Sub-Category on to the color shelf as an attribute. It was important to add it as an attribute because otherwise it will eventually show one top recipe for every sub-category instead of just what was the number one recipe.
  3. Add the ranking. I added ranking to the rows shelf as a dimension. I adjusted the Rank table calculation to be computed using both State and Recipe, with it being computed at the deepest level (recipe) and restarting every State. I checked to make sure the ranking numbers matched the length of the bars.
  4. Bring in the Lookup calculation to hide everything but the #1 recipe. I put the Lookup calculation as a filter and set it to 1. I was left with a view that showed only the top recipe in every state. (They weren’t being filtered by category yet. That came with a dashboard action filter).
  5. Switch it to a filled map. I used Show Me to switch the view to a filled map. Show Me likes to think it knows better than me, so it mixed around all my dimensions and measures. I put them back where they needed to be. Originally, I had the recipe name on label so that you could quickly see not just what kind of recipe was #1 in each state, but what the actual recipe was. But, that looked pretty cluttered so I took it away.
  6. Other design stuff. I took away the base layer of the map. I figure that anyone who is looking at a map of Thanksgiving food is probably from the US and doesn’t need the map stuff. I also made the borders white. I duplicated the map twice to make ones centered at Alaska and Hawaii to float in the final dashboard. Lastly, I matched the colors to match Allrecipes’ branding.

The category selector

categories
I really like using icons as buttons for filters. They provide a lot more visual interest and I think the are more intuitive to use for people who have never seen Tableau before. I also recently used this technique on my Pokemon dashboard using the different energy types as shapes. It’s a pretty easy thing to do.

  1. I grabbed the icons from a set of food icons in Smashing Magazine. They have a bunch of free icons to use for free. I added the entire folder of food icons to my shapes folder in Tableau. I have so many now that I definitely NEED to make more food vizzes.
  2. I created a new sheet with category on shape. I then chose which shapes I wanted to represent each type of food.
  3. I also put category on the columns shelf. The reasoning for this was so that I could adjust the spacing between each icon.
  4. I added labels and color.

The Top Recipe box

toprecipe
There are actually three sheets going into this section of the viz and an image. I made the rounded rectangle the same way I did for the Author Profile viz. The three sheets make up the title, the image, and the caption.

  1. For the title, I made a blank sheet with nothing but the category on label. I edited the label to say “#1 [Category] recipe in the US”. I also got rid of the borders and changed the background color so that it would blend in with the box behind it.
  2. For the image, I used custom shapes based on category. I actually had to make a duplicate of the Category dimension, since I had already assigned shapes to the original dimension to make the buttons at the top of the viz. The reason I chose to only show an image of the top recipe was for a couple reasons. It would’ve been cool to show an image of whatever was the top recipe in the state if you clicked on it or of the recipe you selected in the table, but that would mean I needed a picture for each recipe in the viz (which is several hundred…too many to download and assign to shapes). I could’ve used a URL action to link directly to those images on allrecipes.com, but if you have a URL embed in your viz, any URL actions automatically open in that embed. That means that when you clicked on a recipe to view it, the recipe would load in the little box that the image is in, which definitely wouldn’t work. I recently learned a workaround for this issue using the Javascript API which I’ll probably share with you soon. Anyway, to build the sheet I put the category on shape and set the level of detail to title. Then I put rank on rows and used my “Hide Rank” calculation to only show the top category.
  3. The caption was made by combining the last two things. You have to use Rank/Hide Rank to make sure you are displaying the right title, and then put title on label. When I made it, I actually just cloned the sheet that made the image, changed the mark type to text and put title on the text.

The Table

table
The table is pretty simple. However, it gets around a problem I often see a lot of new Tableau users get into with tables like this, so I’ll explain it anyway.

  1. I put title on rows.
  2. I put title and rank on label like “#[Rank]. [Title]
  3. I added State and Category as attributes. This is so that I could make a dynamic title. Did you know you can use fields in your titles? I have the title set up to say “Top [Category] Recipes in [State]”.
  4. I hid the header for the rows. Now what we are left with is a nice clean list. I’ve seen people try to do this but have the fields they want displayed just as rows and nothing in the marks, so they end up with a bunch of “abc”s all over the place.
  5. Lastly, I made sure that URL was in there to support the URL Action.

That was pretty much it! Hope you learned something useful!

 

Dealing with 718 Pokemon Shapes in Tableau

October 30, 2013

Yesterday, we published an awesome blog post on the Tableau Public blog by the always hilarious Ryan Robitaille. When describing the importance of effective visual communication he joked “it would be a shame for your detailed Pokemon analysis to go unnoticed.”

Yay! Ryan makes jokes aimed at my generation!

I chuckled at that for a good, long while. And then I asked myself, “Wait… why haven’t I done a detailed Pokemon analysis yet?” I was able to find a couple of examples of Pokemon dashboards in Tableau, but nothing that knocked my socks off. It almost seems silly that there hasn’t been tons of Pokemon dashboards, considering that it is a game based entirely on math and statistics. And there just happens to be TONS of data out there for it.

OMG!!! SO MUCH DATA!!!!!!!!

So, I have been exploring some ideas using a variety of different Pokemon datasets I found. The very first thing I thought to do was import all the sprites as shapes so that I could make an awesome scatter plot of attack points versus defense points. There’s just one problem…there are 718 Pokemon. Anyone who has ever really dealt with custom shapes in Tableau before probably looks like this right now:
718 shapes?!?! Can we just viz the original 151?

Tableau doesn’t make it super easy to assign shapes to things. Really, the only dialog you have is this box:

Yeah, this is the actual size of this window.

There isn’t a list view. There actually isn’t any way of viewing the names of the images at all. All you can do is look at the tiny little image and try to match it up with the appropriate Pokemon on the left. As you can imagine, that would take FOREVER. Especially with 718 Pokemon. Especially since I really have no idea what 567 of those Pokemon look like.

Luckily, I realized something today that is going to really simplify this entire process. When Tableau brings custom shape files into the above dialog, it does so alphabetically! So, since my sprites are already numbered, they should all come into Tableau perfectly, right? I can totally just hit “assign shapes” and everything will work out! Please?

Not quite. I ran into a couple snags. First, despite the fact that all of my Pokemon sprites were already named by their numbers, the way alphabetical sorting works makes anything start with a 1 go before anything with a 2 and so on. So instead of going 1,2,3 the order is 1,10,100,11, etc. Luckily, this is really only a problem for the first 100 Pokemon, so I went through the files and added zeros so that the order would be preserved.

The second problem is that the Pokemon are in alphabetical order by name. But that’s easily fixed by sorting the names. However, it’s a little weird. I have a field for number, which I can use to put the names in order. However, when you sort by a field you have to aggregate it somehow. It’s a little strange. Luckily, sorting by either minimum or maximum basically just takes that one number anyway.

Sort sort sort, sort sort sort, sort your dimensions.

(As I’m writing this, I’m just now realizing I probably just could’ve put # on shape and saved me that last step. Silly me!)

Once I got those issues out of the way, assigning my sprites was as easily as clicking “Assign Palette”! So, the moral of the story here is if you are going to be using a crap ton of shape files, name them in a way that matches up with the dimension you are assigning to them and it’ll be WAAAAYYYYY easier to deal with.

Custom shapes aren’t as scary as I once thought! But, the experience could still definitely be improved. Here’s an idea from the Community site about labeling the icons with their file names, which would definitely make things way easier. So now that I have my super awesome shapes in place, I can get cracking at making something cool. Here’s a sneak peak of my shapes in action:

pokemonscatter

← Previous Page