Putting statistics online

4 02 2010

We have a statistics website at work with an enormous amount of statistics available for PDF download.  I like PDF downloads.  But.  Just to get a table of statistics, a user has to click through 5 layers of navigation!  The menu, sub menu, sub sub menu, sub sub sub menu…. you see?  It’s not really ideal – all that just to get a downloadable PDF, which usually opens up in an annoying new window as well.

The sub menu navigation on the site is basically like choosing a statistics category, and graph metrics.  So, I figure it’s got to be cleaner if we move to some sort of online graphing tool, right?  We could have a single page even, where a form (or cascading forms) refresh the graph and it’s metrics as you click.  All in one spot, tidy and neat, and fun.  It’d also be easy to have a tab for table-view for people who don’t like graphs.

There’s a lot of problems to overcome before I can start though.  I wrote a report for my boss, just to itemise what we’d need to consider, to move to online graphing.  The stuff below is a part of the report.  If anyone out there has any wonderful ideas about the best way to go, please let me know.  I’m mostly interested in how to get the data in to XML (from excel) in an automated way; and how to conceptualise heavily layered statistics in to graphical break downs.  Is all this a good idea?

As a start I actually did a tiny prototype using the free tool SWF/XML Charts.  It’s a good tool, easy to use, looks reasonable to the eyes – and most of all it was easy to flex in to something more powerful, with a bit of php, ajax and jquery.  I had it set up to work really well – the forms refreshed the graph on the fly; the table view read the same XML file as the Flash graphing tool, and transformed it in to a HTML table (in the table tab).  It was so dynamic and I loved it as a basic prototype – but I’m just not sure of the best next step yet.

Example graphing prototype

It worked really well - there was one tricky part though, the tabs loaded content with jquery ajax and if you changed the forms whilst in table view (for example) the graph view didn't refresh because it didn't exist. Luckily it was fairly straight forward to fix with some callback methods in the ajax call.

Oh, and another tip – the tool hated having symbols parsed in the URL for the xml data source. So my ajax table loading might be like this:  (all these variables are actually values from the form, and the events are triggered by changing the form)
$("#Table").load("tableContent.php?data=TrendData_MainIntake" + "&graph=" + graph + "&category=" + category);

But the url variable in the script that loaded the flash graphing tool had to be like this, using hex values in the path:
url = "graphContent.php%3Fdata%3DTrendData_MainIntake" + "%26graph%3D" + graph + "%26category%3D" + category + "%26type%3D" + type;

It’s fun getting all this stuff to work. I hope it turns in to an excellent project, a small part of my report is as follows if you’re interested.
Read the rest of this entry »





Media-rich Learning Guide

6 11 2009

We had this little problem last year – we really wanted SOMETHING to do an online study/learning guide with.. well not just ‘something’, we wanted it to be media rich in that it is not just visually appealing but allowed all sorts of GUI features (like popups, tabs etc) so that it could have more media-rich content.

The reason at the time was because the course we were working on had SO many resources, from all over the place, and we thought it might be a good thing to bring everything together, in to context.  (and to make it look nice).

I started thinking of ideas for a GUI and realised one of my favourite interfaces would have to be iTunes!  The interface is called cover flow and it’s visually delicious to say the least.

iTunes coverflow

This is the iTunes coverflow GUI, nice hey?

As it turned out, after some searching the net for Flash resources, I found this awesome Open Source Initiative Flash-based cover flow project.  The beauty of it, like the beauty of iTunes, is it basically gets all its data from an XML file.  So that got me thinking.

What if the learning guide was entirely in XML?  Well, why not.  You could request a course code in your web browser, a php page could parse your request to Flash, which then loads the XML learning guide menu in coverflow, and voila, ajax the content in to the page with each click in the flash cover-flow!

I modified the Flash-based coverflow to suite our purpose.  I made the initial course trial static, in that the content was being loaded from html files, and the course-specific XML only contained details on the course topics and titles etc.  Now however I’m working on the full deal, the entire learning guide in XML.  It’s all coming together rather nicely.

HLG

We've nick-named it the HLG (hypertextual learning guide). You select your study module from the coverflow menu, and all the content loads below via ajax. The content sits in the course XML, and the XSL handles the rendering of all the variations in that content. This example has some readings, but there could also be videos, podcasts, all sorts of stuff.

Learning XSL has been a highlight of the last week, I’m still quite a noob at it, but so far I’ve done some awesome things – I can handle all sorts of variations in the XML (which means variations in content) and render it on the page nicely – videos come up with a video icon and use the jQuery prettyBox plugin, documents come up with a document icon, abstracts have the abstract viewable via a jQuery clueTip plugin.. its all coming together.

The setup

I have some more work to do with the XML/XSL, but I think it will all go well. At the end of it, I'll basically have a single php file, that takes course code requests.. the page will talk to a library of standard resources like the images in the cover-flow menu, the background images, css, and javascripts. It'll then talk to the requested XML (via a php transform and XSL file) to get all the details and content.

Phase 3 will be doing an administration interface, to manage the XML.. ohh fun.