Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show variance between days with two esp #124

Merged
merged 10 commits into from
Aug 27, 2024
4 changes: 2 additions & 2 deletions nextjs-interface/src/app/dashboard/esp/[espId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function Page({ params }: { params: any }) {
date?.from && date?.to ? differenceInDays(date.to, date.from) : 0;

return (
<div className="flex h-full w-full min-w-[500px] flex-col gap-y-5 pt-2">
<div className="flex h-full w-full flex-col gap-y-5 pt-2">
<div className="flex justify-between text-xl font-bold uppercase">
<div>{esp.name}</div>
<RenameElement id={params.espId} />
Expand Down Expand Up @@ -194,7 +194,7 @@ export default function Page({ params }: { params: any }) {
<Card className="flex justify-center rounded-xl dark:border-zinc-700 dark:bg-zinc-900">
<CardContent>
<svg
className="h-[500px] w-[500px] xl:h-[1000px] xl:w-[1000px]"
className="h-[500px] w-[500px] max-sm:h-full max-sm:w-full xl:h-[1000px] xl:w-[1000px]"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
>
Expand Down
9 changes: 8 additions & 1 deletion nextjs-interface/src/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
// import components
import DataCircle from "@/app/ui/dashboard/DataCircle";
import { useAllEsp } from "@/lib/data";
import DataGraph from "@/app/ui/dashboard/DataGraph";

export default function Page() {
const ESPList = useAllEsp();
return (
<>
<div className="px-auto grid h-fit w-full min-w-[500px] grid-cols-1 gap-10 xl:grid-cols-2 2xl:grid-cols-3">
<div>
<DataGraph />
</div>

<br />

<div className="px-auto grid h-fit w-full grid-cols-1 gap-10 xl:grid-cols-2 2xl:grid-cols-3">
{ESPList.map((esp, index) => (
<DataCircle key={index} esp={esp} />
))}
Expand Down
1 change: 0 additions & 1 deletion nextjs-interface/src/app/ui/dashboard/ChartElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ export function ChartElement({ data }: { data: avgData[] }) {
x={date}
stroke="Gray"
ifOverflow="extendDomain"
label={{ value: "Date change", position: "top", fill: "green" }}
/>
))}
</LineChart>
Expand Down
2 changes: 1 addition & 1 deletion nextjs-interface/src/app/ui/dashboard/DataCircle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function DataCircle({ esp }: { esp: any }) {
<CardTitle className="w-full border-b-2 pb-5 pt-5 text-center text-gray-800 dark:border-zinc-700 dark:text-white">
{esp.name}
</CardTitle>
<CardContent className="sm:py-auto flex h-full w-full flex-row py-14">
<CardContent className="sm:py-auto flex h-full w-full flex-row py-14 max-sm:flex-col max-sm:justify-center">
<PieChartTemperature data={temperature} />
<PieChartHumidity data={humidity} />
</CardContent>
Expand Down
Loading