aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2020-11-16 20:22:44 -0500
committerGalen Guyer <galen@galenguyer.com>2020-11-16 20:22:44 -0500
commit298b4827e484c38f6d9d464872220df041d9e756 (patch)
tree0ca9c299f030945b886d0b7209e609250799a9b9
parent071632e2bee59d64b4d196ed3512af7f24c6b994 (diff)
swap to graph for positive test rate
-rw-r--r--src/App.js8
-rw-r--r--src/MainPage.js2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/App.js b/src/App.js
index 77d9a41..87e8010 100644
--- a/src/App.js
+++ b/src/App.js
@@ -35,12 +35,12 @@ function App() {
const lastUpdate = DateTime.fromSQL(latest.last_updated, { zone: "UTC" }).setZone(local);
const priorUpdate = DateTime.fromSQL(prior.last_updated, { zone: "UTC" }).setZone(local);
let positiveCases = [];
- for (let i = 1; i < data.length; i++) {
+ for (let i = 5; i < data.length; i++) {
positiveCases.push({
date: data[i].last_updated,
value: (
- ((data[i].total_students - data[i - 1].total_students) * 100) /
- (data[i].tests_administered - data[i - 1].tests_administered)
+ ((data[i].total_students - data[i - 5].total_students) * 100) /
+ (data[i].tests_administered - data[i - 5].tests_administered)
).toFixed(1),
});
}
@@ -158,7 +158,7 @@ function App() {
/>
</Route>
<Route path="/positivetests">
- <HistoryTable name="Positive Tests" data={positiveCases} />
+ <History name="Positive Test Rate (Over One Week)" data={positiveCases} />
</Route>
<Route path="/beds">
<History
diff --git a/src/MainPage.js b/src/MainPage.js
index 4ec9cb4..6ca3b04 100644
--- a/src/MainPage.js
+++ b/src/MainPage.js
@@ -122,7 +122,7 @@ const MainPage = (props) => {
name="Positive Test Rate"
latest={positiveTestRate + "%"}
diff={priorPositiveTestRate + "%"}
- link="/"
+ link="/positivetests"
/>
</div>
</div>