University Rankings visualized

Using the Guardian UK university 2014 rankings to demonstrate, here's how to mashup a few bits and pieces to visualize them. This is pretty generalized, so can be applied to any data set with fairly minimal changes.

I'll be using these technologies and concepts, all of which have been covered in some way on this site. 
Thanks to Tony Hirst, where I first saw this dataset on his oUseful blog.

The app

Here's a screenshot, you can also try it live below


You can find it here, and embedded below. The data is spread across many Google Docs Spreadsheets so it takes a while to load.


Loading the data

The source data is a Google Workbook with about 50 tabs. In this implementation we have to first get the schema for the workbook. 


This will tell us what worksheets to retrieve, along with the variety of fetch URL needed to get the data in a format suitable for input to a Google Visualization DataTable- which allows us to retrieve each sheet as follows.


The entire thing is orchestrated through jQuery promises. What's interesting about this is that we can kick off retrieving all 40+ sheets at the same time, as you can see from the log below




and throttled with exponential backoff


The visualization

One benefit of retrieving the data as google Vizualization DataTables, is the that the visualization (a scatter chart) is a breeze

Simply use a selector with values that correspond to the column number in the source table, and create a view with those selected columns from the underlying datatable. Since each sheet is treated separately, there is no need for them to be in the same format or even have the same columns - the selectors and viz are completely data driven.

The code

Here is the whole thing.

For help and more information join our forum,follow the blog or follow me on twitter .

You want to learn Google Apps Script?

Learning Apps Script, (and transitioning from VBA) are covered comprehensively in my my book, Going Gas - from VBA to Apps script, available All formats are available now from O'Reilly,Amazon and all good bookshops. You can also read a preview on O'Reilly

If you prefer Video style learning I also have two courses available. also published by O'Reilly.
Google Apps Script for Developers and Google Apps Script for Beginners.



For help and more information join our forumfollow the blogfollow me on twitter
Comments