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/add chart zoom to quartz energy #502

Open
wants to merge 92 commits into
base: india-mvp
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
0acc778
new nextjs app initial commit
braddf Feb 8, 2024
fa1cc72
add logo; fix build type errors
braddf Feb 8, 2024
7badd4c
add OCF greys from design files; fix config
braddf Feb 12, 2024
2a2ce9a
add initial apiClient, types, data fetching, chart
braddf Feb 15, 2024
55dcdd0
update title
braddf Feb 15, 2024
c9ca9d9
fix linting errors
braddf Feb 15, 2024
1ffb239
update api to proxied quartz route
braddf Feb 15, 2024
c3ad49c
Switch wind/solar on graphs, solar on bottom
braddf Feb 15, 2024
d60c3b4
update icons and add wide sidebar
rachel-labri-tipton Feb 13, 2024
4813c9f
add narrow sidebar styling
rachel-labri-tipton Feb 13, 2024
8c4953f
adjust container width
rachel-labri-tipton Feb 13, 2024
6d01ff5
adding sidebar components
rachel-labri-tipton Feb 14, 2024
bb7a37e
add mini-cards for collapsed sidebar
rachel-labri-tipton Feb 15, 2024
28c59a8
move left arrow to the right of sidebar
rachel-labri-tipton Feb 15, 2024
4ff90b4
fix text color
rachel-labri-tipton Feb 19, 2024
5698d10
sidebar with card and minicard components
rachel-labri-tipton Feb 19, 2024
6b38c6e
fix linting errors
rachel-labri-tipton Feb 19, 2024
f5c9bf1
fix linting for time label:
rachel-labri-tipton Feb 19, 2024
23f10ae
fix type error in card component
rachel-labri-tipton Feb 19, 2024
66549ae
Amend corrected forecast to display MW
braddf Feb 19, 2024
a5b20cf
Round generation values down to minute
braddf Feb 19, 2024
e10c81a
Flip and sort formatted Chart data
braddf Feb 21, 2024
448dec1
resample generation to 15 minutes
peterdudfield Feb 21, 2024
fd3a319
run prettier
peterdudfield Feb 21, 2024
af07e58
role back
peterdudfield Feb 21, 2024
d8febf1
adjust schema
peterdudfield Feb 21, 2024
6217b0f
use query object
peterdudfield Feb 21, 2024
58af4b5
Merge branch 'issue/generation-15-mins' into india-mvp
peterdudfield Feb 21, 2024
437ccd6
Add now reference line in Indian Standard Time
braddf Feb 21, 2024
6decc48
Merge remote-tracking branch 'origin/india-mvp' into india-mvp
braddf Feb 21, 2024
464af46
split past/future forecast and style
braddf Feb 23, 2024
19eec0c
seeing if pre-commit runs
rachel-labri-tipton Feb 19, 2024
3972d18
adding actual data to SideBar
rachel-labri-tipton Feb 19, 2024
d35c0a0
adding data to the sidebar
rachel-labri-tipton Feb 22, 2024
11e6bed
pushing work for pair code session
rachel-labri-tipton Feb 26, 2024
2ceb92a
format axes ticks & add label
braddf Feb 27, 2024
e63d335
add check for chartData timestamp
braddf Feb 27, 2024
89a18e5
format tooltip
braddf Feb 27, 2024
404c13a
sidebar with actual data
rachel-labri-tipton Feb 28, 2024
9a2dca1
fix chart linting errors
rachel-labri-tipton Feb 28, 2024
0c87d4a
format tooltip nulls; show null gaps charts
braddf Feb 28, 2024
64f406d
Merge branch 'india-mvp' into issue/data-for-sidebar
rachel-labri-tipton Feb 28, 2024
4a2a003
Merge pull request #476 from openclimatefix/issue/data-for-sidebar
braddf Feb 28, 2024
4f36cf4
Add legend; refactor into components
braddf Mar 5, 2024
3b89293
adding actual data to SideBar
rachel-labri-tipton Feb 19, 2024
eff954a
add chevron buttons to sidebar
rachel-labri-tipton Mar 4, 2024
3253f91
fix type error in icon file
rachel-labri-tipton Mar 4, 2024
41bf794
add global state for showing and hiding lines
rachel-labri-tipton Mar 4, 2024
1cd3e60
add working toggle to turn lines on and off
rachel-labri-tipton Mar 5, 2024
66cbffd
add toggles to cards and mini-cards
rachel-labri-tipton Mar 7, 2024
efcfe2c
add energyTag to card
rachel-labri-tipton Mar 7, 2024
b951469
Rebase onto india-mvp; remove old Charts file
braddf Mar 7, 2024
8323381
Specify createGlobalState return type explicitly
braddf Mar 7, 2024
031120e
Merge pull request #478 from openclimatefix/issue/add-sidebar-button-…
rachel-labri-tipton Mar 7, 2024
d26d5d5
adding actual data to SideBar
rachel-labri-tipton Feb 19, 2024
743a083
add global state again for toggle
rachel-labri-tipton Mar 7, 2024
4bb5417
remove old Charts file
rachel-labri-tipton Mar 7, 2024
487bf06
fix duplication error
rachel-labri-tipton Mar 7, 2024
5dee8ce
Merge pull request #480 from openclimatefix/issue/add-global-state-to…
rachel-labri-tipton Mar 7, 2024
004e129
Add combined tooltip vals; style changes
braddf Mar 8, 2024
8560c92
Update sidebar actual colors
braddf Mar 8, 2024
6b7be0e
Toggle other gen type on when none selected
braddf Mar 8, 2024
ae22103
Add temp header profile icon
braddf Mar 8, 2024
b423e70
Sidebar padding/styling
braddf Mar 8, 2024
f2ef402
Disable pointer on now label hover^
braddf Mar 12, 2024
29fe6a6
update solar generation to reflect correct value
rachel-labri-tipton Mar 12, 2024
6ba2eda
Make combinedData global; add user menu
braddf Mar 13, 2024
d7c5dc7
small fix
rachel-labri-tipton Mar 13, 2024
1b9bf15
Merge pull request #484 from openclimatefix/issue/483-verify-generati…
rachel-labri-tipton Mar 13, 2024
934c56d
Add downloadCsv function first draft
braddf Mar 15, 2024
6403256
Show/Hide toggled forecasts in tooltip
braddf Mar 20, 2024
ad8444d
Sidebar layout/styling
braddf Mar 21, 2024
0adbdf1
Fix gap in area chart
braddf Mar 21, 2024
98aa6b0
Fix CSV & amend format/filename
braddf Apr 4, 2024
b35c002
Fix overflow horizontal scroll bug
braddf Apr 4, 2024
47b70bc
Add day name x axis
braddf Apr 4, 2024
bc17f74
Solid now line
braddf Apr 4, 2024
b16815a
Sidebar: GW -> MW
braddf Apr 5, 2024
30291b5
mini sidebar number format
braddf Apr 5, 2024
cd8c25f
amend csv: KW -> MW
braddf Apr 5, 2024
4737c56
fix chart data bug(s) and now gap; add test
braddf Apr 5, 2024
d162743
fix build error(s)
braddf Apr 5, 2024
c5aca1b
fix nowcasting build error(s)
braddf Apr 5, 2024
ed11954
No data label in tooltip
braddf Apr 5, 2024
9fa5268
Add refetch param
braddf Apr 8, 2024
c8070e0
move wind below solar in sidebar
peterdudfield Mar 22, 2024
915e423
Dynamic ordering in tooltip values
braddf Apr 11, 2024
fb16b16
Merge pull request #495 from openclimatefix/swap-solar-and-wind-sidebar
braddf Apr 11, 2024
e0c3622
filter chart data
rachel-labri-tipton Apr 12, 2024
e6d6c25
select data to zoom in on
rachel-labri-tipton Apr 15, 2024
93949dc
zoom feature works
rachel-labri-tipton Apr 17, 2024
5362ce1
final changes for zoom
rachel-labri-tipton Apr 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules
.turbo
build/**
dist/**
.next/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { theme } from "../../../tailwind.config";
import { ClockIcon } from "../../icons/icons";
import ForecastLabel from "../../national_forecast_labels";
Expand Down Expand Up @@ -140,6 +139,7 @@ export const NextForecast: React.FC<{ pv: string; tip: string; time: string; col
};

type ForecastHeaderProps = {
children: React.ReactNode;
forecastNextPV: string;
forecastPV: string;
actualPV: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { CloseButtonIcon, DownArrow, UpArrow } from "../../icons/icons";
import { ForecastHeadlineFigure } from "../forecast-header/ui";
import { DeltaHeaderBlock } from "../delta-view/delta-header-block";
import React, { FC } from "react";

type ForecastHeaderGSPProps = {
title: string;
Expand All @@ -14,9 +14,10 @@ type ForecastHeaderGSPProps = {
forecastPV?: string;
forecastNextTimeOnly?: string;
forecastNextPV?: string;
children?: React.ReactNode;
};

const ForecastHeaderGSP: React.FC<ForecastHeaderGSPProps> = ({
const ForecastHeaderGSP: FC<ForecastHeaderGSPProps> = ({
title,
deltaView,
deltaValue,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { FC } from "react";
import RemixLine from "../remix-line";
import useFormatChartData from "../use-format-chart-data";
import {
Expand All @@ -12,6 +11,7 @@ import useGetGspData from "./use-get-gsp-data";
import useGlobalState, { get30MinNow, getNext30MinSlot } from "../../helpers/globalState";
import Spinner from "../../icons/spinner";
import { ForecastValue } from "../../types";
import React, { FC } from "react";

// We want to have the ymax of the graph to be related to the capacity of the GspPvRemixChart
// If we use the raw values, the graph looks funny, i.e y major ticks are 0 100 232
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { CloseButtonIcon } from "../../icons/icons";

type ForecastHeaderSiteProps = {
Expand Down
1 change: 1 addition & 0 deletions apps/nowcasting-app/components/delta-forecast-label.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type DeltaForecastLabelProps = {
children: React.ReactNode;
tip: string | React.ReactNode;
position?: "left" | "right" | "middle";
className?: string;
Expand Down
4 changes: 2 additions & 2 deletions apps/nowcasting-app/components/helpers/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ describe("check getOpacityValueFromPVNormalized with valid values", () => {
describe("check convertISODateStringToLondonTime", () => {
test("check convertISODateStringToLondonTime with valid date strings", () => {
expect(convertISODateStringToLondonTime("2021-01-01T03:00:00.000Z")).toBe("03:00");
expect(convertISODateStringToLondonTime("2021-01-01T03:21:00.000")).toBe("03:21");
expect(convertISODateStringToLondonTime("2021-01-01T03:50:11")).toBe("03:50");
expect(convertISODateStringToLondonTime("2021-01-01T03:21:00.000Z")).toBe("03:21");
expect(convertISODateStringToLondonTime("2021-01-01T03:50:11Z")).toBe("03:50");
});

it("should handle an empty date string", () => {
Expand Down
4 changes: 3 additions & 1 deletion apps/nowcasting-app/components/icons/logo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const OCFlogo = () => (
import { FC } from "react";

export const OCFlogo: FC = () => (
<a
className="max-h-full z-20"
href="https://www.openclimatefix.org/"
Expand Down
1 change: 1 addition & 0 deletions apps/nowcasting-app/components/map/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export enum SelectedData {
}

export interface IMap {
children: React.ReactNode;
loadDataOverlay: any;
controlOverlay: any;
bearing?: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type ForecastLabelProps = {
children: React.ReactNode;
tip: string | React.ReactNode;
position?: "left" | "right" | "middle";
className?: string;
Expand Down
3 changes: 2 additions & 1 deletion apps/nowcasting-app/components/side-layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { useState } from "react";
import { useState } from "react";
import ExpandButton from "./expand-button";
import useGlobalState from "../helpers/globalState";

type SideLayoutProps = {
children: React.ReactNode;
className?: string;
dashboardModeActive?: boolean;
bottomPadding?: boolean;
Expand Down
3 changes: 1 addition & 2 deletions apps/nowcasting-app/components/tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";

type TooltipProps = {
children: React.ReactNode;
tip: string | React.ReactNode;
position?: "left" | "right" | "middle" | "top";
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/nowcasting-app/dist/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions apps/nowcasting-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"js-cookie": "^3.0.5",
"mapbox-gl": "^2.8.2",
"next": "^12.0.7",
"openapi-fetch": "^0.7.6",
"openapi-fetch": "^0.9.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-hooks-global-state": "^1.0.2",
Expand Down Expand Up @@ -53,7 +53,8 @@
"@types/js-cookie": "^3.0.3",
"@types/leaflet": "^1.7.9",
"@types/mapbox-gl": "^2.7.2",
"@types/react": "^17.0.38",
"@types/react": "^18",
"@types/react-dom": "^18.2.24",
"autoprefixer": "^10.4.7",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.5",
Expand Down
36 changes: 36 additions & 0 deletions apps/quartz-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
3 changes: 3 additions & 0 deletions apps/quartz-app/OLDeslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions apps/quartz-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Binary file added apps/quartz-app/app/favicon.ico
Binary file not shown.
33 changes: 33 additions & 0 deletions apps/quartz-app/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
}
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}
30 changes: 30 additions & 0 deletions apps/quartz-app/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import Header from "../src/components/layout/Header";
import Providers from "@/app/providers";
import { ReactNode } from "react";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Quartz Energy | Rajasthan",
description: "Solar and Wind Forecasting Service",
};

export default function RootLayout({
children,
}: Readonly<{
children: ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>
<Providers>
<Header />
{children}
</Providers>
</body>
</html>
);
}
Loading