Skip to content

Commit 8ef47e8

Browse files
authored
Merge pull request #410 from NASA-IMPACT/develop
Version 1.5.0
2 parents b755cdb + f928c76 commit 8ef47e8

File tree

10 files changed

+87
-15
lines changed

10 files changed

+87
-15
lines changed
913 KB
Loading

app/assets/scripts/components/common/layers/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import slowdown from './layer-slowdown';
1212
import waterChlorophyll from './layer-water-chlorophyll';
1313
import waterSpm from './layer-water-spm';
1414
import agriculture from './layer-agriculture';
15+
import agTogo from './layer-togo-ag';
1516

1617
const layers = [
1718
no2,
@@ -25,7 +26,8 @@ const layers = [
2526
slowdown,
2627
waterChlorophyll,
2728
waterSpm,
28-
agriculture
29+
agriculture,
30+
agTogo
2931
];
3032

3133
export default layers;
@@ -37,7 +39,8 @@ const layersBySpotlight = {
3739
la: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture', 'slowdown', 'detection-ship'],
3840
sf: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'agriculture', 'slowdown', 'detection-ship', 'water-chlorophyll', 'water-spm'],
3941
tk: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs'],
40-
ny: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'slowdown', 'detection-ship', 'water-chlorophyll', 'water-spm']
42+
ny: ['no2', 'no2-diff', 'co2', 'co2-diff', 'nightlights-hd', 'nightlights-viirs', 'slowdown', 'detection-ship', 'water-chlorophyll', 'water-spm'],
43+
togo: ['togo-ag']
4144
};
4245

4346
const layerOverridesBySpotlight = {

app/assets/scripts/components/common/layers/layer-no2-diff.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
source: {
1414
type: 'raster',
1515
tiles: [
16-
`${config.api}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/OMNO2d_HRMDifference/OMI_trno2_0.10x0.10_{date}_Col3_V4.nc.tif&resampling_method=bilinear&bidx=1&rescale=-3e15%2C3e15&color_map=rdbu_r3`
16+
`${config.api}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/OMNO2d_HRMDifference/OMI_trno2_0.10x0.10_{date}_Col3_V4.nc.tif&resampling_method=bilinear&bidx=1&rescale=-3e15%2C3e15&color_map=rdbu_r`
1717
]
1818
},
1919
exclusiveWith: ['co2', 'co2-diff', 'gibs-population', 'car-count', 'nightlights-viirs', 'nightlights-hd', 'detection-ship', 'detection-multi', 'water-chlorophyll', 'water-spm', 'no2'],
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
import config from '../../../config';
3+
4+
import { indicatorGroupColors } from '../../../styles/theme/theme.js';
5+
6+
export default {
7+
id: 'togo-ag',
8+
name: 'Agriculture',
9+
type: 'raster',
10+
source: {
11+
type: 'raster',
12+
tiles: [
13+
`${config.api}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/Togo/togo_cropland_v7-1_cog_v2.tif&resampling_method=bilinear&bidx=1&rescale=0%2C1&color_map=inferno`
14+
]
15+
},
16+
enabled: true,
17+
exclusiveWith: [],
18+
swatch: indicatorGroupColors.agriculture,
19+
legend: {
20+
type: 'gradient',
21+
min: 'low',
22+
max: 'high',
23+
stops: [
24+
'#000000',
25+
'#1a0b40',
26+
'#4b0c6b',
27+
'#791c6d',
28+
'#a42c60',
29+
'#cf4446',
30+
'#ed6825',
31+
'#fb9b06',
32+
'#f6d13c',
33+
'#fbfda2'
34+
]
35+
},
36+
info: 'Dark purple colors indicate lower probability of cropland while lighter yellow colors indicate higher probability of cropland within each pixel.'
37+
};

app/assets/scripts/components/common/summary-expandable.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class SummaryExpandable extends Component {
3838
super(props);
3939

4040
this.state = {
41-
isExpanded: false
41+
isExpanded: props.initialExpanded
4242
};
4343
}
4444

@@ -63,7 +63,8 @@ class SummaryExpandable extends Component {
6363

6464
SummaryExpandable.propTypes = {
6565
className: T.string,
66-
children: T.node
66+
children: T.node,
67+
initialExpanded: T.bool
6768
};
6869

6970
export default SummaryExpandable;

app/assets/scripts/components/indicators/indicator-agriculture.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import media from '../../styles/utils/media-queries';
1111
import { glsp } from '../../styles/utils/theme-values';
1212
import Heading from '../../styles/type/heading';
1313
import MediaImage from '../../styles/media-image';
14-
// import config from '../../config';
14+
import config from '../../config';
1515

16-
// const { baseUrl } = config;
16+
const { baseUrl } = config;
1717
const LeadFold = styled(Fold)`
1818
padding-bottom: 0;
1919
@@ -361,13 +361,13 @@ class AgLongForm extends React.Component {
361361
</p>
362362
</Prose>
363363
</FoldDetails>
364-
{/* <MediaImage
365-
src={`${baseUrl}/assets/graphics/content/cropmonitor-july.png`}
366-
alt='Crop Monitor for AMIS July'
364+
<MediaImage
365+
src={`${baseUrl}/assets/graphics/content/AMIS_EW_synthesis_202008.jpg`}
366+
alt='Crop Monitor for AMIS August'
367367
>
368-
Crop Monitor for AMIS and Early Warning July synthesis map. Image
368+
Crop Monitor for AMIS and Early Warning August synthesis map. Image
369369
Credit: GEOGLAM Crop Monitor
370-
</MediaImage> */}
370+
</MediaImage>
371371
</Gridder>
372372
</InterpretDataFold>
373373

app/assets/scripts/components/spotlight/single/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,19 @@ class SpotlightAreasSingle extends React.Component {
104104

105105
// Set query state definition for url state storing.
106106
const common = getCommonQsState(props);
107-
common.layers.default = 'nightlights-hd';
107+
108+
switch (props.match.params.spotlightId) {
109+
case 'togo':
110+
common.layers.default = 'togo-ag';
111+
break;
112+
case 'wble':
113+
common.layers.default = 'water-wq-gl-chl';
114+
break;
115+
default:
116+
common.layers.default = 'nightlights-hd';
117+
break;
118+
}
119+
108120
this.qsState = new QsState(common);
109121

110122
// The active layers can only be enabled once the map loads. The toggle

app/assets/scripts/components/spotlight/single/sec-panel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class SecPanel extends React.Component {
215215
}
216216
bodyContent={
217217
<BodyScroll>
218-
{summary && <SummaryExpandable>{summary}</SummaryExpandable>}
218+
{summary && <SummaryExpandable initialExpanded={!groups.length}>{summary}</SummaryExpandable>}
219219

220220
<Accordion allowMultiple initialState={[true]}>
221221
{({ checkExpanded, setExpanded }) =>

app/assets/scripts/components/spotlight/single/summaries.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ const summaries = {
8383
</p>
8484
</>
8585
),
86+
togo: (
87+
<>
88+
<p>
89+
The effects of COVID-19 shutdowns in Togo, including many months of curfews, severely limited the ability of hundreds of thousands of the country’s small farmers to produce an adequate food supply, as well as to cultivate formerly robust crops, such as soy and cotton.
90+
</p>
91+
<p>
92+
To help its farmers, the Togolese government used a cropland data map developed by NASA’s food security and agriculture program, known as NASA Harvest, to develop a loan program that would help fund the cost of farming essentials.
93+
</p>
94+
<p>
95+
In the past, farmers eligible for such loans would have been identified using Togo’s census data. However, the existing census only accounts for growers who list their primary occupation as farming. This vastly underestimates the number of informal smallholder growers impacted by the pandemic, who rely on subsistence farming to live. This is where satellite data can help fill in the gaps.
96+
</p>
97+
<p>
98+
When rapid action was needed and mobility across the country was limited due to the COVID-19 outbreak, satellite data offered an effective and rapid way to map the country’s distribution of croplands and characterize the nature of agricultural fields during the pandemic.
99+
</p>
100+
<p>
101+
NASA Harvest developed a national-level, satellite-derived cropland map for Togo at 10-meter resolution within a 10-day timeframe using data from the European Space Agency’s Copernicus Sentinel 2 satellite, the NASA-USGS Landsat satellites, and with data from commercial partner Planet Inc. These data, alongside poverty and census information, rapidly and effectively identified priority areas for the loan program. With the cropland maps, Togolese government officials had trustworthy information on the physical size and geographic location of agricultural lands that census data might have missed.
102+
</p>
103+
</>
104+
),
86105
tk: (
87106
<>
88107
<p>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "covid-dashboard",
3-
"version": "1.4.2",
3+
"version": "1.5.0",
44
"description": "Frontend application for the Covid Dashboard",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)