From 2601f9424858caab614694fcf81ff71375c5d0e6 Mon Sep 17 00:00:00 2001 From: Luis Zenteno Date: Wed, 18 Oct 2023 14:26:41 -0600 Subject: [PATCH 1/3] feat(fires): remove MODIS Burned Areas from widgets --- components/widgets/fires/burned-area-cumulative/index.js | 4 ++-- components/widgets/fires/burned-area-ranked/index.js | 4 ++-- components/widgets/fires/burned-area/index.js | 2 +- data/fires-datasets.json | 6 ------ 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/components/widgets/fires/burned-area-cumulative/index.js b/components/widgets/fires/burned-area-cumulative/index.js index 81fa6c469d..ca1da5559b 100644 --- a/components/widgets/fires/burned-area-cumulative/index.js +++ b/components/widgets/fires/burned-area-cumulative/index.js @@ -98,7 +98,7 @@ const defaultConfig = { fires: 3, }, settings: { - dataset: 'modis_burned_area', + dataset: 'viirs', firesThreshold: 0, }, sentences: { @@ -154,7 +154,7 @@ export default { if (!widgetSettings || !widgetSettings.dataset) { return defaultConfig; } - if (widgetSettings.dataset !== 'modis_burned_area') { + if (widgetSettings?.dataset !== 'modis_burned_area') { return firesAlertsCumulative; } return defaultConfig; diff --git a/components/widgets/fires/burned-area-ranked/index.js b/components/widgets/fires/burned-area-ranked/index.js index 79fd975a21..d4dd917599 100644 --- a/components/widgets/fires/burned-area-ranked/index.js +++ b/components/widgets/fires/burned-area-ranked/index.js @@ -118,7 +118,7 @@ const defaultConfig = { page: 0, period: 'week', weeks: 4, - dataset: 'modis_burned_area', + dataset: 'viirs', layerStartDate: null, layerEndDate: null, firesThreshold: 0, @@ -166,7 +166,7 @@ export default { if (!widgetSettings || !widgetSettings.dataset) { return defaultConfig; } - if (widgetSettings.dataset !== 'modis_burned_area') { + if (widgetSettings?.dataset !== 'modis_burned_area') { return firesRanked; } return defaultConfig; diff --git a/components/widgets/fires/burned-area/index.js b/components/widgets/fires/burned-area/index.js index 284f740a31..5c300bb376 100644 --- a/components/widgets/fires/burned-area/index.js +++ b/components/widgets/fires/burned-area/index.js @@ -86,7 +86,7 @@ export default { fires: 1, }, settings: { - dataset: 'modis_burned_area', + dataset: 'viirs', firesThreshold: 0, }, sentences: { diff --git a/data/fires-datasets.json b/data/fires-datasets.json index 9ee4010801..d426efc4bd 100644 --- a/data/fires-datasets.json +++ b/data/fires-datasets.json @@ -12,11 +12,5 @@ "unit": "alerts", "metaKey": null, "infoText": "MODIS alerts perform better in cloudy areas, but are coarser resolution than VIIRS alerts" - },{ - "label": "MODIS Burned Area", - "value": "modis_burned_area", - "unit": "ha", - "metaKey": null, - "infoText": "MODIS burned area dataset gives an indication of the total area affected by fires" } ] From 0551bdfe1b83d3f6e460436ce240a0ed411e87c0 Mon Sep 17 00:00:00 2001 From: Luis Zenteno Date: Fri, 20 Oct 2023 09:08:48 -0600 Subject: [PATCH 2/3] feat(fires): return correct widget --- components/widgets/fires/burned-area-cumulative/index.js | 4 +--- components/widgets/fires/burned-area-ranked/index.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/components/widgets/fires/burned-area-cumulative/index.js b/components/widgets/fires/burned-area-cumulative/index.js index ca1da5559b..c9bc3b878c 100644 --- a/components/widgets/fires/burned-area-cumulative/index.js +++ b/components/widgets/fires/burned-area-cumulative/index.js @@ -151,12 +151,10 @@ export default { refetchKeys: ['dataset'], getWidget: (widgetSettings) => { // called when settings changes - if (!widgetSettings || !widgetSettings.dataset) { - return defaultConfig; - } if (widgetSettings?.dataset !== 'modis_burned_area') { return firesAlertsCumulative; } + return defaultConfig; }, }; diff --git a/components/widgets/fires/burned-area-ranked/index.js b/components/widgets/fires/burned-area-ranked/index.js index d4dd917599..348081aebe 100644 --- a/components/widgets/fires/burned-area-ranked/index.js +++ b/components/widgets/fires/burned-area-ranked/index.js @@ -163,12 +163,10 @@ export default { refetchKeys: ['dataset'], getWidget: (widgetSettings) => { // called when settings changes - if (!widgetSettings || !widgetSettings.dataset) { - return defaultConfig; - } if (widgetSettings?.dataset !== 'modis_burned_area') { return firesRanked; } + return defaultConfig; }, }; From 4baaa3354cbb95559f77bd4ee436b268ab453c43 Mon Sep 17 00:00:00 2001 From: Luis Zenteno Date: Fri, 20 Oct 2023 11:16:37 -0600 Subject: [PATCH 3/3] feat(cumulative-fire-alerts): display widget in map when toggling fire alerts --- components/widgets/fires/fires-alerts-cumulative/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/widgets/fires/fires-alerts-cumulative/index.js b/components/widgets/fires/fires-alerts-cumulative/index.js index 743e54de57..b934c6bc4b 100644 --- a/components/widgets/fires/fires-alerts-cumulative/index.js +++ b/components/widgets/fires/fires-alerts-cumulative/index.js @@ -2,6 +2,8 @@ import { all, spread } from 'axios'; import uniq from 'lodash/uniq'; import moment from 'moment'; import { fetchVIIRSAlerts, fetchVIIRSLatest } from 'services/analysis-cached'; +import { FIRES_VIIRS_DATASET } from 'data/datasets'; +import { FIRES_ALERTS_VIIRS } from 'data/layers'; import getWidgetProps from './selectors'; @@ -10,6 +12,12 @@ export default { title: 'Cumulative Fire Alerts in {location}', large: true, categories: ['summary', 'fires'], + datasets: [ + { + dataset: FIRES_VIIRS_DATASET, + layers: [FIRES_ALERTS_VIIRS], + }, + ], settingsConfig: [ { key: 'forestType',