The Alphabet Project

P is for Planets

INTERACTIVE VIZ

For as long as I can remember, I’ve slept with my curtains open. Whenever I can’t sleep, I find great comfort in staring up at the stars and moon, and I soon manage to drift off again.

When I moved to London 5 years ago, I was looking for a job and thought it must be fate when I got an interview at a publishing house (my parents were both booksellers and I grew up surrounded by towers of books) and I was more than a little disappointed when I didn’t get the job.

But the next day, I got a phone call asking if I’d interview for a Satellite Telecommunications company and the rest, as they say, is history.

The Viz

Once again, I’ve gone for a floating viz, with three different levels. First up, the base layer or orbital tracks. For this, I used a data set that included the distance of the planet from the Sun and various markers to at different angles depending on how far out the planet is. In other words, for Mercury, there is a point every 5 degrees around the orbital path and for neptune, every quarter of a degree. This allowed me to create a dotted line to use as the background image for the viz.

Next up, I planned out the orbital paths, using data from nasa.org. I’m lucky to have access to Alteryx and Tableau Prep, but for small data sets (3294 in this case), I actually prefer to use excel. Each to their own I guess! I often find myself using a multi-row formula and I find it much easier to test my logic in excel but prefer Alteryx for larger data sets or more hefty data transformations. In this example, it was an easy calculation:

I used excel to fill the “degree” field in the dataset, starting at zero for each new planet in the dataset and then adding on 360/orbital period to give the number of degrees travelled each day.

I converted these degrees to radians in Tableau (using “RADIANS([Degree]“) and calculated the x and y coordinates as below:

Once the radians have been calculated, it’s a simple sin or cos calculation. In this example, I wanted each planet to have a different radius, so I simply multiplied by the distance from the Sun.

The only thing to left to do was to build out the viz and play with the formatting. Because I knew that I’d be layering up my viz, I made sure all of my backgrounds were set to `No Fill`. Then I put Y on columns and X on rows. I wanted to use images of the planets instead of simple circles, so I dropped Planet onto shape and put Days onto Pages to play it through. There was a slight problem with this though…it was SO SLOW!!! So I simply created a Weeks field (CEILING([Days]/7)) and dropped that onto pages instead. Don’t get me wrong, it’s not the fastest animation, but it’s better than it was!

Because the images of the planets is so small in the orbital path worksheet, I also added an image into the tooltips.

Finally, I made a simple bar chart to show the orbital durations and speeds for each planet. I remember always being surprised that planets further from the Sun travel much slower than those with shorter orbital radii so I added in an explanation of why that is the case in a floating text box. I wanted the text box to lie on top of the orbitals because only Mercury, Venus and Earth would actually complete a full orbit with the animations so there was a lot of empty space on one side of my viz. I picked a lighter colour and set the transparency to 50% to bring some of the background through but make sure it was still easy to read.

And that’s it! It’s not the most technical viz, but I really enjoyed this week.

What’s Next?

It’s over to Adam for next week’s choice! I can’t wait to see what he creates, so be sure to keep your eyes peeled on his Tableau Public profile and his blog to see what he creates.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s