Week Beginning 11th May 2015

I’m running a bit short of time this week and I will be off on holiday for the next two weeks so this may be a short report – or it may not, let’s just see how it goes. I spent the majority of this week working on the Scots Thesaurus project, continuing with the thesaurus plugin for WordPress that I had started last week. I made some really good progress with this. I created facilities to manage category lexemes and imported the lexemes relating to the ‘golf’ categories that have been created so far. Now through the WordPress admin interface when you selected the option to add or edit a thesaurus category you now have a section where you can add or edit (but not delete) category lexemes, including links to the DSL and a field for the source of the word.

I also made a lot of progress with the display of thesaurus data through the WordPress front-end. I implemented the ‘shortcodes’ for browsing up and down the thesaurus, viewing subcategories, displaying words and changing part of speech. Basically all the functionality that is available through the HTE’s ‘browse’ facility is now available through WordPress. It took a little while to get my plugin-specific styles and Javascript to work as you can’t just use the expected directory structure (e.g. you might think ‘../css’ would be a directory called ‘css’ one level up from where you are now but this just doesn’t work – instead you need to use a special WordPress ‘plugins_url()’ function. Similarly, within a Javascript file you can’t just reference images stored in a different directory. Instead you have to use a WordPress function called ‘wp_localize_script’ to tell Javascript where to find other directories.

I also created my first WordPress widget – a little bit of functionality that you can add to a section of the page that will then execute whenever the page loads. I created a widget to display a random thesaurus category, as currently happens on the homepage of the HTE site. I set this up to display in the right-hand column of the page and now it works as intended – linking to a random category and displaying up to 10 of its words.

The main reason for doing all of this WordPress integration was to allow users to post comments on categories so setting this up was my next step. I updated my custom data type to enable comments be default and set WordPress up so that users had to register in order to post comments. So far so good, but at this stage comments were just text and we wanted users to be able to post media such as images and video clips. In order to get this working a made use of a couple of plugins. The first was comment attachment (https://wordpress.org/plugins/comment-attachment/). This allows users to upload files with their comments in a number of formats that you can specify. Uploaded files get added to WordPress’s ‘media’ section and can be approved from there. It works really rather well and also ensures that WordPress attempts to embed the media in the comments rather than just displaying a link to it. E.g. if an MP3 is uploaded then an audio player is displayed rather than just linking to the file.

The next thing I wanted people to be able to do was to embed media that existed elsewhere on the net, for example YouTube clips and images in Flickr. It turns out there is a plugin for that too – oembed in comments (https://wordpress.org/plugins/oembed-in-comments/). When activated if WordPress sees a known URL in a comment (e.g. YouTube) is will display a player rather than just a link.

With all this in place I turned my attention to the visualisations again. I wanted to create some visualisations that nicely represented the hierarchical structure of the thesaurus data and decided d3.js’s ‘Sunburst’ visualisation style might work quite well for this (see http://bl.ocks.org/mbostock/4063423). I found a very nice multi-level, zoomable sunburst visualisation: http://www.jasondavies.com/coffee-wheel/ and decided to attempt to adapt this.

What I’m working on is still very much in development and is currently getting absolutely swamped with the sheer volume of data from the HTE, but I think once I put in some limits on what data gets displayed at each level it could possibly work. When my data loads the visualisation currently looks a mess due to there being too much data (this is all of the main noun categories from 02 ‘the mind’ of the HTE, which is 1278 categories). But once you start drilling down into it, it begins to look a bit better. I can’t really share the visualisation URL yet I’m afraid, but in it if you hover over a segment you can view its title and number in the bottom left, you can click on a segment to zoom in on it and click on the middle circle to zoom back out. Segments are coloured but colours are random at this point. They will eventually use colour and shade to reflect thesaurus section and hierarchical level.

I’m hoping to combine this with the hover-overs, legend and breadcrumb found in this visualisation example: http://bl.ocks.org/kerryrodden/7090426. I’m not sure how best to represent subcategories in the above visualisation style, but eventually it will be possible to switch between part of speech and to open a category to view its words and comments (and post your own comments) through the visualisation interface. Still lots to do though.

Also this week I met with Ger Malcolm from Corporate Communications to discuss the University’s iOS developer account. We’ve agreed that STELLA will take over responsibility for the annual fee associated with this and that I will become the main admin person for the account. It was great to meet Ger face to face after speaking with him by email for so long. With the help of James Matthew the subscription has now been paid so our apps will stay visible on the App Store for another year at least.

I also met with Christine Ferguson this week to talk about the technical side of a project she’s putting together and I received good news from two members of staff about bids that I’d contributed technical expertise to. I can’t go into more detail about these yet, but it’s great that these projects have been funded.

That’s all for now. I will be away for the next two weeks (well, I am working the Wednesday after next but I will be doing so from home as I always do on Wednesdays).  I guess this wasn’t a particularly short report after all!