Saiku Treemaps and Sunbursts

I’m becoming a real advocate for the Saiku Server tool, the best open source OLAP product I have experienced, and one that keeps getting better. One of the great strengths of Saiku is the use of the terrific Protovis visualization library, which enables users to quickly toggle from a crosstab view to a diverse range of charts. Now, with version 2.6, the Saiku developers have added a few new features that make the tool even more powerful. I’ll walk through these in the following paragraphs, and show a few examples along the way.

The first new features are two visualization types that are becoming increasingly popular through tools such as Protovis and d3 – Sunbursts and Treemaps. These two chart types have a common theme, in that they display multiple levels of data within a single chart. In the case of a treemap, this is done using a rectangular format composed of smaller internal rectangles based on the proportions of respective data elements. A sunburst uses a similar approach, but with a circular framework that fans out from the center to encompass multiple layers of data, laid out based on proportions, just as with the treemap.

This will be much easier to explain with pictures, so let’s do that. In this example, I have set up a crosstab with home runs by franchise for the seasons 2006 through 2010, filtered by the American League. To make it easier to comprehend, I’ve also sorted by the number of home runs byfranchise over this period. This will provide enough data for the chart to be interesting while not overwhelming us visually. Each team will have a rectangle for each season sized by the number of home runs hit in that particular year. As with some stacked bar charts, the total for each season will add up to 100%, regardless of the raw numbers. Here we are:

You should get a pretty good idea of the numbers based on individual rectangle sizes, and if you don’t, Saiku rides to the rescue with some nice mouseover titles that tell you exactly what it is you’re seeing.

Now let’s see how the same data works with the sunburst chart:

Gets a little crowded compared to the treemap, due to the limitations of the circular layout. Let’s reduce the size of our data by including just the 2008-2010 seasons. This should help us to take advantage of one of the strengths of the sunburst diagram – the ability to size each level of the diagram. So in the case where one season has a higher number of home runs hit than the next season, the chart will reflect this visually. Recall that the treemap did not do this, instead providing a fixed 100% for each season, regardless of the raw numbers.

Our improved chart:

Even with the reduced dataset, we have some issues, mainly with the long titles of some of the franchise names. This could be edited outside of Saiku using Inkscape or Adobe Illustrator, or perhaps we can tinker with the CSS inside of Protovis to shrink the font size. Nonetheless, I hope this has illustrated the basic premise behind sunburst charts, and their ability to display multiple layers of information in a single chart. Bear in mind they may not always be the optimal chart for displaying this sort of data, especially in a static chart.

The folks at Saiku promise a lot more to come, and based on the heretofore swift evolution of the product, I have little reason to doubt them. Remember, if you wish to play with this yourself, simple login at VBP Lab, using the credentials labuser/user to access the tool.

FacebooktwitterlinkedinrssFacebooktwitterlinkedinrssby feather
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmailby feather


Ken Cherven is the Founder and Curator of the website. He loves to merge baseball data with all sorts of visualization methods - charts, network graphs, maps, etc. to provide greater insight into underlying data patterns. Ken also authors books about baseball and visualization, and loves to listen to jazz while drinking some wine, craft beer, or bourbon.