From 223baecd2196a92e86daf475e499c02a66a754b9 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Sat, 14 Nov 2020 14:35:10 -0500 Subject: add links to all stats --- src/App.js | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/Card.js | 25 +++++++++++--------- src/History.js | 17 +++++++++++--- src/MainPage.js | 49 +++++++++++++++++++++++++++++++------- 4 files changed, 141 insertions(+), 23 deletions(-) diff --git a/src/App.js b/src/App.js index b1d1dd1..ea5fcc9 100644 --- a/src/App.js +++ b/src/App.js @@ -58,6 +58,79 @@ function App() { })} /> + + { + return { value: d.total_staff, date: d.last_updated }; + })} + /> + + + { + return { value: d.new_students, date: d.last_updated }; + })} + /> + + + { + return { value: d.new_staff, date: d.last_updated }; + })} + /> + + + { + return { value: d.quarantine_on_campus, date: d.last_updated }; + })} + /> + + + { + return { value: d.quarantine_off_campus, date: d.last_updated }; + })} + /> + + + + { + return { value: d.isolation_on_campus, date: d.last_updated }; + })} + /> + + + { + return { value: d.isolation_off_campus, date: d.last_updated }; + })} + /> + + + { + return { value: d.tests_administered, date: d.last_updated }; + })} + /> + + + { + return { value: d.beds_available, date: d.last_updated }; + })} + /> + diff --git a/src/Card.js b/src/Card.js index 5710881..626cec0 100644 --- a/src/Card.js +++ b/src/Card.js @@ -1,4 +1,5 @@ import React from "react"; +import { Link } from "react-router-dom"; import "./Card.css"; const Card = (props) => { @@ -8,17 +9,19 @@ const Card = (props) => { } return (
-

- - {props.latest} - {props.suffix}{" "} - - - ({diff} - {props.suffix}) - -

-

{props.name}

+ +

+ + {props.latest} + {props.suffix}{" "} + + + ({diff} + {props.suffix}) + +

+

{props.name}

+
); }; diff --git a/src/History.js b/src/History.js index 1fd39a3..c559d83 100644 --- a/src/History.js +++ b/src/History.js @@ -1,6 +1,17 @@ import { React, PureComponent } from "react"; import { DateTime } from "luxon"; -import { LineChart, Line, CartesianGrid, XAxis, YAxis, Tooltip, ResponsiveContainer, Label } from "recharts"; +import { + BarChart, + Bar, + LineChart, + Line, + CartesianGrid, + XAxis, + YAxis, + Tooltip, + ResponsiveContainer, + Label, +} from "recharts"; const History = (props) => { const offset = DateTime.fromSQL(props.data[0].date, { zone: "UTC" }).setZone(DateTime.local().zoneName).toSeconds(); @@ -10,7 +21,7 @@ const History = (props) => { date: DateTime.fromSQL(d.date, { zone: "UTC" }).setZone(DateTime.local().zoneName).toSeconds(), }; }); - + return ( <>

{props.name}

@@ -21,7 +32,7 @@ const History = (props) => { margin={{ top: 15, right: 30, left: 20, bottom: 5 }} data={data} > - + {

Total Positive Cases Since August 19 (First Day of Classes)

- - + +

New Positive Cases From Past 14 Days

- - + +

@@ -30,8 +35,18 @@ const MainPage = (props) => { to see if they become sick.
- - + +

@@ -41,15 +56,30 @@ const MainPage = (props) => { Isolation separates sick people with a contagious disease from people who are not sick.
- - + +

Number of Tests Administered by Student Health Center

- +

@@ -61,6 +91,7 @@ const MainPage = (props) => { latest={latest.beds_available} prior={prior.beds_available} suffix="%" + link="/beds" /> -- cgit v1.2.3