Skip to main content

Local Authority Covid-19 Dashboard

It has been quite the year for data and dashboards. In the months following the start of the first lockdown in the UK we have created UK-wide graphs and timelines of COVID-19 data (now deprecated as data changed) as well as a series of Local Authority hex maps to visualise COVID-19-related data. These timelines and choropleth maps give a quick national - sometimes UK, sometimes England, sometimes England & Wales - view of Local Authority-level data relating to the pandemic. But every visualisation has its strengths and weaknesses.

Back in the summer, we were asked to make a West-Yorkshire-specific covid-19 dashboard to make it easy to see an overview specifically for West Yorkshire.The aim was to show quick summary statistics for each of the five local authorities. The data we had available at local authority level are the daily/cumulative confirmed cases by specimen date from Public Health England's API and weekly death statistics from the ONS. We decided to keep it fairly simple and stick with mostly numbers in panels. And a couple of simple graphs to show trends.

However, once we'd made a dashboard for West Yorkshire we inevitably had people asking for versions for Greater Manchester and North Yorkshire, so we made it customisable. As Public Health England gradually improved coverage of their API, we've been able to show local authorities from Northern Ireland, Scotland and Wales too (at least for cases, if not deaths).

Customise which local authorities you'd like to show.

Coding it up

The dashboard is some fairly basic HTML, CSS and Javascript. We have some code that runs twice a day that grabs the latest data from PHE (for each Local Authority), the latest ONS death data, and the latest restrictions published by the House of Commons Library. The code generates SVG graphs of cases for every UK Local Authority and updates JSON summary files for each Local Authority. For instance, the Leeds JSON file looks like this:

{
	"name":"Leeds",
	"population": 795565,
	"restrictions":{
		"src": "https://visual.parliament.uk/research/visualisations/coronavirus-restrictions-map/",
		"updated": "2020-11-24T08:22:45Z",
		"url": {"local":"","national":"https://www.gov.uk/guidance/new-national-restrictions-from-5-november"},
		"local": {},
		"national": {
			"alcoholsalesrestrictions": true,
			"businessclosures": true,
			"raves": true,
			"socialgatherings": true,
			"stayinghome": true
		}
	},
	"deaths":{
		"src": "https://download.beta.ons.gov.uk/downloads/datasets/weekly-deaths-local-authority/editions/time-series/versions/6.csv",
		"updated": "2020-11-24",
		"all": 6520,
		"cov": 922,
		"weeks":[
			{"txt":"Week 46","all":171,"cov":58},
			{"txt":"Week 45","all":159,"cov":54},
			{"txt":"Week 44","all":161,"cov":41},
			.
			.
			.
		]
	},
	"cases": {
		"src":"https://api.coronavirus.data.gov.uk/v1/data?filters=areaType=ltla;areaCode=E08000035&structure=%7B%22date%22:%22date%22,%22areaName%22:%22areaName%22,%22areaCode%22:%22areaCode%22,%22newCasesBySpecimenDate%22:%22newCasesBySpecimenDate%22,%22cumCasesBySpecimenDate%22:%22cumCasesBySpecimenDate%22,%22cumCasesBySpecimenDateRate%22:%22cumCasesBySpecimenDateRate%22%7D&format=json",
		"updated":"2020-11-24T19:41:32Z",
		"type":"SpecimenDate",
		"n": 270,
		"days":[
			{"date":"2020-11-23","day":9,"tot":34485},
			{"date":"2020-11-22","day":150,"tot":34476},
			{"date":"2020-11-21","day":186,"tot":34326}
			.
			.
			.
		]
	}
}

And the graph looks like this:

The dashboard looks at the query string to find out which local authorities have been selected and then loads the appropriate JSON and SVG files from our server. Those files are also available to be re-used elsewhere so please let us know if you do.