Week Beginning 3rd November 2014

It’s hard to believe we’re into November already – scary stuff.  Anyway, on with the weekly report: My time this week was mostly devoted to Mapping Metaphor duties, although I had to spend roughly 1.5 days on AHRC duties reviewing more Technical Plans –  they just keep coming in.

On Monday we had a Mapping Metaphor team meeting, which was useful to participate in, as always.  Other than that I continued with development duties.  I’ve now implemented the bulk of the updates to the visualisations that are on my ‘to do’ list and I’ve started to move on to some of the other items (e.g. metaphor cards).  I’ll return to some of the outstanding items in the visualisation part of my list at a later date.

Last week I started to implement little rectangular markers to differentiate L3 categories and L2 categories in the ‘hybrid’ view, and I continued with this work this week.  These markers also now appear as a means of identifying L3 categories in other views too (e.g. when viewing all the L3 connections between two L2 categories or when viewing the L3 categories connected to either / both selected L3 categories).  I also updated the ‘Download SVG’ option so that the exported SVGs reflect these changes too.

I was originally intending to use arcs around the circle rather than individual rectangles at each label, and this effect is given when viewing a crowded visualisation (e.g. drill down into category B and then select to expand category D), but on less populated visualisations the rectangles are quite distinct (e.g. drill down into category V and expand O).  I’m not really sure if I like how this looks or not.  The advantage of using individual rectangles as opposed to arcs (other than it being easier to implement) is that it is easy to then highlight these rectangles to make it clearer where the connections are (e.g. drill down into B, expand D then select B20 Plants).

I made some further revisions to the ‘info box’ this week.  I’ve reworked the ‘key’ again as it was adding too much clutter to the info box.  It is now a pop-up that you can move around the screen and resize.  The descriptions in the key will need some work, especially the descriptions for the purple and orange rectangles.  Having ‘categories within categories’ is rather confusing.

I’ve also begun work on implementing alternative views of the data.  In the previous version you could access a tabular view and a card view of the data when looking at a specific L3 category.  In the new version you will be able to access the data in these views (plus a timeline view too) no matter what part of the visualisation you are looking at.  I’ve added a new section to the bottom of the info-box that states which view you are looking at (e.g. ‘Visualisation’) and have added a new ‘Change view’ button.  When pressed on this opens a pop-up allowing you to select the other views.  I haven’t implemented these other views yet, but I have laid quite a bit of the foundations for these views by ensuring that data selection variables used in the Javascript to load the data into the visualisation (e.g. chosen L2 categories, selected L3 categories, expanded sections, metaphor strength) are embedded in the form that is posted whenever an alternative view is requested.   I still need to actually make these views work, plus create an updated info box that will be suitable for each view.  Once this is done I will be able to replace the existing tabular and card views with the new one and everything should integrate much more smoothly.  That’s the theory, at least.

I’ve realised that I’m going to run into a potentially sizable problem once the L2 categories are reclassified.  My code expects the L2 category to be the first character in a category ID and for the L3 category to be the first 3 characters.  If ‘D’ is being replaced by ’22’ or whatever two character code it is then everything is going to break.  There are currently 26 L2 categories with the letter of the alphabet as ID.  But after the reclassification there will be about 38 categories so a single character just isn’t going to work.  My code does a lot of processing based on the assumption that L2 category is the first character in any category ID so I’m going to have to rewrite a lot of it.  That’s not going to be a fun task.

Another sizable and not so fun task that I did manage to tick off my list this week was to refactor the code to properly separate out the PHP and the JavaScript parts.  Previously the JavaScript for the visualisation was embedded in the HTML of the page and throughout it a number of variables were being set from PHP by echoing PHP variables out within the JavaScript source code.  This allowed things to work but made the code somewhat messy.  What I really wanted to do was to get the visualisation JavaScript into its own .js file and out of the HTML source, but in order to do this I needed to untangle the PHP variables.  It was a bit time consuming but I managed to get it done and I feel a lot happier with the code now.  The JavaScript still pulls in data from PHP variables, but it does so now through PHP echoing out content into hidden HTML elements with unique IDs that the JavaScript can then pull in.  Much nicer.

Next week I will continue to implement the alternative views, plus I will need to spend some time wrapping the Scots School Dictionary app and also begin working with the HT data for the Scots Thesaurus project.