Visualizing ECDC’s COVID-19 data

The ECDC (European Centre for Disease Prevention and Control) is providing world-wide data on Coronavirus infections and deaths.

The data format changed a couple of times, beginning with date-stamped Excel files (.xlsx), then .csv files.  then the column names  and as of today, no more .xlsx files are provided.

(I initially tried to analyze the .xlsx files with SheetJS, but always got the error message

Cannot find file [Content_Types].xml in zip

which I could not solve, therefore switching from .xlsx to .csv).

As file hosting moved to opendata.ecdc.europa.eu, column names changed (at least in the .csv), and the date has been removed from the filename.

So I started out with a little pen on CodePen.io (data as of March 25), consisting of loading data from .csv, selecting countries of interest, and the kind of data to be displayed in a Chart.js chart:

  • Number of cases, or number of deaths
  • Count per day (as directly from the data files); total sum per day; and change in cases per day, optionally averaged over a number of days

After experimenting with the pen, I exported it and created the full HTML page containing the original pen, and adjusting a couple of things.

Next, I created a Scheduled Task to fetch the latest ECDC data and store the file on the webserver. (Originally I had a problem with fetching the file directly in Javascript because the webserver did not provide a Access-Control-Allow-Origin header)

You can find the most current version of my Covid visualization on my website.

2 thoughts on “Visualizing ECDC’s COVID-19 data

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.