Hi, my name is Josep Garcia-Reyero and I am the Open-Source Development intern for the summer, which means I get to help re-develop the Mapping of Accused Witches of Scotland site – welcome to my first blog post!

I am a Mathematics student at the University of Edinburgh, going into my fourth year of study and although I study maths, I started developing an interest for programming several years ago. While a lot of my experience has been in Python and data analysis, during lockdown I started to learn Vue.js (a front-end JavaScript framework), and I found it very rewarding because I was actually creating tangible things for people to use and see.

When I learned about the Mapping of Accused Witches of Scotland project I found it to be very interesting and meaningful; and since it was written in Vue, being able to contribute to it in helping to improve the site was a very appealing opportunity for me.

My role and goals for the summer

Over the summer, in general terms, I am going to be re-factoring the current code for the website, improving the functionality and user interface of the site and incorporating the new visualisations that Maggie, the Scottish Witchcraft Data Visualisation Intern, comes up with.

First days as an intern

My first few days were largely marked by familiarising myself with the project and the already existing code, and upgrading the packages that it used to their latest version. It took me a while to understand the code and it felt somewhat overwhelming at times, but with the help of Richard, the developer of the site, I eventually managed to familiarise myself with everything.

The code that I found was very much practical and functional given the needs of the project back in 2019, and the incredibly short time that Richard had to develop it. However, once I understood it, I came up with a few re-factoring suggestions, which mainly involved splitting things up into re-usable components to reduce repeated code and improve structure.

Essentially, my idea was to have a map component and a filtering component to be used in all the Leaflet map pages (Leaflet is one of the libraries we use for mapping). Richard liked my suggestions and gave me green light to implement them, but before I could start coding, I first had to upgrade the packages.

Upgrading the packages

Upgrading the packages that the code used proved to be trickier than expected, and I only finished it on the Monday of Week 2. Actually applying the upgrades was simple enough, the problem was that when I did so the icons on the map became really big, which they weren’t supposed to do.

In order to fix this, I had to roll back the upgrades to find out which package was causing the issue, and then fix it. The package turned out to be Leaflet itself, and knowing this I then I managed to find a fix to bring the accused witch icons back to their normal size.

Re-factoring

As of now, I have recently finished the first fully working version of my re-factoring. Once again, it took longer than I expected. The first main issue that I encountered was that in order to have a component that literally just receives a list with accused witch markers and plots them, I had to change up the filtering. This was because the accused witch icons are colour coded differently depending on the filtering option that the user is applying.

Therefore, my filtering had to take care of this and change the icons of the markers every time the user switches between filtering options, to then be able to pass the markers on to the mapping component which literally just plots them. There were a few other things I had to take into account when filtering, like accounting for mixed markers that might stop being mixed after a filter is applied.

During the re-factoring, I dealt with many more small issues and did lots of de-bugging, but I eventually managed to get the components working, and I applied them to all the Leaflet map pages. In the process I also slightly changed up the way in which we filter to hopefully make it a bit faster, which also entailed adapting the data structure for the filters to make everything work nicely together.

Once everything was done, I realised there was one more factor to take into account. On the current website we group accused witches by clusters in some of the Leaflet maps that have a lot of accused witches. This makes them more interpretable and less crowded. However, this is only the case for a few pages, there’s some that don’t use clusters, but my re-factoring was applying clusters on all pages. In order to fix this, I took the opportunity to add a new functionality feature that had been discussed in Week 1, which was being able to turn clusters on and off on all pages.

Functionality improvements

In Week 1 Maggie and I had a meeting with Ewan McAndrew, our manager, and Professor Julian Goodare in order to come up with our goals for the project. Professor Julian Goodare is a historian and project director for the original Survey of Scottish Witchcraft, so his input and suggestions were extremely valuable to us.

The main improvements are to do with the filters and timeline of Leaflet pages. We decided that we are going to move the filters to the side of the page (still having the option to hide them), which will make more space for the map. We might also add a search bar and allow the user to filter by more than one filter option at the same time.

Then, we are going to try to make the timeline more responsive, and add it to all Leaflet pages. This might allow us to visualise panics on the map, which is one of the things Professor Julian Goodare suggested, and I personally think it would be extremely cool and intersting if we were able to pull it off.

On a side note, at the moment we have two residence pages: one with clusters and one without clusters but with timeline; thus with the option of turning clusters on and off and with timelines on all pages, we will only need one residence page. On top of all this, there are a few other minor improvements we have come up with to improve the user interface.

Moving forward

On the next few days, I am going to implement a new filtering method I have discussed with Richard which should make the filtering even faster – it is currently still a bit slow – but once this is done I will continue to implement the rest of the new features we have come up with for the site.

Then, once I finish everything, I will starting adding Maggie’s new visualisations to the page, which will be the final and most important improvement!