From e9b9cd2cd88e453a3a35cf3f672ba965660b9ff2 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Wed, 31 Aug 2022 12:31:25 -0400 Subject: Update the dashboard with a message about the lack of any dashboards --- src/pages/Graph.jsx | 107 ---------------------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 src/pages/Graph.jsx (limited to 'src/pages/Graph.jsx') diff --git a/src/pages/Graph.jsx b/src/pages/Graph.jsx deleted file mode 100644 index 0d18fab..0000000 --- a/src/pages/Graph.jsx +++ /dev/null @@ -1,107 +0,0 @@ -import { DateTime } from "luxon"; -import { - BarChart, - Bar, - LineChart, - Line, - CartesianGrid, - XAxis, - YAxis, - Tooltip, - ReferenceLine, - ReferenceDot, - ResponsiveContainer, - Label, -} from "recharts"; -import "./Graph.css"; - -const Graph = (props) => { - const { name, response, dataKey, timeDifference } = props; - const { data, loading, error } = response; - - if (loading) { - return
; - } - - const eventStyle = { fill: "#767676" }; - - const parsed = data.map((d) => { - return { - date: DateTime.fromSQL(d["last_updated"], { zone: "UTC" }).setZone(DateTime.local().zoneName).toSeconds(), - value: d[dataKey], - }; - }); - - const latest = parsed[parsed.length - 1]; - const prior = parsed[parsed.length - 2] - const toTheMoon = latest.value > prior.value + 1; - - return ( -
-
{name}
- 600 ? 750 : window.innerWidth * 0.9} - height={500} - margin={{ top: 15, right: 30, left: 0, bottom: 5 }} - data={parsed} - > - - - - {} - - {toTheMoon ? ( - 🚀} - /> - ) : null} - } - height={90} - /> - - - -
- ); -}; - -const CustomizedAxisTick = ({ x, y, payload }) => { - return ( - - - {DateTime.fromSeconds(payload.value).toLocaleString()} - - - ); -}; - -const CustomTooltip = ({ active, payload, label }) => { - if (active) { - return ( -
-

- {DateTime.fromSeconds(label).toLocaleString({ weekday: "long", month: "long", day: "2-digit" })} -

-

{payload[0].value}

-
- ); - } - return null; -}; - -export default Graph; -- cgit v1.2.3