diff --git a/imports/ui/Overview.jsx b/imports/ui/Overview.jsx index 970e268..950ad93 100644 --- a/imports/ui/Overview.jsx +++ b/imports/ui/Overview.jsx @@ -5,6 +5,8 @@ import {SensorDataCollection, ActiveDeviceCollection, ConfiguredDevicesCollectio import {useTracker} from 'meteor/react-meteor-data'; import { Col, Form, Row, Card, CardDeck } from "react-bootstrap"; import moment from 'moment' +import { scaleLog } from 'd3-scale'; +const scale = scaleLog().base(Math.E); export default function Overview() { const activeDevice = useTracker(() => { @@ -37,7 +39,15 @@ export default function Overview() { } const getLabelFromStamp = (x) => { - return moment(x.timestamp).format("HH:mm"); + return moment(x.timestamp).format("LLLL"); + // return moment(x.timestamp).format("HH:mm"); + } + + const brightnessMapper = (x) => { + if (x.brightness < 1) { + x.brightness = 0.1 + } + return x; } if ((sensorData.length <= 0)) { @@ -112,7 +122,7 @@ export default function Overview() { el.temperature !== null)} margin={{top: 50, right: 50, bottom: 20, left: 5}}> - + @@ -124,7 +134,7 @@ export default function Overview() { el.humidity !== null)} margin={{top: 50, right: 50, bottom: 20, left: 5}}> - + @@ -135,12 +145,12 @@ export default function Overview() { - el.brightness !== null)} margin={{top: 50, right: 50, bottom: 20, left: 5}}> + el.brightness !== null).map(brightnessMapper)} margin={{top: 50, right: 50, bottom: 20, left: 5}}> - - - + + Math.round(val)} /> + Math.round(val)}/> @@ -150,7 +160,7 @@ export default function Overview() { el.moisture !== null)} margin={{top: 50, right: 50, bottom: 20, left: 5}}> - +