aboutsummaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2022-08-31 12:31:25 -0400
committerGalen Guyer <galen@galenguyer.com>2022-08-31 12:31:25 -0400
commite9b9cd2cd88e453a3a35cf3f672ba965660b9ff2 (patch)
treedf34e0aa8ffbc51fc14cbb1065437ba87e7b490f /src/pages
parent3ce7ae5c53705c213b293bb7bca833b066c14d6a (diff)
Update the dashboard with a message about the lack of any dashboards
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/Graph.css33
-rw-r--r--src/pages/Graph.jsx107
-rw-r--r--src/pages/Index.css24
-rw-r--r--src/pages/Index.jsx106
4 files changed, 52 insertions, 218 deletions
diff --git a/src/pages/Graph.css b/src/pages/Graph.css
deleted file mode 100644
index 8cb98ee..0000000
--- a/src/pages/Graph.css
+++ /dev/null
@@ -1,33 +0,0 @@
-.Title {
- font-size: 2em;
- margin-top: 24px;
-}
-
-.ToTheMoon {
- -webkit-animation-duration: 0.5s;
- animation-duration: 0.5s;
- -webkit-animation-delay: 1.5s;
- animation-delay: 1.5s;
- -webkit-animation-fill-mode: both;
- animation-fill-mode: both;
- -webkit-animation-name: fadeIn;
- animation-name: fadeIn;
-}
-
-@-webkit-keyframes fadeIn {
- 0% {
- opacity: 0;
- }
- 100% {
- opacity: 1;
- }
-}
-
-@keyframes fadeIn {
- 0% {
- opacity: 0;
- }
- 100% {
- opacity: 1;
- }
-}
diff --git a/src/pages/Graph.jsx b/src/pages/Graph.jsx
deleted file mode 100644
index 0d18fab..0000000
--- a/src/pages/Graph.jsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import { DateTime } from "luxon";
-import {
- BarChart,
- Bar,
- LineChart,
- Line,
- CartesianGrid,
- XAxis,
- YAxis,
- Tooltip,
- ReferenceLine,
- ReferenceDot,
- ResponsiveContainer,
- Label,
-} from "recharts";
-import "./Graph.css";
-
-const Graph = (props) => {
- const { name, response, dataKey, timeDifference } = props;
- const { data, loading, error } = response;
-
- if (loading) {
- return <div></div>;
- }
-
- const eventStyle = { fill: "#767676" };
-
- const parsed = data.map((d) => {
- return {
- date: DateTime.fromSQL(d["last_updated"], { zone: "UTC" }).setZone(DateTime.local().zoneName).toSeconds(),
- value: d[dataKey],
- };
- });
-
- const latest = parsed[parsed.length - 1];
- const prior = parsed[parsed.length - 2]
- const toTheMoon = latest.value > prior.value + 1;
-
- return (
- <div>
- <div className="Title">{name}</div>
- <LineChart
- style={{ marginLeft: "auto", marginRight: "auto" }}
- width={window.innerWidth > 600 ? 750 : window.innerWidth * 0.9}
- height={500}
- margin={{ top: 15, right: 30, left: 0, bottom: 5 }}
- data={parsed}
- >
- <Line type="monotone" dataKey="value" stroke="#CD8508" dot={false} />
- <ReferenceLine
- x={1644594525}
- label={{ value: "Visitor Policy adjusted", angle: -90, style: eventStyle, position: "left" }}
- />
- <ReferenceLine
- x={1647550274}
- label={{ value: "Mask Mandate dropped", angle: -90, style: eventStyle, position: "left" }}
- />
- {}
- <CartesianGrid strokeDasharray="3 3" />
- {toTheMoon ? (
- <ReferenceDot
- x={latest["date"]}
- y={latest["value"]}
- r={0}
- label={<Label className="ToTheMoon">🚀</Label>}
- />
- ) : null}
- <XAxis
- dataKey="date"
- type="number"
- tickCount={14}
- domain={["dataMin", "dataMax"]}
- tick={<CustomizedAxisTick />}
- height={90}
- />
- <YAxis dataKey="value" type="number"></YAxis>
- <Tooltip content={CustomTooltip} />
- </LineChart>
- </div>
- );
-};
-
-const CustomizedAxisTick = ({ x, y, payload }) => {
- return (
- <g transform={`translate(${x},${y})`}>
- <text className="Graph-Label" x={0} y={0} dy={16} textAnchor="end" fill="#666" transform="rotate(-40)">
- {DateTime.fromSeconds(payload.value).toLocaleString()}
- </text>
- </g>
- );
-};
-
-const CustomTooltip = ({ active, payload, label }) => {
- if (active) {
- return (
- <div className="custom-tooltip bg-white border-orange-300 border-2 rounded-lg p-2">
- <p className="label">
- {DateTime.fromSeconds(label).toLocaleString({ weekday: "long", month: "long", day: "2-digit" })}
- </p>
- <p className="desc">{payload[0].value}</p>
- </div>
- );
- }
- return null;
-};
-
-export default Graph;
diff --git a/src/pages/Index.css b/src/pages/Index.css
index c134449..128a71b 100644
--- a/src/pages/Index.css
+++ b/src/pages/Index.css
@@ -2,27 +2,3 @@
margin-top: 24px;
font-size: 1.4em;
}
-
-@media screen and (max-width: 600px) {
- .Message {
- display: none;
- }
-}
-
-.Section .Title {
- text-align: center;
- font-size: 1.6em;
- flex-basis: 100%;
- margin-top: 48px;
-}
-
-@media screen and (max-width: 600px) {
- .Section .Title {
- margin-top: 12px;
- }
-}
-
-.Cards {
- display: flex;
- justify-content: center;
-}
diff --git a/src/pages/Index.jsx b/src/pages/Index.jsx
index 7f196e0..5e4c788 100644
--- a/src/pages/Index.jsx
+++ b/src/pages/Index.jsx
@@ -1,62 +1,60 @@
-import Card from "../components/Card";
import "./Index.css";
-const Index = (props) => {
- const response = props.response;
- if (response.loading) {
- return <div>Loading...</div>;
- }
-
- const data = response.data;
+const Index = () => {
+ return (
+ <div className="Message">
+ <h2>2022-2023 Dashboard</h2>
+ <p>
+ RIT is not providing a COVID dashboard for the 2022-2023 semester. As such, I have no source for any
+ data to update this dashboard.
+ </p>
+ <p>
+ At the beginning of the semester, <a href="https://rit.edu/ready">rit.edu/ready</a> claimed that a new
+ dashboard would be published, as visible in{" "}
+ <a className="BlueLink" href="https://web.archive.org/web/20220802081911/https://www.rit.edu/ready/">
+ this snapshot taken August 2nd on archive.org
+ </a>
+ . However, that was removed sometime between August 15th and August 31st, as seen in{" "}
+ <a className="BlueLink" href="https://web.archive.org/web/20220831160558/https://www.rit.edu/ready/">
+ this snapshot taken August 31st.
+ </a>{" "}
+ The updated site did claim "The level of COVID RNA found in this week’s wastewater samples is slightly
+ higher than last spring".
+ </p>
- const latest = data[data.length - 1];
- const prior = data[data.length - (1 + props.timeDifference)];
+ <p>
+ There is a{" "}
+ <a class="BlueLink" href="https://pawprints.rit.edu/?p=3546">
+ PawPrints petition to restore the COVID dashboard
+ </a>{" "}
+ so students can see the current level of risk. If you're concerned about RIT's handling of the pandemic,
+ you should sign this! Unless RIT gives us the dashboard back, we have no visiblity into how many cases
+ there are on campus.
+ </p>
- return (
- <div>
- <div>
- <div className="Message">
- This dashboard has been refreshed for the new semester. Historical data from the 2020-2021 school
- year is available at <a href="//2020.ritcoviddashboard.com">2020.ritcoviddashboard.com</a>. Data
- from the Fall 2021 semester is available at{" "}
- <a href="//2021.ritcoviddashboard.com">2021.ritcoviddashboard.com</a>.
- </div>
- </div>
- <div className="Section" id="total">
- <div className="Title">Total Positive Cases Since January 10 (First Day of Classes)</div>
- <div className="Cards">
- <Card
- name="Students"
- link="/totalstudents"
- latest={latest["total_students"]}
- diff={latest["total_students"] - prior["total_students"]}
- />
- <Card
- name="Staff"
- link="/totalstaff"
- latest={latest["total_staff"]}
- diff={latest["total_staff"] - prior["total_staff"]}
- />
- </div>
- </div>
+ <hr />
- <div className="Section" id="new">
- <div className="Title">New Positive Cases From Past 14 Days</div>
- <div className="Cards">
- <Card
- name="Students"
- link="/newstudents"
- latest={latest["new_students"]}
- diff={latest["new_students"] - prior["new_students"]}
- />
- <Card
- name="Staff"
- link="/newstaff"
- latest={latest["new_staff"]}
- diff={latest["new_staff"] - prior["new_staff"]}
- />
- </div>
- </div>
+ <h3>Prior Dashboards</h3>
+ <p>
+ The dashboards from the last two years are still online. I'll be keeping them up indefinitely so
+ everyone can see RIT's handling of the pandemic.
+ </p>
+ <p>
+ The dashboard for the 2020-2021 school year is available at{" "}
+ <a className="BlueLink" href="https://2020.ritcoviddashboard.com/">
+ 2020.ritcoviddashboard.com
+ </a>
+ </p>
+ <p>
+ The dashboard for the 2021-2022 school year is available at{" "}
+ <a className="BlueLink" href="https://2021.ritcoviddashboard.com/">
+ 2021.ritcoviddashboard.com
+ </a>
+ </p>
+ <p>
+ If you would like the raw data I've collected, or have any questions, concerns, or comments, please
+ reach out to me at <a href="mailto:gkg1648@rit.edu">gkg1648@rit.edu</a>
+ </p>
</div>
);
};