A simple dashboard for COVID-19 case counts
Hi! I'm Ryan Moore, NBA fan & PhD candidate in Eric Wommack's viral ecology lab @ UD. Follow me on Twitter!
I made a simple COVID-19 dashboard that lets you compare the confirmed case counts for multiple counties as well as viewing the raw counts and the counts per 100,000 people. It plots the case counts over time for as many counties as you want to compare and lets you download the resulting chart. Here is an example for Delaware’s three counties:
Being a Delaware resident, I like to pretend everyone already knows everything about Delaware, but just in case you don’t, here you go: New Castle county is in the north and has Wilmington (our largest city) and Newark, home of the Univesity of Delaware. Kent county is in the middle and has Dover (the state capitol), and Sussex county is in the south with Lewes and all the beaches. It’s interesting to see the differences between New Castle and Kent counties, which look pretty similar to one another, and Sussex county. At some point, I would like to overlay some demographic or socio-economic data on this to look for any trends, but that’s for a different day.
The data
The COVID-19 case data is from the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University. Their data is aggregated from a ton of different sources and I encourage you to check out their GitHub page for more information about the data. If you’re interested, they have an article in the Lancet talking about the data and their dashboard. Of course, their dashboard has a lot more bells and whistles than mine!
For the county level population info, I used data from the Atlas of Rural and Small-Town America from the USDA Economic Research Service. It is a really cool and in-depth county level dataset. In addition to the population data, you can find info about jobs, income, veterans and more. They also have a nice interactive map to view everything county-by-county. If you want to download and remix the data yourself, it is all available in CSV and Excel format on their site.
One thing to note is that the county level population data is mostly from 2019 estimates. So, while weighting the case counts by the population data gives a nice way to compare COVID-19 cases across counties, just keep in mind that the population estimates are from last year.
The code
If you’re interested in the source code for the dashboard, you can find it on my GitHub page.
It is an Elm app. I haven’t used Elm much before this project, but it was very easy to get started with. The documentaion was awesome and the Elm Slack channel is full of helpful people. I think having some experience in Rust and Clojure helped me feel right at home using Elm. Elm seems a bit like a gateway to PureScript or Haskell, so I’m thinking of checking those out as well.
The charts are made with Vega-Lite, a nice tool for data visualization based on Vega and the Grammar of Graphics. It’s declarative, in that you write JSON specifications and Vega-Lite compiles the spec to Vega and Vega’s runtime hadles rendering the chart. To generate the Vega-Lite specs, I used this Elm package in conjunction with Elm ports.
If you enjoyed this post, consider sharing it on Twitter and subscribing to the RSS feed! If you have questions or comments, you can find me on Twitter or send me an email directly.
← Go back