olihawkins

Weeknotes: Week 43, 2020

23 Oct 2020 17:57 GMT

I have been on leave intermittently during the last few weeks. This was my first full week back at work and so my first full weeknotes after a short break. Not everything covered here happened this week, but I would rather write about the most interesting things that happen than stick rigidly to a format.

Coronavirus restrictions map

Work on the coronavirus restrictions map has continued since it launched. The initial response was quite surprising. The map received over 100,000 unique visits in the first few days and settled down to an average of around 2,000 a day this week.

With this many people using the map we (that is me, Carl, Dan and Jenny) have felt a big responsibility to keep it as up to date and accurate as possible. It hasn't been easy, given the frequency with which new announcements have been made and the increasing complexity of the restrictions in place across the UK. I had to build more flexibility into the structure of the application so that different systems of restrictions can apply in different parts of the UK.

One unexpected piece of work was rebuilding the entire application from scratch using a different framework about a week after it launched. The map was originally built using Leaflet. However, Mapbox very kindly offered to waive the cost of our map tiles, as they were running a promotion for non-commercial maps providing public information on Covid. In return they asked if we would consider switching from using Leaflet to Mapbox GL JS as this would use their resources more efficiently. It seemed only fair to honour that request.

If you are not familiar with Mapbox GL, it's like a more powerful version of Leaflet. Mapbox GL JS is the JavaScript library for Mapbox GL, but there are also native SDKs for various operating systems. Mapbox GL gives you much more control over how your map looks and behaves than Leaflet, but you need to tell it in more detail what you want it to do. To help with this, it provides some neat declarative APIs which you can use to set the properties of different elements on the map based on the data they represent. I've used Mapbox GL JS once before, on MSOA Names, but I learned a lot more about it on this project.

One other important feature of the map that I haven't written about before is the icon set we are using for the restriction categories. The icons come from a rather wonderful open source icon set called Remix Icon. This is a general purpose collection of icons for application development. You can see a few examples of the icons in the latest national restrictions for Wales.

A screenshot of the interactive map showing coronavirus restrictions. The screenshot shows the map zoomed in on Wales to illustrate the icons used to represent the restrictions in the pop-up information box that is shown when a user clicks the map.

We've had to be quite creative in using the icons to represent different types of restrictions rather than the typical user-interface elements for which they were designed. But the collection has been comprehensive enough to meet all our needs so far.

I will never stop being grateful to the designers and coders who publish wonderful open source resources like this.

Parliamentary data

As I mentioned previously, one of my big focusses right now is developing the Library's capability for working with Parliamentary data. Noel, Elise and I have been developing a set of R packages and scripts for working with different parliamentary data sources so that we can easily download, combine and analyse the data we need for Parliamentary research.

In an ideal world this work would not have been necessary. But the pause in the development of the data platform means we need to move ahead with using the currently available sources until the project to integrate procedural data is back on track. It's coming, but it won't happen overnight.

This week Noel finished initial development work on a new R package for retrieving data from the Members Names Information Service (MNIS) called clmnis. MNIS is the system that manages Member data in Parliament. The neat thing about Noel's package is that it has exactly the same interface as the Member functions in our R and Python packages for getting Member data for the data platform. The idea is that the packages should be interchangeable so that we can switch back to using the data platform in future.

Noel and I went through some of the code together on Tuesday and I spent Wednesday working on unit tests for the package. It's still in beta for now, but we are working to make it production ready as soon as possible. I think Noel has done an amazing job. We are aiming to get colleagues to start testing it next week. And then after that we will start work on a package for the Commons and Lords votes APIs.