diff --git a/imports/ui/Home.jsx b/imports/ui/Home.jsx index 94709d2..e2715cc 100644 --- a/imports/ui/Home.jsx +++ b/imports/ui/Home.jsx @@ -1,32 +1,71 @@ -import React, {useEffect, useState} from 'react' // useState to rerender the view each time something changed +import React from 'react' import {CartesianGrid, Legend, Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis} from 'recharts'; import SensorCardDeck from './SensorCardDeck' import {SensorDataCollection} from "../../client/main"; import {useTracker} from 'meteor/react-meteor-data'; +import {Col, Row} from "react-bootstrap"; export default function Home() { const sensorData = useTracker(() => { - return SensorDataCollection.find({ device_id: 'esp-andy' }, { sort: { timestamp: -1 }, limit: 10 }).fetch(); + return SensorDataCollection.find({ device_id: 'esp-andy' }, { sort: { timestamp: -1 }, limit: 10 }).fetch().reverse(); }); return ( <> - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ) } \ No newline at end of file