Skip to content

Commit

Permalink
Merge pull request #4713 from wri/develop
Browse files Browse the repository at this point in the history
PROD Deploy 2023-10-23 10:19am EST
  • Loading branch information
wri7tno authored Oct 23, 2023
2 parents 93001be + 5bafc5c commit b20add5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
8 changes: 3 additions & 5 deletions components/widgets/fires/burned-area-cumulative/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const defaultConfig = {
fires: 3,
},
settings: {
dataset: 'modis_burned_area',
dataset: 'viirs',
firesThreshold: 0,
},
sentences: {
Expand Down Expand Up @@ -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') {
if (widgetSettings?.dataset !== 'modis_burned_area') {
return firesAlertsCumulative;
}

return defaultConfig;
},
};
8 changes: 3 additions & 5 deletions components/widgets/fires/burned-area-ranked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const defaultConfig = {
page: 0,
period: 'week',
weeks: 4,
dataset: 'modis_burned_area',
dataset: 'viirs',
layerStartDate: null,
layerEndDate: null,
firesThreshold: 0,
Expand Down Expand Up @@ -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') {
if (widgetSettings?.dataset !== 'modis_burned_area') {
return firesRanked;
}

return defaultConfig;
},
};
2 changes: 1 addition & 1 deletion components/widgets/fires/burned-area/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default {
fires: 1,
},
settings: {
dataset: 'modis_burned_area',
dataset: 'viirs',
firesThreshold: 0,
},
sentences: {
Expand Down
8 changes: 8 additions & 0 deletions components/widgets/fires/fires-alerts-cumulative/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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',
Expand Down
6 changes: 0 additions & 6 deletions data/fires-datasets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]

0 comments on commit b20add5

Please sign in to comment.