Week Beginning 9th September 2019

I spent most of this week continuing to work on the Experts Atlas for the SCOSYA project, focussing primarily on implementing an alternative means of selecting attributes that allows attributes to be nested in two levels rather than just one.  Implementing this has been a major undertaking as basically the entire attribute search was built around the use of drop-down lists (HTML <select> lists with <optgroups> items for parents and <option> items for attributes).  Replacing this meant replacing how the code figures out what is selected, how the markers and legend are generated, how the history feature works and how the reloading of an atlas based on variables passed in the URL works.  It took the best part of a day and a half to implement and it’s been pretty hellish.

The two levels of nesting rely on how the code parent is recorded in the CMS.  Basically if you have two parts of a code parent separated by a space, a dash and a space ‘ – ‘ then the Experts Atlas will treat the part before the dash as the highest level in the hierarchy and the part after as another level down.  So ‘AFTER-PREFECT’ is just one level whereas ‘AGREEMENT – MEASURES’ is two levels – ‘AGREEMENT’ as the top level and ‘MEASURES’ as the second.

In the Atlas I’ve replaced the drop-down list with a scrollable area that contains all of the top level code parents, each with a ‘+’ icon.  Press on one of these and an area will scroll down containing either the attributes or the second-level parent headings.  If it’s the latter, press on one of these to open it and see the attributes.  You can press on a heading a second time to hide the contents.

Each attribute is listed with its code, title and description (if available).  Clicking on an attribute will select it, and the details will appear in a ‘Selected Attribute’ section underneath the scrollable area.  In this initial version everything else about the attribute search was the same as before, including the option to add another and supply limit options.  I Also decided against replacing the ‘Age’ and ‘Rated by’ drop-down lists with buttons as I’m a bit worried about having too many similar looking buttons.  E.g. if the ‘rated by’ drop-down list was replaced by buttons 1-4 it would look very similar to the ‘score’ option’s 1-5 buttons which could get confusing.  Also, although the new attribute selection allows nesting of attributes, allows descriptions to be more easily read and allows us to control the look of the section (as opposed to an HTML select element which has its behaviour defined by the web browser) it does take up more space and might actually be less easy to use.  The fixed height of it feels quite claustrophobic when using it, it’s more difficult to just see all of the attributes, and once the desired attribute has been selected it feels like the scrollable area is taking up a lot of unnecessary space.  We’ll maybe need to see what the feedback is like when people use the atlas.

After a bit of further playing around with the interface I decided to make the limit options always visible, which I think works better and doesn’t take up much more vertical space.  I’ve moved the ‘Show’ button to be in line with the ‘add another’ button and have relabelled both ‘Show on map’ (with magnifying glass icon) and ‘Add another attribute’.  moved the ‘remove’ button when multiple attributes are selected to the same line as the Boolean choices, which saves space and works better.  Here’s a screenshot of the new attribute select feature:

I then started working on the final Experts Atlas feature: the group statistics.  I added in an option for loading in the set of default groups that E had created previously.  If you perform an attribute search and then go to the Group Statistics menu item you can now press one or more ‘Highlight’ button to highlight the group.  There are 5 different highlight colours (I can change these or add more as required) and they cycle through, so if you don’t like one you can keep clicking to find one you like.  The group row is given the highlight colour as a background to help keep track of which group is which on the map.  Highlighting works for all attribute search types but doesn’t work for the ‘Home’ map as it depends on contents of the pop-ups to function and the ‘Home’ map has no popups.  Pressing on the ‘Statistics’ button opens up a further sliding panel and functions in the same way as the stats in the CMS Atlas, listing the attributes, giving stats for each and displaying a graph of individual score frequency.  The following screenshot shows a map with highlighting and the stat panel open:

I noticed there were some issues with the stats panel staying open and displaying data that was no longer relevant when other menus were opened.  I therefore fixed things to ensure that statistics and highlighting are removed when navigating between menus (but highlighting remains when changing an attribute search so you can more easily see the effect on your highlighted locations).  I also fixed a bug in the statistics when ‘young’ or ‘old’ were selected that meant the count of ratings was not entirely accurate.  In doing so I uncovered the issue with 11 questionnaires being of people that were too young to be ‘old’, which was causing problems for the display of data.  Changing the year criteria in the API has fixed that.

I spent the rest of my time on the project working on the facilities to allow users to make their own groups.  This should now be fully operational.  This uses HTML5 LocalStorage, which is a way of storing data in the user’s browser.  No data relating to the user’s chosen locations or group name is stored on the server and no logging in or anything is required to use the feature.  However, data is stored in the user’s browser so if they use a different browser they won’t see their groups.  Also, they need to have HTML5 LocalStorage enabled and supported in their browser.  It is supported by default in all modern browsers so this shouldn’t be an issue for most people.  If their browser doesn’t support it they simply won’t see the options to save their own groups.

If you open the group statistics menu, above the default groups is a section for ‘My saved groups’.  If you click on the ‘create a group’ button you can create a group in the same way as you could in the CMS atlas – entering a name for your group and clicking on map markers to add a location (or clicking a second time to remove one).  Once the ‘Save’ button is pressed your group will appear in the list of saved groups, and you will be able to highlight the markers and view statistics for it as you can with the default groups.  There are also options to delete your group (there is currently no confirmation for this – if you press the button your group is immediately deleted) and edit your group, which returns you to the ‘create’ view but pre-populated with your data.  You can rename your group or change the selected markers via this feature.  I think that’s pretty much everything I needed to implement for the Experts Atlas, so next week I’ll press on with the facility to allow certain users to download the full dataset.  Here’s a screenshot of the ‘My Groups’ feature:

Also this week I spent a bit of time on the Glasgow Medical Humanities website for Gavin Miller.  This is due to go live in the next few weeks so I focussed on the last things that needed implemented.  This included migrating the blog data from the old MHRC blog, which I managed to do via WordPress’s own import / export facilities.  This worked pretty well, importing all of the text, the author details and the categories.  The only thing it didn’t do was migrate the media, but Gavin has said this can be done manually as required so it’s not such a big deal.  I also met with the project administrator on Friday to talk through the site and the CMS and discuss some of the issues she’d been encountering in accessing the site.  I also found out a way of exporting the blog subscribers from the MHRC site so Gavin can let them know about the new site.  I also created new versions of the ‘Spotlight on…’ and ‘Featured images’ from the old Medical Humanities site.  I created these as WordPress widgets, meaning they can be added to any WordPress page simply by adding in a shortcode.  I based the featured image carousel on Bootstrap, which includes a very nice carousel.  Currently I’ve added both features to the bottom of the homepage, but these can easily be moved elsewhere.  Here’s an example of how they look:

Other than the above I got into a discussion with various people across the University about a policy for publishing apps, responded to a request for help with audio files from Rob Maslen, had a chat with Gerry McKeever about the interactive map he wants to create for his project, spoke to Heather Pagan about the Anglo-Norman Dictionary data, helped Craig Lamont make some visual changes to the Editing Burns blog, replied to a query from Marc Alexander about how dates might be handled differently in the Historical Thesaurus, and had an email conversation with Ann Ferguson about the DSL bibliographical data.