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.
This project is written using typescript and Create React App along with the following libraries:
- Papaparse - for parsing CSV files in the browser.
- Apex Charts and React-ApexChart - for displaying data charts.
- React Select - for rendering nicely styled select components.
- react-loader-spinner - for the SVG spinner component.
- Moment.js - for parsing dates and filtering data by start date.
- Lodash - for mapping and rearranging the parsed CSV data.
- React Testing Library and React Hooks Testing Library for testing.
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;
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.
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
In the project directory, you can run:
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.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Launches the test runner and generates test coverage in the terminal.
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.