Skip to content

Commit efea882

Browse files
committed
Remove dust levels from Charts
1 parent 9eb8e4e commit efea882

1 file changed

Lines changed: 0 additions & 77 deletions

File tree

webclient/src/Charts.js

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@ import moment from 'moment-timezone';
77
let memberCountCache = false;
88
let signupCountCache = false;
99
let spaceActivityCache = false;
10-
let classroomDustLevelCache = false;
11-
let woodshopDustLevelCache = false;
1210

1311
export function Charts(props) {
1412
const [memberCount, setMemberCount] = useState(memberCountCache);
1513
const [signupCount, setSignupCount] = useState(signupCountCache);
1614
const [spaceActivity, setSpaceActivity] = useState(spaceActivityCache);
1715
const [fullActivity, setFullActivity] = useState(false);
1816
const [fullSignups, setFullSignups] = useState(false);
19-
const [classroomDustLevel, setClassroomDustLevel] = useState(classroomDustLevelCache);
20-
const [woodshopDustLevel, setWoodshopDustLevel] = useState(woodshopDustLevelCache);
2117

2218
useEffect(() => {
2319
requester('/charts/membercount/', 'GET')
@@ -46,24 +42,6 @@ export function Charts(props) {
4642
.catch(err => {
4743
console.log(err);
4844
});
49-
50-
requester('https://ps-iot.dns.t0.vc/sensors/air/0/pm25/week', 'GET')
51-
.then(res => {
52-
setClassroomDustLevel(res.result);
53-
classroomDustLevelCache = res.result;
54-
})
55-
.catch(err => {
56-
console.log(err);
57-
});
58-
59-
requester('https://ps-iot.dns.t0.vc/sensors/air/1/pm25/week', 'GET')
60-
.then(res => {
61-
setWoodshopDustLevel(res.result);
62-
woodshopDustLevelCache = res.result;
63-
})
64-
.catch(err => {
65-
console.log(err);
66-
});
6745
}, []);
6846

6947
return (
@@ -386,61 +364,6 @@ export function Charts(props) {
386364

387365
<p>Retained Count: number of those signups who are still a member currently.</p>
388366

389-
390-
<Header size='medium'>Protodust Level</Header>
391-
392-
<p>Averaged every 15 minutes for the past week. They are cheap sensors so don't trust the absolute value of the readings.</p>
393-
394-
<p>
395-
{classroomDustLevel && woodshopDustLevel &&
396-
<>
397-
<ResponsiveContainer width='100%' height={300}>
398-
<LineChart data={classroomDustLevel} syncId={1}>
399-
<XAxis dataKey='time' tickFormatter={(t) => moment(t).format('ddd h:mm a')} minTickGap={10} />
400-
<YAxis domain={[0, 60]} />
401-
<CartesianGrid strokeDasharray='3 3'/>
402-
<Tooltip formatter={v => v.toFixed(2) + ' μg/m³'} labelFormatter={t => 'Time: ' + moment(t).format('ddd h:mm a')} />
403-
<Legend />
404-
405-
<Line
406-
type='monotone'
407-
dataKey='value'
408-
name='Classroom PM2.5'
409-
stroke='#2185d0'
410-
strokeWidth={2}
411-
dot={false}
412-
animationDuration={250}
413-
/>
414-
</LineChart>
415-
</ResponsiveContainer>
416-
417-
<ResponsiveContainer width='100%' height={300}>
418-
<LineChart data={woodshopDustLevel} syncId={1}>
419-
<XAxis dataKey='time' tickFormatter={(t) => moment(t).format('ddd h:mm a')} minTickGap={10} />
420-
<YAxis domain={[0, 60]} />
421-
<CartesianGrid strokeDasharray='3 3'/>
422-
<Tooltip formatter={v => v.toFixed(2) + ' μg/m³'} labelFormatter={t => 'Time: ' + moment(t).format('ddd h:mm a')} />
423-
<Legend />
424-
425-
<Line
426-
type='monotone'
427-
dataKey='value'
428-
name='Woodshop PM2.5'
429-
stroke='#82ca9d'
430-
strokeWidth={2}
431-
dot={false}
432-
animationDuration={250}
433-
/>
434-
</LineChart>
435-
</ResponsiveContainer>
436-
</>
437-
}
438-
</p>
439-
440-
<p>Classroom PM2.5: Amount of PM2.5 particles measured from the classroom ceiling. Units are μg/m³.</p>
441-
442-
<p>Woodshop PM2.5: Amount of PM2.5 particles measured from the woodshop ceiling. Units are μg/m³.</p>
443-
444367
</Container>
445368
);
446369
};

0 commit comments

Comments
 (0)