How to Ace Shape Making (Guest Post by CJ Mayes)
I'm excited to welcome CJ as a guest blogger. CJ has been posting some great visualisations since joining Tableau Public and recently had a VOTD on his Man Utd legacy viz. CJ is a Data Analyst and colleague at Lloyds Banking Group in London. You can view his Tableau Public profile here.
Intro
I’m very humbled to be able to join Amar’s blog post as a special guest. In honesty, I feel slight imposter syndrome given I only really took up Tableau Public during the start of the lockdown as a design hobby with the hope to learn a few skills for work.
Since March I’ve produced a variety of vizzes. The one I want to
dig into a little deeper is the most recent Roger Federer viz, having had a few questions how the shape was created. (I am
still wishfully hoping Roger sees it, as he is one of my all time heroes). For
those that have seen the Michael Jordan ‘23’ Viz, or the Premier League logo
viz, the same methodology was used, as you’ll be able to see later on in the
blog.
Now:
Game time, The Roger Federer tutorial.
The original idea comes from @Zach Bowders – Wick Visualisation, who he credits to David Kelly. Zach paints an image in Tableau using different shapes and colours.
What you’ll need:
- A dataset, preferably between 500-4000 rows.
- An image vector you want to put your points in the shape of. (such as the RF logo)
I’ve attached links to the Federer material used within the
tutorial to make things easier.
The original data I used for the visualisation can be found here.
I stitched together the 2010-2020 datasets of where Roger Federer
was named the winner or loser from the ATP records.
Step
0: Decide on the data you are using.
For my dataset, you will note
there are three final sheets;
Original: Our original 659 games between 2010-2020.
RF: The logo co-ordinates of X and Y that we will create and then
match to our dataset. (659 points)
RF & Logo: Where I duplicate the dataset to have a view column
that toggles between the logo and the RF logo. (659 points x 2 Views)
There are 659 games he
played during this time. This will become important later on.
Step
1: Open the site automeris. (https://apps.automeris.io/wpd/)
Step
2: File, Load Image(s), Locate the Logo you want
to use in this case I used a plain black vector of Roger Federer’s brand. A
simple Google of it will do, if not take the one from here.
Feel free to use your own image vector, but for simplicity sake,
for now I’d advise using a one-block colour vector (If you start to use an
image with various colours you will have to export multiple datasets as seen in
step 5)
Step
3: Plot type: Image, align axes.
Step
4: Within the bottom left hand corner we see the
Automatic Extraction Mask box. I’ve amended the (Foreground) colour to be the
black as seen in the logo. This is where I want my dataset to create points for
plotting.
The
distance and ΔX and ΔY Px determine the spacing between the co-ordinates
plotted. Have a play around with various combinations to see its functionality.
Step 5: Hit run!
You
will see co-ordinates of X & Y appear across the chosen colour (Black)
these co-ordinates we can later plot in Tableau.
Note:
If you want to use various colours you will have to repeat this process over
using the different foreground colours of your image and clicking run.
Step 6: Time
to readjust our X and Y values and distance until they look appropriately
spaced and are as close to the number of data points in our data set. See
within my print screen it shows I have only 609 points. Therefore I need to
adjust my X and Y to be smaller to re-run with more datapoints until I am equal
or slightly above 659. This is because when we come to plot the points we want
to give each co-ordinate a specific game reference!
Note: It’s super hard to
get a perfect match. Better to get slightly too many points and delete a few
using a Rand() function in excel.
Step 6: View
Data!
Once we view the data we
will see our logo is a series of X-Y co-ordinates. It is personal preference
how you download this. Personally I download to a .CSV
Step 7: Assign X-Y Co-ordinates to our dataset.
Copy and paste into two
new columns headered X & Y the new 659 points against our original data.
As you can see in the
‘RF’ sheet, we have now added the X and Y columns we have just downloaded into
our dataset. This is essentially giving each of our games an X & Y
co-ordinate.
Step 8: Open Tableau!
Connect
to our new RF sheet that we just created.
Step 9: Open a New Sheet
Step 10: Drag X onto Columns, and Y onto
Rows.
Make
sure both are continuous dimensions. The marks type should automatically switch
to being a circle, but you can also play around with other shapes.
Step 11: Wow looks somewhat
familiar…
Step 12: Game, Set and Match!
Because we have assigned each point an X and Y
value, we can now add in the tool. I drag surface onto colour, add all the
match details into the tooltip and resize to make the logo look slightly more
uniformed. I put round onto size and sorted them by how far in the knockout
stages Roger reached. Sizing can become a bit tricky dependent what you size
on, so that your image doesn’t lose shape.
How to go radial?
I had been toying with ideas of how to create different radial graphs with my visualisations having originally seen Amar’s music Makeover Monday. I was therefore delighted to see Jeff Platner’s Kobe’s tutorial, which perfectly covers it off for what I needed.
For the sake of repetition I will just mention a few extra pointers in addition to Jeff’s post:
- Take the ‘original’ dataset and apply a GameID as well as a radius column based upon the year.
- Follow the recommended steps by Jeff to get the right style and shape. Try playing with the game angle to see what works for your data.
- Most important part: I then re-exported my data once I had made the visualisation to be able to append it to my other dataset. The new data will contain the X and Y co-ordinates for each point needed!
4. I can then stack this on top of
my logo dataset (RF & Logo Sheet) This allows me to only have to plot X and
Y on Columns and rows like before and use a filter to switch between them. I
did this by having the filter set on Leave
the filter. Meaning it will only show the Radial chart OR the Logo.
Going one step further:
You
will have seen that I duplicated my dataset to switch between a radial view and
the logo. Truth be told, the scaling of the two vizzes in terms of X-Y
co-ordinates are out of proportion so I used the entire view and automatic
scales to make sure they would adjust well in terms of the viz. However, I think
the slow animation transition worked well. If you’d like to learn more around
animations I’d hugely recommend looking at Marc Reid’s animation blog, and Liam Spencer’s complex animation.
The
visualisation is now downloadable so do have a play around, and message me if
you have any questions at @_CJMayes on twitter or CJ Mayes on Linkedin. I’m really
looking forward to seeing what people come up with, and I love seeing all the
sports vizzes especially! Do remember to tag #SportsVizSunday on twitter.
To end, a few shout-outs to those that have inspired recent pieces
of works and whose tutorials massively helped inspire my journey between March
and today are needed:
Kobe
Bryant Viz – I’m still excited to revisit this dataset
but super enjoyed tutorials from @Toan Hoang on Dendograms and taking inspiration from the artistic talent of @Judit Bekker in the way she beautifully presents a story.
Premier
League Transfers – The Arc tutorial was from @Ken Flerlage, whilst the premier league logo was inspiration from @Daniel Ling. It was at this point I started to really enjoy making sport
vizzes!
Premier League Winners – More thank you’s are needed for the spiral tutorial from Toan Hoang.
CJ Mayes - 03 September 2020