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:


#Main #Tutorials
May 27, 2014 @ 10:30 am

This is pretty cool and fun. My concern is that the pictures’ sizes appear to be scaled according to some unseen metric. However, Pokémon also vary in size, and this is reflected in the sprites you used. You’re probably done with this project, but I would look into the “small sprites” used by the games; those sprites are really small and as such, Pokémon are made to fill as much of the small canvas as possible, meaning they’re all much closer in size.

June 27, 2014 @ 7:40 pm

Hi Jewel,

Jonathan Drummey & I have been discussing this approach you’ve taken over in the Tableau Forums. And I’ve also started a new idea for Dynamic Images as Row Header.

Curious, have you any experience with folks scaling this method that you’ve outlined here ? When I try with 10,000 images it breaks down. That’s both because the alphanumeric application of custom shapes doesn’t work when the data is filtered, and also because of memory problems when saving the .twb file.

Any ideas ?

Keith Helfrich

    July 1, 2014 @ 10:13 am

    I’ve heard a rumor that Andy Kreibel and his team will be addressing large shape collections in their TC14 talk, but I don’t want to give away too many details. 😉

  • Pingback: Using Images in Tableau - The Information Lab

  • Pingback: Nasa Moon Landings - Photo Mosaic in Tableau

  • Pingback: Humanitarian Response Map Review – Helping disaster relief using Alteryx and Tableau | DataPirata

  • Leave a Reply

    Your email address will not be published. Required fields are marked *