Skip to content

lizraeli/covid-19-us

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netlify Status

Coverage Status

Table Of Contents

Covid-19 Data in the US

This project allows viewing cases of Covid-19 in the US, in a US state, or in a county within a state. This project uses the NY Times Covid-19 Data. The data is hosted in the following CSV files:

Note: As of March 24, 2013, the NY Times no longer collects data on Covid-19.

Libraries

This project is written using typescript and Create React App along with the following libraries:

The Data

The shape of the NY-Times data as follows:

date: string;
cases: number;
deaths: number;
date: string;
state: string;
cases: number;
deaths: number;
  • U.S. County-Level Data:
date: string;
state: string;
county: string;
cases: number;
deaths: number;

Narrowing by state and county

Once the state-level data has been parsed, it is grouped by state:

{
    state1: data[],
    state2: data,
    ...
}

Once the county-level data has been parsed, it is grouped by county and by state in a tree-like structure:

{
    state1: {
        county1: data[],
        county2: data[]
    },
    state2: {
        county3: data[],
        county4: data[]
    },
    ...
}
  • When no state is selected, the data for the entire US is displayed.

  • When a state is selected in the state dropdown:

    • The data for that state is displayed.
    • The state is looked-up in the state-county dictionary. If it is found, all counties grouped under that state are displayed in the county dropdown.
  • When a county is selected in the county dropdown, the data for that county is displayed.

Viewing Modes

The view dropdown allows to view case data in 4 modes:

  • Total Cases - this is the default view
  • New Cases - calculated for each day based on [cases on day] - [case on previous day]
  • Total Deaths
  • New Deaths - calculated using the same method as New Cases

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

yarn test:coverage

Launches the test runner and generates test coverage in the terminal.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

About

View cases of Covid-19 for the US, by state or by county

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published