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