Skip to content

Commit

Permalink
Merge pull request #77 from NASA-IMPACT/feature/nightlights
Browse files Browse the repository at this point in the history
Nightlights layer
  • Loading branch information
olafveerman authored May 29, 2020
2 parents 28482e5 + 074a664 commit 9ee0535
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/assets/scripts/components/common/layers/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import no2 from './layer-no2';
import population from './layer-population';
import carCount from './layer-car-count';
import nightlights from './layer-nightlights';

export default [
no2,
population,
carCount
carCount,
nightlights
];
31 changes: 31 additions & 0 deletions app/assets/scripts/components/common/layers/layer-nightlights.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import config from '../../../config';

export default {
id: 'nightlights',
name: 'Nightlights',
type: 'raster',
source: {
type: 'raster',
tiles: [
`${config.api}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/viirs/sample/BMHD_Sample_Tokyo_cog.tif`
]
},
exclusiveWith: ['no2'],
swatch: {
color: '#f2a73a',
name: 'Gold'
},
legend: {
type: 'gradient',
min: 'less',
max: 'more',
stops: [
'#08041d',
'#1f0a46',
'#52076c',
'#f57c16',
'#f7cf39'
]
},
info: null
};
2 changes: 1 addition & 1 deletion app/assets/scripts/components/common/layers/layer-no2.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
`${config.api}/{z}/{x}/{y}@1x?url=s3://covid-eo-data/OMNO2d_HRM/OMI_trno2_0.10x0.10_{date}_Col3_V4.nc.tif&resampling_method=bilinear&bidx=1&rescale=0%2C1e16&color_map=custom_no2&color_formula=gamma r {gamma}`
]
},
exclusiveWith: ['gibs-population', 'car-count'],
exclusiveWith: ['gibs-population', 'car-count', 'nightlights'],
enabled: true,
compare: {
enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion app/assets/scripts/components/common/line-chart/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const ChartWrapper = styled(SizeAwareElement)`
class DataBrowserChart extends React.Component {
constructor (props) {
super(props);
this.margin = { top: 16, right: 32, bottom: 80, left: 64 };
this.margin = { top: 16, right: 32, bottom: 80, left: 48 };
// Control whether the chart was rendered.
// The size aware element fires a onChange event once it is rendered
// But at that time the chart is not ready yet so we can't update the size.
Expand Down
2 changes: 1 addition & 1 deletion app/assets/scripts/components/spotlight/single/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const layersBySpotlight = {
gh: ['no2'],
la: ['no2'],
sf: ['no2'],
tk: ['no2']
tk: ['no2', 'nightlights']
};

const ExploreCanvas = styled.div`
Expand Down

0 comments on commit 9ee0535

Please sign in to comment.