Skip to content

Zoooook/CoronavirusTimelapse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Click any of the .mp4 files and then Download to watch the videos. I try to keep them relatively up to date. EDIT: I may not worry about updating these in the future, as NYTimes data is not terribly accurate, meaning they are only using the date of reporting by the state, and not adjusting it for date of discovery or date of death.

This script uses county-level New York Times data to build timelapse videos for various metrics of the Coronavirus spread across the U.S., using a map format modified from an old version of their page. New York City dominates the non-Per-Capita maps because the New York Times combines the 5 boroughs into a single mega-county.

The data of course only represent confirmed cases and deaths, not true cases and deaths. The areas of the circles are proportional to the number of people represented, although the scale differs between different videos. With default parameters, a given number of deaths will produce a circle with twice the radius or 4 times the area the same number of cases would in the same category. The script uses a rolling average to smooth out values in the Daily video types. It uses linear interpolation to transition between days.

To run this locally you'll need ffmpeg and the Chrome driver on your path, and Chrome installed in the default location. It renders individual frames in html, and takes a few hours to run the first time with default settings. On subsequent runs it only updates frames with diffs, which will happen when new data is published and when older data is revised. It should be safe to kill the script while it's working and then start it again later, without losing progress.

Comment out lines in videoTypes to skip generating particular videos. Change the scale attribute for each video to adjust the size of the circles. The startDate parameter does what it says. Change casesLookbackDays and deathsLookbackDays to change how wide the rolling average is for the Daily video types. Change framesPerDay and daysPerSecond to change how smoothly and how fast the video runs (the product of these values gives frames per second). The script will remember images that it has previously generated, so it should take about the same amount of time to generate a video at 2 frames per day as it will to increase the resolution to 4 frames per day. However, with default parameters, it uses around 50G of storage.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published