Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions apps/nowcasting-app/data/dno_gsp_groupings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"WPD (South West)": [
"NGED (South West)": [
1,
8,
13,
Expand Down Expand Up @@ -74,7 +74,7 @@
311,
313
],
"WPD (South Wales)": [
"NGED (South Wales)": [
3,
7,
55,
Expand Down Expand Up @@ -235,7 +235,7 @@
258,
315
],
"WPD (East Midlands)": [
"NGED (East Midlands)": [
23,
24,
66,
Expand Down Expand Up @@ -265,7 +265,7 @@
292,
316
],
"WPD (Midlands)": [
"NGED (Midlands)": [
26,
48,
49,
Expand Down
8 changes: 4 additions & 4 deletions apps/nowcasting-app/data/dno_license_areas_20200506.json
Original file line number Diff line number Diff line change
Expand Up @@ -3578,7 +3578,7 @@
},
{
"type": "Feature",
"properties": { "ID": 11, "Name": "_B", "LongName": "WPD (East Midlands)" },
"properties": { "ID": 11, "Name": "_B", "LongName": "NGED (East Midlands)" },
"geometry": {
"type": "MultiPolygon",
"coordinates": [
Expand Down Expand Up @@ -14505,7 +14505,7 @@
},
{
"type": "Feature",
"properties": { "ID": 14, "Name": "_E", "LongName": "WPD (Midlands)" },
"properties": { "ID": 14, "Name": "_E", "LongName": "NGED (Midlands)" },
"geometry": {
"type": "MultiPolygon",
"coordinates": [
Expand Down Expand Up @@ -43401,7 +43401,7 @@
},
{
"type": "Feature",
"properties": { "ID": 21, "Name": "_K", "LongName": "WPD (South Wales)" },
"properties": { "ID": 21, "Name": "_K", "LongName": "NGED (South Wales)" },
"geometry": {
"type": "MultiPolygon",
"coordinates": [
Expand Down Expand Up @@ -46208,7 +46208,7 @@
},
{
"type": "Feature",
"properties": { "ID": 22, "Name": "_L", "LongName": "WPD (South West)" },
"properties": { "ID": 22, "Name": "_L", "LongName": "NGED (South West)" },
"geometry": {
"type": "MultiPolygon",
"coordinates": [
Expand Down
8 changes: 4 additions & 4 deletions apps/nowcasting-app/data/dno_regions_lat_long_converted.json
Original file line number Diff line number Diff line change
Expand Up @@ -14246,7 +14246,7 @@
"properties": {
"ID": 11,
"Name": "_B",
"LongName": "WPD (East Midlands)"
"LongName": "NGED (East Midlands)"
},
"geometry": {
"type": "MultiPolygon",
Expand Down Expand Up @@ -57831,7 +57831,7 @@
"properties": {
"ID": 14,
"Name": "_E",
"LongName": "WPD (Midlands)"
"LongName": "NGED (Midlands)"
},
"geometry": {
"type": "MultiPolygon",
Expand Down Expand Up @@ -171992,7 +171992,7 @@
"properties": {
"ID": 21,
"Name": "_K",
"LongName": "WPD (South Wales)"
"LongName": "NGED (South Wales)"
},
"geometry": {
"type": "MultiPolygon",
Expand Down Expand Up @@ -183113,7 +183113,7 @@
"properties": {
"ID": 22,
"Name": "_L",
"LongName": "WPD (South West)"
"LongName": "NGED (South West)"
},
"geometry": {
"type": "MultiPolygon",
Expand Down
2 changes: 1 addition & 1 deletion apps/nowcasting-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openclimatefix/nowcasting-app",
"version": "0.5.8",
"version": "0.5.9",
"private": true,
"scripts": {
"dev": "next dev -p 3002",
Expand Down
10 changes: 8 additions & 2 deletions apps/nowcasting-app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export default function Home({ dashboardModeServer }: { dashboardModeServer: str
const [, setSitesLoadingState] = useGlobalState("sitesLoadingState");
const [, setLoadingState] = useGlobalState("loadingState");
const [nHourForecast] = useGlobalState("nHourForecast");
const [nationalAggregationLevel] = useGlobalState("nationalAggregationLevel");
const [nationalAggregationLevel, setNationalAggregationLevel] = useGlobalState(
"nationalAggregationLevel"
);
const [, setClickedGspId] = useGlobalState("clickedGspId");

const [forecastLastFetch30MinISO, setForecastLastFetch30MinISO] = useState(get30MinNow(-30));
Expand Down Expand Up @@ -112,11 +114,15 @@ export default function Home({ dashboardModeServer }: { dashboardModeServer: str
setArraySettingInCookieStorage(CookieStorageKeys.VISIBLE_LINES, visibleLines);
}, [visibleLines]);

// On view change, unset the clicked "GSP" if the aggregation is not GSP
// On view change, unset the clicked region if the aggregation is not GSP,
// and set the national aggregation level to GSP if we're now on Delta view
useEffect(() => {
if (nationalAggregationLevel !== NationalAggregation.GSP) {
setClickedGspId(undefined);
}
if (view === VIEWS.DELTA) {
setNationalAggregationLevel(NationalAggregation.GSP);
}
}, [view]);

const currentView = (v: VIEWS) => v === view;
Expand Down