Well, it’s been a hectic week in Las Vegas for our customer conference but I have a brief window to put up this post. If you’ve been here, I hope you had a great time and learned heaps!
One of the sessions I co-delivered with the ever amazing Sarah Battersby (@MapsOverlord) was “Masters of Hex: Interpreting Dense Data with Tableau”. We’ve presented this session for the last 3 years but as always we update our material for any new features and techniques. This year we have access to the 10.5 beta, and I came up with a great idea to use it for a way to dynamically zoom in on dense data.
I’ve called this idea a “loupe” tooltip – after the magnifying eyepiece used by photographers and watchmakers:
Here’s my starting data – a scatter plot with 100,000 data points packed densely:
As you can see, it’s impossible to make out what is going on in the bottom middle of the chart – there is too much overplotting of the marks even when we make the marks as small as possible and ramp up the transparency. But what if we could dynamically zoom in on a small section – like we were looking through a loupe?
To achieve this, I’ve created binning calculations (I’ve had to use calcs to do this as you can’t use a native bin object in a calculation which I need to do later) to allow me to select a small group:
BinX: FLOAT(INT([X]*10)/10) BinY: FLOAT(INT([Y]*10)/10)
I’ve also created another sheet which we will use in the tooltip – essentially it’s just a duplicate of the primary scatter plot, but I’ve cleaned up the axes and the formatting to make it clean and minimal:
I also made a loupe title sheet to just show the count of the marks in the scope of the loupe:
Now we add them to the tooltip of the primary scatter plot, and set the filter fields to be BinX and BinY:
However we have a problem when we loupe over a sparse bin – the loupe axes are zooming in to just show the point:
It would be preferable to fix the loupe to always show the extent of the bin, so we can use the neat trick of placing reference lines to pad out the axes to a larger size than the data demands. We create a couple of boundary calculations for X and Y:
XLowerBound: MIN([BinX]) XUpperBound: [XLowerBound] + 0.1 YLowerBound: MIN([BinY]) YUpperBound: [YLowerBound] + 0.1
We then put these calcs on the detail shelf of the loupe and we can create a reference band:
Now when we loupe over a sparse bin we have a much nicer view: