Getting Animated With Tableau’s New Feature – Part 1: Line Charts
In this blog post I’m going to discuss one of the headline features announced at Tableau Conference 2019 and newly released in version 2020.1, mark animations. You may see these referred to as mark transitions, viz animations (which has its own hashtag) or animated transitions – these terms will be used interchangeably in various places.
This is a huge deal and a massive step-change in the experience of designing and creating content, and in interacting with the product. There are plenty of other resources discussing the functionality and showing off many of the more unusual use cases that animation can offer. I’ve linked to plenty of those at the bottom of this article.
What this blogpost focuses upon, however, are some of the more fundamental experiences that everyday users are more likely to have. If we go along with the theory that 80%-90% of all charts we create are (or should be) bar charts and line charts, then that’s where most of our exposure to animation will be. So this post is going to discuss animating just one chart type – line charts. In particular, I will focus on some of the basic experiences, explore a neat trick from one of the biggest demos, and also cover off some of the user controls available.
Before I get ahead of myself though, I want to recommend two things. Firstly, a more detailed breakout session that was given at the conference in November 2019 by Paul Isaacs and Phil Naranjo. You can catch that here:
Secondly, Tableau’s official blog has an extensive write-up, which I recommend you should also read alongside this. A lot of the content overlaps with that TC breakout video, but other parts are distinct.
Slicing versus non-slicing
Probably the most fundamental thing to get one’s head around when it comes to animations is the difference between what they describe as “slicing filters” and “non-slicing filters”. I’ve pulled together a couple of examples below to demonstrate the difference, using the Superstore dataset and a line chart tracking sales over time per segment. There are two filters shown – one for segment (the dimensions I’ve broken the data up by) and one for category. It’s important to consider that each segment is made up of sales from each category.
Example 1: Deselecting and reselecting a disaggregating dimension (“non-slicing”)
So in the example above we have a line chart disaggregated into three segments (Consumer, Corporate and Home Office). Using a simple filter, we can deselect one and see it gradually fade and disappear from the view, and then reselect it to gradually bring it back. This doesn’t seem spectacular so far, but that fading is already new functionality which I suspect we will all very soon take for granted. In previous versions of Tableau that disappearance/reappearance would be instant.
In the second example, we’re going to deselect an option again, but this time in a filter that does not already appear in the view. The dimension ‘Category’ has three components (‘Furniture’, ‘Office Supplies’ and ‘Technology’). A lot more is going to happen here, but to work it out follow the shapes of the lines, and also the values on the y-axis labels.
Example 2: Deselecting and reselecting a category not in the view (“slicing”)
By deselecting ‘Furniture’ here, we aren’t removing a line, but removing the components of each line that were Furniture sales. In each month, Furniture contributes some to the total, but a different proportion each time. Overall it’s around a third. As we deselect a a component, we take a “slice” out of the sales shown in the view, but we haven’t removed any lines. Of course, if all Home Office sales were of Furniture, then the Home Office line would then disappear. Notice also that each action also has the effect of re-scaling the y-axis range if the highest value mark on that axis changes to a different mark in the view.
So, a slicing filter removes or adds a slice of the data to the existing disaggregations. Whereas a non-slicing filter removes or adds one of the components that are already disaggregated in the view.
Shining Light Upon Magic
If you’ve seen some of the promo material for the new animations feature, you might have seen some more advanced examples, and I wanted to take this opportunity to examine one particular example which was demonstrated in the Devs On Stage keynote at TC19, where clicking a filter split a line chart into five constituent parts. Click the below video to watch (it should start at around 15:00, so skip to that part if it doesn’t automatically!).
It is important to convey that this is not basic functionality, and you should not expect to be able to be able to switch between aggregated and disaggregated line charts by “clicking this filter”, as is demonstrated. There are probably a number of ways to achieve this, primarily through parameters (and possibly through set actions?). If you want to achieve this yourself, you can do, but it does require a number of prerequisite steps which are not shown in that demo.
Go back and watch that demo again, and pause the video before the ‘Select Detail’ option is toggled. Note that there is a single line for the ‘Combined’ option, but we still have a legend. Why is that? It’s because actually there are five lines and they’ve been stacked on top of each other. And the y-axis title has the little pin icon alongside it, which shows that the demo has fixed the axis so that the range doesn’t change when the option is toggled.
Here’s a quick demo of that same concept, but here I’m using Superstore again:
Now, I don’t know for certain but I think it’s safe to assume that Tableau’s own demo made use of both Parameters and Level of Detail calculations. Here’s how I did mine, and you’ll see that it doesn’t involve all that much pre-work, but it is necessary in order to allow the magic to happen.
One big item to flag up here is to be extremely cautious about how you are representing your data. These sorts of reaggregated Level of Detail calculations will only make sense in certain conditions, and you should always make sure you fully understand your data, and validate the resultant line chart against a more simplistic view before sharing.
Controls and compatibility
Before I finish, a brief comment on controlling the animations, and also the experience via the web. As the creator of a viz, you have the ability to determine whether to enable animations (they will be disabled by default in version 2020.1). You can do this via the control panel available by clicking ‘Format’ -> ‘Animations’. If you’re publishing your work to Tableau Server, then be conscious that if your server version is lower then the animations will not work.
Another control which is useful for understanding how the animations operate is the toggle between ‘Simultaneous’ and ‘Sequential’ styles, particularly when a change invokes both slicing and non-slicing filters. The sequential selection shows the distinct steps in the animation, whereas the simultaneous option will apply them all at the same time.
Other chart types
As stated, I’m going to focus on just some of the basics, so the next blog will cover bar charts, and I’ll link to that once it’s been posted. Scatter plots perhaps. Watch this space.
There are already some wonderful resources out there you can use to get to grips with animations, and doubtless many will follow as the functionality becomes more embedded and more users upgrade to Tableau versions 2020.1 or higher. Here are a few I recommend to begin with, which I will add to as more are written:
– Zen Master Marc Reid’s blogpost “Animated Transitions in Tableau” examines the background more thoroughly and includes some excellent demonstrations of the before/after
– Bona Wang’s blogpost “Tableau 20202.1: Viz Animations” covers the controls in further detail.
Author’s note: an initial draft of this post suggested that animations would be enabled by default, which is no longer the case. This has been corrected.