14 Use Cases for Transparent Shapes & Images



Luke Stanke and the Tessellation team put out a ton of content.  Over the past year or so, FlerlageTwins and Tessellation have had a bit of a battle as it pertains for blog post material.  When I released my Case Statement Generator tool/blog post, I received a note from Luke that he had that exact same blog post planned for the upcoming weeks.  Then about a month later, he released his Color Palette Creator, which was a project I had planned to tackle; you had better believe he heard about it.  At that point, we were all knotted up at 1-1…that was until he posted Six Tips for Transparent Shapes in Tableau.  That one hurt a little bit.  I have been utilizing transparent shapes and images in Tableau for as long as I can remember.  And for the past 6 months, I had been compiling a list of different uses cases.  But Luke beat me to it.  Now it’s 2-1 Tessellation.  


In Luke’s blog post, he provides some fantastic uses cases for transparent shapes.  I sincerely recommend that you check it out.  As I read it however, I realized that he and I did not have on ton of overlap in the ways in which we used them.  So, I decided that I would write up my use cases for transparent shapes as well.  In this blog post I will provide you with 14 uses case for transparent shapes AND transparent images.  Some of the use cases are very common and others are incredibly obscure.  The idea is to simply show their versatility and help you to recognize when it might be beneficial in your own visualizations.


Before we get started, I’d like to thank Josh Tapley as he provided three transparent shape/image tricks for this blog post.  Thank you, Josh.  I'll also be linking to one of Ken's trick (that he already wrote about).


And one last thing...you can create a transparent shape in PowerPoint by drawing a square or rectangle, then set the fill color and outline to none.  From there, save it as a image.  Or, you can download a variety of them from here.


The Workbook


Like many of my blog posts, I created a Tableau workbook to house all of these different use cases.  The main page includes 14 buttons (hex shapes).  Click on any button to be taken to that particular use case.  The majority of them are built right into the workbook, but several will reference other, previously created materials from myself, Josh Tapley, and Ken Flerlage.  You should also note that the landing page itself uses 16 transparent images.  The main buttons are simply an image built in PowerPoint with 14 transparent navigation buttons and URL images floating on top – a technique the Lindsay Betzendahl recently wrote about.  (Check out her blog post and associated viz).  The other two transparent images are used to turn the text at the bottom into hyperlinks – something we will address later in the blog post.  So before you get started, please open the corresponding Tableau Workbook.  Alright, let’s get to it!



1. Label Second Axis with No Mark

 

A common practice is to utilize a second axis for labeling.  I did this on the Unemployment Workbook I created for my company Tableau Public page.  For the chart on the right, I used a second axis to place all the state labels out to the right (I placed them at the Window Max plus some padding). 


 


This technique is also very common when labeling small multiple charts.  Lorna Brown does a great job of explaining this technique in her Tableau Tip Tuesday video.


In my unemployment viz, on the second axis, I used a circle that was made very small and with 0% opacity.  In Lorna’s example viz, she used a line with 0% opacity.  The problem with both of these techniques is that the circle, line, or whatever else you use can be inadvertently selected, causing a weird experience for users.  Below are examples of what this looks like in both vizzes.  In mine, you can see the dot being selected and in Lorna’s, you can see the line being selected (I did get Lorna's permission to use this, by the way). 

 


 

 

For a better user experience, we can utilize a transparent shape.  The nature of a transparent shape means that they cannot be selected (this will be very important for many of the tips in this blog post).  If you click on them, you see nothing.  So if we were to swap out my circle and Lorna’s line with a transparent shape, that shape cannot be selected and that potential “weird experience” for your user cannot occur.

 

The example in my corresponding workbook uses a chart similar to my Unemployment Viz.  The first image below shows the possible selection with a circle.  The second shows how a transparent shape cannot be selected:

 

 


 

It’s no extra work to swap out that circle for a transparent shape, so just avoid any odd user interactions and use the transparent shape. 

 


2. Quickly Select Whatever Marks You Like

 

At work, I’ve built several visualizations for print.  I can’t really get into the details, but in general, we look at the percentage of accounts and how to optimize profit with those accounts.  The chart might look something like this:


 

 

For print, I typically will call out one percentage of accounts and see how that relates to profit.  For example, at 30% of the accounts, we see 46% of the profit.  But I don’t have to call out 30%.  I may choose to call out 40%. 

 

I could write a calculation that says that if the % of the Accounts = .3 then give me the percentage else null.  Or I could keep it really simple and really flexible and simply use transparent shapes.  In this case, on the second axis, I changed the mark type from circle to shape, placed the “% of Accounts” pill onto Shape, changed the 30% mark to a filled circle shape then changed everything else to transparent shape. 



 

 

 

It’s quick, easy and flexible.  If I want to see the filled circle at 40%, I can easily change it…or I can mark several different percentages.  All I have to do is change the shape. 

 


3. Points/Shapes with Different Colors in One Calculation

 

I commonly create charts that look at a measure over time and call out both the min and the max values.  Here is an example:


 

 

This particular example is fairly easy to build using Superstore data.  First I placed MONTH(Order Date) on Columns, SUM(Sales) on Rows and change that to an area chart.  Then I create another calculation to determine the min and max values:

 

IF SUM([Sales]) = WINDOW_MAX(SUM([Sales])) OR

   SUM([Sales]) = WINDOW_MIN(SUM([Sales]))

   THEN SUM([Sales])

   ELSE NULL

END

 

Basically, this calculation will return the SUM of Sales when it’s the maximum in the view or the minimum, otherwise it will return a null.  I then take that calculation and place it next to SUM(Sales) on Rows, make it a dual axis, and change the mark type to a circle (you could actually use a line as well as the broken line will yield circles).  As a side note, there are a number of different ways to do this including Measure Names & Values. 

 

However, what would you do if you wanted the circles to be different colors, maybe blue for the max and orange for the min?  Or what if you wanted different shapes, maybe a circle for the max and a square for the min?  Or what if you wanted them to be different shapes AND different colors?  Regardless of the method you chose to employ, this means additional calculations. Well, if you use a transparent shape, you can do it all in one simple calculation and you don’t even have to use that calculation on the Rows shelf. 

 

So let’s start like we did before, place MONTH(Order Date) on Columns, SUM(Sales) on Rows and change that to an area chart.  Rather than creating another calc to make a dual axis, place SUM(Sales) again on the Rows shelf and dual axis them (remember to synchronize the axes).  Now create one calculation, I’ll call it “@Mark Min & Max Shape” (I like to precede my calcs with a @ symbol):

 

IF     SUM([Sales]) = WINDOW_MAX(SUM([Sales])) THEN 'MAX'

ELSEIF SUM([Sales]) = WINDOW_MIN(SUM([Sales])) THEN 'MIN'

ELSE   'TRANSPARENT'  

END

 

This calculation is similar to the one before yet it calls out the Max as a value, the Min as a value, and if it’s neither, it will be transparent. 

 

From here, change the mark type of the second axis to Shape, then place this calculation onto the Shape card.  Here I changed the Max to be a circle, the Min to be a diamond and Transparent to be a transparent shape. 


 

 

I also placed this same exact calculation onto the Color card then made the Max purple, the Min gray and it doesn’t matter what color Transparent is because the shape is transparent and will not appear. 


 

 

Other methods require different measures to be used on each axis and three or four calculations.  This method is much more straightforward as I can simply use the same measure on both axes and I have maximum flexibility with just a single calculation.

 


4. Deselect Button Outline

 

Recently, there has been a lot of discussion about how to automatically deselect a mark.  Take this visual for example.  Here I have a simple area chart plotting sales.  In another sheet, I’ve created four buttons by placing YEAR(Order Date) on Columns and on Text then changed the shapes to a custom button I created in PowerPoint.  I placed them all on the dashboard and set up parameter actions so that when I click on one of the buttons, the area chart is filtered to that year.  (There is a bit more too it, but the details are unnecessary for this example). 


 

 

When I click the button, however, the buttons look like this.  Do you see that weird outline to the button?  It just looks bad. 


 

 

Luke Stanke recently wrote a blog post on this where he compiled the history of the discussion involving techniques from Jonathan Drummey & Yuri Fal.  Luke also had a method but according to his blog post: “Yuri is the originator of this methodology and I just wanted to blog on it because I think it is very elegant and requires only simple calculations. Because I like simple solutions, I’m deleting my post and sharing this simple methodology.”

 

The method is probably the best...and it's super easy.  However, for the past year or so, I’ve used an entirely different method than Luke, Jonathan and Yuri when interacting with buttons.  Yep, you guessed it, transparent shapes.  You can see it all over my work, but the most evident use of it is in my NFL Scatter Plots viz where every button uses a transparent shape.  But I’m certainly not the only one doing this, Josh Tapley has also been doing it for quite some time.  You can see it all over his work as well, one example being his 2019 Viz in Review (Change Author button). Therefore, this tip is from both Josh and I.


So let’s start where we left off – with this:


 

 

Go to the sheet where you created your buttons and duplicate that sheet.  We are going to leave YEAR(Order Date) on Columns, but take everything off the marks cards.  We will then change the mark type to Shape and put MIN(1) (we just need something) onto the Shape card.  It might look like this:


 

 

From here, we just change our shapes to be transparent shapes so you don’t see them at all.  But remember, the values are still associated with each year. 

 

One dashboard, we float this sheet on top of our original buttons.  You’ll need to make sure they align properly.  To do this, I often leave them as circles to get the alignment then change them to transparent shapes.  Once aligned on top of the original buttons, set up the dashboard actions to interact with the transparent overlay versus the actual buttons. 

 

As we mentioned at the beginning of this blog post, transparent shapes can’t really be “selected” so the experience of clicking on a transparent shape is very clean.  Below is what it looks like when selected:


 

 

As a side note, some people have suggested just using a square or circle with 0% opacity.  The problem with that is that when you click on it, it selects that shape. So stick with the transparent shape.


 

 

 

5. BANs without Weird Selection

 

Why the heck would we use transparent shapes for BANs?  Well this one came from Josh Tapley and I absolutely love it!

 

Let’s say we were building BANs for Superstore data.  Your worksheet might look like this:


 

 

You’re just showing the different Measure Names and Values using the text mark type.  There’s nothing wrong with that, right?  We all do it.  Well, what happens if a user clicks on it on your dashboard?


 

 

Yikes!  That looks awful!  Well, as Josh showed me, all you need to do is change the mark type to a shape, add in a transparent shape, and the text marks will act as a label on that transparent shape. 


 

 

Now when you click on a BAN, you see the following, which is about 1000 times better than that weird blue box:


 

 

As a side note, I used to utilize the first method and place a blank over top of the BANs so that the weird selection could not occur.  That works for some use cases, but there are plenty of situations where you might want the users to be able to select the BANs, such as swapping out charts or focusing on a certain metric or simply add tooltips.  In addition, the selection that occurs with the transparent shapes could be quite handy when presenting your dashboard.

 

I have to admit, I love this and I plan to do it from here on out.  Thanks Josh for the great tip!

 


6. Bar Chart with Additional Context

 

I’ve labeled this section as a Bar Chart with Additional Context, but the truth is, transparent shapes can aid in building all kinds of custom charts.  This particular example came from a question on the Tableau forums two years ago.  The user included an image from her customer and said, “How can I build this chart in Tableau?”  Ultimately, I built the chart using a transparent shape. 

 

For details on how this was built, please check out the following forums post:  YoY Bar Chart with YoY % Change.  Please note that the forums were recently upgraded and the original image (the chart I replicated) is not yet showing in this post. 

 



 

 

7. Turn Text into Hyperlinks

 

This is not a new trick.  I learned it from Rodrigo Calloni who learned it from both Pooja Ghandi and Eva Murray.  Regardless, it’s one of my favorite tricks for transparent images.


Okay, assume you have text in a dashboard and you want some portion of the text to be a hyperlink.  If you type out the entire URL, it will turn into a hyperlink, but what if you wanted it to be cleaner with a hyperlink on a single word? 

 

All you need to do is float a transparent image on top of that word and set a URL on that image.  When I do this, I typically like to underline the text and change the color to blue.

 

In my example, I pulled some text from the Wikipedia page relating to Tableau:


 

I underlined “Tableau Software” and changed the font color to blue.  I then floated a transparent image on top and assigned a URL to direct to Tableau’s website:


 

 

I use this all the time!  In fact, the landing page of my corresponding viz uses this twice, once for you to be able to click to go to my Twitter page and another to go to this blog post. 

 


8. Transparent Overlay for URL Images

 

Using a URL action is an alternative way to create text hyperlinks.  Although I prefer the method mentioned above, sometimes this technique will come in handy.  In fact, recently Tableau Public had a bug where the URLs attached to images were not working properly.  The workaround for this was to use URL actions.  I’ll show you how I did it using the same example text we used above:


 

 

I created a new worksheet and changed the mark type to Shape.  I simply added MIN(1) to the shape card and changed the shape to a transparent shape.  Then format the overall sheet to have no color (transparent). 


 

 

On the dashboard, float that sheet over your text then set up a dashboard URL action.  In that window, simply type (or copy/paste) the actual URL into the URL field.  Set the action to run on Select.  And that’s it!


 

 

As a side note, I recently had to use this technique for 24 different items in a dashboard.  In that case, I created a new data source in Excel that listed the URL for each of my 24 items.  I then built out a small multiples grid of transparent shapes using that data source and when I set up the URL Action, I fed in the URL from the spreadsheet (versus just typing it in like I did above).  You can “feed in” that data from the spreadsheet by clicking on the ► button next to the URL field. 

 


9. Show Container over Button

 

In my NFL Scatter Plots viz, I use a bunch of buttons.  (Each one of them uses the transparent overlay technique discussed above).  Clicking each button fires off a parameter action that changes the visualization. 


 

 

At the top, there are three buttons.  These buttons allow you to change the highlighting within the scatterplot.  If you click on Conference, the button is highlighted and the teams are highlight based on conference (AFC or NFC).  If you click on Division, teams are highlight by their division (AFC North, NFC East, etc.).  But what happens when you click on Single Team?  Theoretically, it would highlight the team of your choosing, correct?  But how would I do that by simply clicking a button?  I really need to be able to choose Single Team “mode” then select the team I want to highlight.

 

In this case, I opted to utilize a transparent button.  I added a container to the viz and in that viz I added a drop-down parameter that listed all the team names as well as a value of “All Team”.  I then added a show/hide button.  I made that button transparent and floated it on top of the Single Team button.  When a user clicks on Single Team, the drop-down menu is revealed.  When a user changes the team, the Single Team button is then highlighted (this is done with a simple calculation) and that selected team is highlighted in the viz.  Check out this GIF to see how it works:



 

 

 

10. Games

 

Alright, it’s time for some use cases that are a bit more obscure.  One of these would be for games.  In March 2020, we scheduled our biggest Cincinnati TUG ever.  We coupled it alongside an analytics conference at the University of Cincinnati and we were going to have nine Tableau Zen Masters in town. 

 

Ethan Hahn, who has written blog posts on this site and I’ve referenced many times, really wanted to do a game show with the Zens.  He called it      Zennywood Squares, which was based off the old game show, Hollywood Squares.  Well, we needed a game board and I figured we should build that game board in Tableau.  Therefore, that’s exactly what I did. 

 

I laid out a 3 by 3 grid of black and white Zen photos in PowerPoint and brought that into Tableau.  I then overlaid each individual photo with a collapsible container containing a color photo of that person.  The button used to click the square was transparent.  We also needed a mechanism to change the square to an O or X.  I created two new collapsible containers, each overlaid on top of each other, containing O and the other containing a X.  I wanted it to be very clean, so again, I used transparent images for the buttons. 

 

If you check out the Zennywood Squares game board on my Tableau Public page, you can opt to watch the video.  This explains generally how it was built then walks you through how to use the game board.  Here you will see all the different transparent buttons that open up collapsible containers.  And of course, you can try it out yourself.

 

https://public.tableau.com/profile/kevin.flerlage#!/vizhome/TheZennywoodSquares/ZennywoodSquares

 


11. Interactive 3D Funnel

 

Here’s another great use case from Josh Tapley.  In this one, he explains how to create a 3D Funnel.  However, the key is to make the funnel interactive.  To do so, he uses transparent shapes will allow for proper highlighting and use in dashboard actions.  Check out his Interactive 3D Funnel viz where he shows you how to build it.

 


 

12. Warning Button

 

Last year, I created a viz for SportsVizSunday where I utilized a radial chart that was far from best practice.  I wanted to warn viewers of this so I ended up creating a flashing warning (in the form of a hosted GIF).  The warning asked users to click here and in doing so, it revealed context of the warning.  Below is a GIF to shoe how the interaction works. 



 

 

So how did I turn a flashing GIF into a button?  I didn’t.  I used a transparent button that floated over the gif.  And when it was clicked, it opened up a collapsible container.  I wrote about this technique in my Cases for Collapsible Containers blog post.  Check out number # 12 in that blog post for full details.

 


 

13. Scrollable Timeline

 

Ken recently wrote a nice blog post on how to create a scrollable timeline – a really cool technique.  As part of that technique, he uses a transparent shape so that years without events don’t show on the timeline.  You can check out the full blog post here.

 


 

14. No Polygons

 

Okay, last but not least…I used a transparent shape in my No Polygons technique, which I wrote about nearly two years ago.  Unfortunately, most people that have used this technique neglect to take this one additional step. 

 

In my blog post, I said the following: “There is one major issue, however.  If you hover over any of the charts, you will see that it only provides a tool tip for one region.  This is because you stacked the shapes on top of each other which means you will only see the tool tip for shape on the top of the stack.”

 

From there, I go on to explain how we can stack one more layer, a transparent shape, and use some calculations to show all the tooltips.  You also avoid the weird experience of only being able to select one “petal” as the transparent shape doesn’t allow you to select any petals.  Check out the full blog post here.

 


 

Summary

 

As Luke said in his transparent shape blog post, “This shape is extremely versatile and underutilized.”  I completely agree with him.  I hope his blog post and this blog post will help provide you with ideas on when transparent shapes and images can make your life easier and make the user experience better. 

 

Thanks for reading and, as always, feel free to reach out to me at any time.

 

 

Kevin Flerlage, July 27, 2020

Twitter | LinkedIn | Tableau Public

 

 

 


No comments:

Powered by Blogger.