From 298b4827e484c38f6d9d464872220df041d9e756 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Mon, 16 Nov 2020 20:22:44 -0500 Subject: swap to graph for positive test rate --- src/App.js | 8 ++++---- src/MainPage.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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() { /> - + { name="Positive Test Rate" latest={positiveTestRate + "%"} diff={priorPositiveTestRate + "%"} - link="/" + link="/positivetests" /> -- cgit v1.2.3