Week Beginning 16th July 2018

I returned to work this week after two and a bit weeks off on holiday.  Monday this week was a bank holiday so it was a four-day week for me, and in actual fact I worked these four days over the past two weeks whilst I was away.  Despite this I managed to get quite a lot done, although I possibly ended up working more than my required four days.  Over the course of my holiday I dealt with a number of smaller issues that staff had contacted me about.  This included some Apple developer account duties, mainly setting up user accounts to allow someone in Computing Science to create apps, sorting out adding support for ‘markdown’ syntax to the SPADE website, responding to some queries from Chris McGlashan about some old websites, talking to Luca Guariento about possible job opportunities and the DH2018 conference that Luca attended, and responding to a query about the DSL website for Rhona Alcorn.  I also had a chat with Marc about office arrangements.  I’m apparently being booted out of 13 University Gardens sometime later on in the summer and will be given an office somewhere else around University Gardens.  I’ll just need to see how that works out.

Other than these matters I worked on three projects during these four days: DSL, Historical Thesaurus and SCOSYA.  For DSL Thomas Widmann had been in touch to say that the DSL theme I’d created for the WordPress powered version of the DSL website that is currently in development was not allowing nested menus that were more than two levels deep.  The issue is the DSL WordPress theme I created was purely a WordPress version of the existing DSL website interface, and this only has two levels of menu, top and sub.  It doesn’t support any additional levels of nesting.  Therefore, when such nesting is specified in WordPress the theme doesn’t know how to handle this.

I spent a bit of time looking at how the theme handles menus and I managed to get things sorted, mostly by updated the CSS for my menus.  Sub-menus now appear with an indent on the left.  It is actually now possible to have any number of nested sub-menus, each of which will be indented from the previous level, although I wouldn’t recommend having too many sub-menus as things will look too cluttered.  Whilst fixing the menus I noticed a couple of other issues with the WordPress version of the DSL website.  Firstly, some of my JavaScript was set to work on specific pages based on page URL (e.g. the ‘more’ and ‘less’ buttons).  When page locations have been updated these parts no longer worked.  I’ve fixed this, making the JavaScript check for elements on any page rather than only on specific pages.  Secondly, the breadcrumbs and highlighted menu items also depend on the page URL.  If a page is moved to a different menu item but the URL isn’t changed then the breadcrumbs and selected menu item will be wrong.  Thankfully this is something that can easily be sorted through the Admin interface, but it’s something the people doing the restructuring needed to be made aware of.

For the Historical Thesaurus I continued to work on the timeline visualisation on the search results page.  The first thing I sorted out was adding in links from the visualisation to the categories listed.  This wasn’t particularly straightforward to do as you can’t just put HTML links into an SVG and expect them to work.  Instead I updated the timeline data to incorporate the catid of the maincat (or subcat) each word belongs to and updated the JavaScript to pull in this and generate a link to the corresponding category page.  The SVG was set to not allow pointer events (e.g. clicks) so as to allow the timeline popup to scroll when the cursor was over the SVG.  This meant that clicking on a word’s label in the SVG was doing nothing.  I’ve over-ridden the pointer events setting for the labels now, so clicking now works, but be aware that scrolling the timeline with a scrollwheel / trackpad will not work if the cursor is positioned over a label.

I’d noticed that for words in subcategories only the maincat heading was being displayed in the visualisation, so I updated this to include both maincat heading and subcat heading.  However, this did mean that more text bleeds into the timeline area, which Marc didn’t like very much.  I wondered whether the full category information could instead appear in a tooltip, and Fraser suggested truncating the heading after a certain number of characters so as to avoid the text bleeding into the visualisation.  I implemented this, adding in ellipsis where the labels were too long.  However, I didn’t add a tooltip to the labels as these already have a click action on them (opening the category) and I decided that adding a tooltip would confuse matters, especially as we’re using ‘on click’ tooltips elsewhere in the visualisation and we’d have to use ‘hover-over’ here.  Also ‘hover-over’ doesn’t work on touchscreens.  However, I don’t think we actually need tooltips on the labels, as the full title is already available in the tooltip for the visualisation bar / spot.  Click on a bar / spot and you get to see the full title, which I think works ok, as you can see from the following screenshot:

Also for the HT, Fraser wanted me to run a query that would identify and export all of the OED lexemes that are marked as ‘revised’ but don’t currently match an HT lexeme.  The last time I looked at the HT / OED data was in October last year so it took a little time to get my head round the data again.  Once I had familiarised myself with it I managed to run a query that extracted the data for 18,939 unmatched but revised lexemes.

For SCOSYA I continued to work on the group statistics feature for the atlas.  By the end of the week I’d managed to implement pretty much everything that I had included in my specification document for the feature. This includes showing and hiding groups on the map, editing a group (allowing the group name and the locations to be edited) and deleting a group.  I also updated the attribute search so that when a new search is executed the visible group remains selected.

I then added in a new pane that slides out for the statistics.  If you press a group’s ‘Statistics’ button the new section slides out from the left.  Initially it only contained the group name and a list of the locations in the group.  I decided to use a ‘slide out pane’ option rather than a pop-up so that things still work when the map is set to full screen.  If I’d used a pop-up the map would have exited out of full screen when you press on the ‘statistics’ button.  It’s taken some time to get the pane working properly as the slide-out menu plugin I’m using didn’t include facilities to programmatically open the menu (i.e. on button press), so I had to extend the plugin’s functionality.  But with the pane working I could then begin work on the most important matter: generating statistics about the group.  I had intended to do all this on the server side, and then pull the content in via an AJAX call, but I realised that I needed to access the search results, which were already being held in the JavaScript for the page.  For this reason it seemed to make sense to process everything on the client side.  I updated the statistics pane to include the total number of ratings, the mean, median and mode, plus the standard deviation.  I also used the HighCharts library, which I was already using elsewhere, to generate a bar chart showing the distribution of ratings.  I’m pretty pleased with how it’s all working and here’s a screenshot showing how it works:

The only issue seems to be related to scalability.  I had only been working with groups of 3-10 locations whereas Gary had created a group that featured all locations.  He reported problems accessing the stats with larger groups, so I’ll need to look into this next week, and also add in features to download the data.