Skip to content

Commit 5dd8940

Browse files
committed
Merge pull request #1880 from Vizzuality/release/oktoberfest
Release/oktoberfest
2 parents 5366cdc + 6dbe0fe commit 5dd8940

File tree

173 files changed

+4488
-1012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+4488
-1012
lines changed
598 KB
-596 KB
Binary file not shown.
1.32 KB
-3.09 KB

app/assets/images/svg-icons/fullscreen.svg

+1

app/assets/images/svg-icons/story-marker.svg

+1

app/assets/javascripts/abstract/layer/ImageMaptypeLayerClass.js

+25-1
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,34 @@ define([
5151
* @return {string} url Tile url
5252
*/
5353
_getUrl: function(tile, zoom) {
54+
var params = {};
55+
if (window.location.search.contains('&hresolution=') && window.location.search.indexOf('=', window.location.search.indexOf('&hresolution=') + 13) !== -1) {
56+
var params_new_url = {};
57+
var parts = location.search.substring(1).split('&');
58+
for (var i = 0; i < parts.length; i++) {
59+
var nv = parts[i].split('=');
60+
if (!nv[0]) continue;
61+
params_new_url[nv[0]] = nv[1] || true;
62+
}
63+
params = JSON.parse(atob(params_new_url.hresolution));
64+
}
65+
else if (!!sessionStorage.getItem('high-resolution')) {
66+
params = JSON.parse(atob(sessionStorage.getItem('high-resolution')));
67+
}
68+
params = {
69+
'color_filter': params.color_filter || 'rgb',
70+
'cloud': params.cloud || '100',
71+
'mindate': params.mindate || '2000-09-01',
72+
'maxdate': params.maxdate || '2015-09-01'
73+
}
5474
return new UriTemplate(this.options.urlTemplate).fillFromObject({
5575
x: tile.x,
5676
y: tile.y,
57-
z: zoom
77+
z: zoom,
78+
sat: params.color_filter,
79+
cloud: params.cloud,
80+
mindate: params.mindate,
81+
maxdate: params.maxdate
5882
});
5983
}
6084
});

app/assets/javascripts/abstract/layer/MarkersLayerClass.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ define([
5454

5555
this.markers = _.map(stories, function(story) {
5656

57-
story.title = _.str.truncate(story.title, 34);
57+
story.title = _.str.truncate(story.title, 68);
5858

5959
var markerOptions, infoWindowOptions;
6060

app/assets/javascripts/abstract/timeline/TimelineYearClass.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ define([
248248
.ticks(ticks)
249249
.tickSize(0)
250250
.tickPadding(0)
251-
.tickFormat(function(d) {return String(d); })
251+
.tickFormat(_.bind(function(d) {
252+
return (d == 2000 && this.name == 'prodes') ? String('1997-2000') : String(d);
253+
// return String(d);
254+
}, this ))
252255

253256
this.svg.append('g')
254257
.attr('class', 'xaxis-years')
@@ -317,6 +320,7 @@ define([
317320
.attr('x2', this.handlers.right.attr('x'));
318321

319322
d3.select('.xaxis-years')
323+
.attr('class', 'xaxis-years '+this.name)
320324
.selectAll('.tick')
321325
.on('click',_.bind(function(value){
322326
this.selectYear(value);

app/assets/javascripts/countries/helpers/CountryConfig.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ define([], function() {
111111

112112
config.GRAPHS = {
113113
total_loss: {
114-
title: "Countries with greatest tree cover loss (2001-2013)",
115-
subtitle: "Global tree cover loss, 2001-2013<a href='#' class='info' data-source='total_loss'><i class='dark'></i></a>"
114+
title: "Countries with greatest tree cover loss (2001-2014)",
115+
subtitle: "Global tree cover loss, 2001-2014<a href='#' class='info' data-source='total_loss'><i class='dark'></i></a>"
116116
},
117117
percent_loss: {
118118
title: "Countries with greatest tree cover gain (2001-2012)",
@@ -127,8 +127,8 @@ define([], function() {
127127
subtitle: "Tree cover loss relative to tree cover gain by country (2001-2012)<a href='#' class='info' data-source='total_loss'><i class='dark'></i></a>"
128128
},
129129
domains: {
130-
title: "Climate domains ranked in order of<br />greatest tree cover loss (2001-2013)",
131-
subtitle: "Tree cover loss per year by climate domain, 2001-2013<a href='#' class='info' data-source='total_loss'><i class='dark'></i></a>"
130+
title: "Climate domains ranked in order of<br />greatest tree cover loss (2001-2014)",
131+
subtitle: "Tree cover loss per year by climate domain, 2001-2014<a href='#' class='info' data-source='total_loss'><i class='dark'></i></a>"
132132
}
133133
};
134134

app/assets/javascripts/countries/views/CountryOverviewView.js

+16-18
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ define([
5858

5959
this.x_scale = d3.scale.linear()
6060
.range([m, w-m])
61-
.domain([2001, 2013]);
61+
.domain([2001, 2014]);
6262

6363
this.grid_scale = d3.scale.linear()
6464
.range([vertical_m, h-vertical_m])
@@ -292,11 +292,11 @@ define([
292292

293293
if (!!mode && mode.mode == 'percent') {
294294
$('.overview_graph__legend').find('.trigger-mode').html('<span>GROSS LOSS</span> <strong>PERCENT LOSS</strong>').show();
295-
$('.overview_graph__title').html('Countries with greatest percent loss (2001-2013) relative to tree cover in 2000');
295+
$('.overview_graph__title').html('Countries with greatest percent loss (2001-2014) relative to tree cover in 2000');
296296

297297
} else {
298298
$('.overview_graph__legend').find('.trigger-mode').html('<strong>GROSS LOSS</strong> <span>PERCENT LOSS</span>').show();
299-
$('.overview_graph__title').html('Countries with greatest tree cover loss (2001-2013)');
299+
$('.overview_graph__title').html('Countries with greatest tree cover loss (2001-2014)');
300300
}
301301
}
302302

@@ -519,7 +519,8 @@ define([
519519
}, this ));
520520
} else if (this.model.get('graph') === 'domains') {
521521
$('.countries_list__header__minioverview').show();
522-
var sql = 'SELECT ecozone as name, sum(loss) as total_loss, sum(gain) as total_gain FROM umd_eco where thresh = ' + (this.helper.config.canopy_choice || 30) +' group by ecozone';
522+
var sql = "SELECT ecozone as name, sum(loss) as total_loss, sum(gain) as total_gain FROM umd_eco_2014 where thresh = "+ (this.helper.config.canopy_choice || 30) +" and ecozone !='Water' and ecozone != 'Polar' group by ecozone";
523+
// "SELECT ecozone as name, sum(loss) as total_loss, sum(gain) as total_gain FROM umd_eco where thresh = ' + (this.helper.config.canopy_choice || 30) +’ and ecozone !='Water' and ecozone != 'Polar' group by ecozone"
523524
d3.json('http://wri-01.cartodb.com/api/v2/sql/?q='+encodeURIComponent(sql), _.bind(function(json) {
524525
var self = that,
525526
markup_list = '';
@@ -626,7 +627,7 @@ define([
626627
} else if (this.model.get('graph') === ('percent_loss')) {
627628
var sql = 'SELECT year, \
628629
loss_perc \
629-
FROM umd_nat \
630+
FROM umd_nat_final_1 \
630631
WHERE thresh = '+ (this.helper.config.canopy_choice || 30) +' \
631632
AND iso = \''+ iso +'\'';
632633

@@ -657,7 +658,7 @@ define([
657658
var sql = 'SELECT year, \
658659
loss, \
659660
extent_offset extent \
660-
FROM umd_nat \
661+
FROM umd_nat_final_1 \
661662
WHERE thresh = '+ (this.helper.config.canopy_choice || 30) +' \
662663
AND iso = \''+ iso +'\' \
663664
AND year > 2000 ';
@@ -733,10 +734,10 @@ define([
733734
_drawYears: function() {
734735
var markup_years = '';
735736

736-
for (var y = 2001; y<=2013; y += 1) {
737+
for (var y = 2001; y<=2014; y += 1) {
737738
var y_ = this.x_scale(y);
738739

739-
if (y === 2001 || y === 2013) {
740+
if (y === 2001 || y === 2014) {
740741
y_ -= 5;
741742
} else {
742743
y_ -= 0;
@@ -999,7 +1000,7 @@ define([
9991000
} else {
10001001
l_mha = 'Ha';
10011002
}
1002-
$target.find('.figure').addClass('extent').html(extent.toLocaleString());
1003+
$target.find('.figure').addClass('extent').html(Math.round(extent).toLocaleString());
10031004
$target.find('.unit').html(l_mha);
10041005
}
10051006
}, this),
@@ -1241,29 +1242,26 @@ define([
12411242
});
12421243
} else if (this.model.get('graph') === 'domains') {
12431244
this._showYears();
1244-
1245-
1246-
var sql = 'SELECT ecozone as name, loss, year FROM umd_eco where thresh = ' + (this.helper.config.canopy_choice || 30);
1245+
var sql = "SELECT ecozone as name, sum(loss), year FROM umd_eco_2014 where thresh = " + (this.helper.config.canopy_choice || 30) + " and ecozone !='Water' and ecozone != 'Polar' group by name, year";
12471246
d3.json('http://wri-01.cartodb.com/api/v2/sql/?q='+encodeURIComponent(sql), _.bind(function(json) {
1248-
1249-
var data = _.groupBy(json.rows, function(row){
1247+
var data = _.groupBy(_.sortBy(json.rows, function(row){ return row.year}), function(row){
12501248
return row.name;
12511249
});
12521250
var data_index = 0;
12531251
var data_arr = [];
1254-
data = _.each(data, function(domain, i){
1252+
_.each(data, function(domain, i){
12551253
var domain_obj = {};
12561254

12571255
domain_obj['name'] = i;
1258-
domain_obj['max'] = _.max(domain, function(y){return y.loss}).loss;
1256+
domain_obj['max'] = _.max(domain, function(y){return y.sum}).sum;
12591257

12601258
_.each(domain, function(y, j){
1261-
domain_obj['y'+y.year] = y.loss;
1259+
domain_obj['y'+y.year] = y.sum;
12621260
});
12631261

12641262
data_arr.push(domain_obj);
12651263
});
1266-
1264+
data_arr = _.sortBy(data_arr, function(row){ return row.name });
12671265
var r_scale = d3.scale.linear()
12681266
.range([5, 30]) // max ball radius
12691267
.domain([0, d3.max(data_arr, function(d) { return d.max; })])

app/assets/javascripts/landing/views/SlideView.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ define([
2020
events: {
2121
'click #get-started' : 'getStarted',
2222
'click #go-to-apps' : 'goToApps',
23-
'click .gotomap' : 'gotoMap'
23+
'click .gotomap' : 'gotoMap',
24+
'click .ribbon' : 'startSurvey'
2425
},
2526

2627
initialize: function() {
@@ -31,7 +32,7 @@ define([
3132
this.slickSlider();
3233
},
3334

34-
slickSlider: function(){
35+
slickSlider: function() {
3536
//INIT
3637
$('.main-slider-viewport').slick({
3738
infinite: true,
@@ -64,6 +65,12 @@ define([
6465
$(e.currentTarget).toggleClass('active');
6566
},
6667

68+
startSurvey: function() {
69+
ga('send', 'event', 'Home', 'Click', 'Survey link in slider');
70+
var win = window.open('https://www.surveymonkey.com/s/GFWeval', '_blank');
71+
win.focus();
72+
},
73+
6774
/**
6875
* Closes submenu tooltip
6976
* Check the click target is not the dialog itself.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#gfw_landsat_alerts{
2+
marker-file: url(http://com.cartodb.users-assets.production.s3.amazonaws.com/maki-icons/square-18.svg);
3+
marker-fill-opacity: 1;
4+
marker-line-width: 0;
5+
marker-placement: point;
6+
marker-type: ellipse;
7+
marker-width: 0.12;
8+
marker-height:0.12;
9+
marker-fill: #F69;
10+
marker-allow-overlap: true;
11+
12+
[zoom=10]{
13+
marker-width: 0.3;
14+
marker-height:0.3;
15+
}
16+
[zoom=11]{
17+
marker-width: 0.75;
18+
marker-height:0.75;
19+
}
20+
[zoom=12]{
21+
marker-width: 1.5;
22+
marker-height:1.5;
23+
}
24+
[zoom=13]{
25+
marker-width: 3;
26+
marker-height:3;
27+
}
28+
[zoom>13]{
29+
marker-width: 1.5*('@zoom'-13);
30+
marker-height:1.5*('@zoom'-13);
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#khm_economic_land_concession_wgs {
2+
polygon-opacity: 0.8;
3+
line-color: #FFF;
4+
line-width: 0;
5+
line-opacity: 1;
6+
}
7+
8+
#khm_economic_land_concession_wgs[adjustment_classification="Downsized"] {
9+
polygon-fill: #FFCC00;
10+
}
11+
#khm_economic_land_concession_wgs[adjustment_classification="Downsized after revocation"] {
12+
polygon-fill: #FF6600;
13+
}
14+
#khm_economic_land_concession_wgs[adjustment_classification="No evidence of adjustment"] {
15+
polygon-fill: #055D00;
16+
}
17+
#khm_economic_land_concession_wgs[adjustment_classification="Revoked"] {
18+
polygon-fill: #B40903;
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#gfw_plantations {
2+
polygon-opacity: 0.5;
3+
line-color: #FFF;
4+
line-width: 0.5;
5+
line-opacity: 0;
6+
polygon-fill: transparent;
7+
}
8+
#gfw_plantations[spec_simp="Fruit"] {
9+
polygon-fill: #b2b300;
10+
}
11+
#gfw_plantations[spec_simp="Fruit mix"] {
12+
polygon-fill: #FF0;
13+
}
14+
#gfw_plantations[spec_simp="Hevea (rubber)"] {
15+
polygon-fill: #00bdbd;
16+
}
17+
#gfw_plantations[spec_simp="Oil palm"] {
18+
polygon-fill: #f44c43;
19+
}
20+
#gfw_plantations[spec_simp="Oil palm mix"] {
21+
polygon-fill: #f7837d;
22+
}
23+
#gfw_plantations[spec_simp="Other"] {
24+
polygon-fill: #9ECC49;
25+
}
26+
#gfw_plantations[spec_simp="Other mix"] {
27+
polygon-fill: #c1df8b;
28+
}
29+
#gfw_plantations[spec_simp="Recently cleared"] {
30+
polygon-fill: #A53ED5;
31+
}
32+
#gfw_plantations[spec_simp="Rubber"] {
33+
polygon-fill: #11002F;
34+
}
35+
#gfw_plantations[spec_simp="Rubber mix"] {
36+
polygon-fill: #0FF;
37+
}
38+
#gfw_plantations[spec_simp="Unknown"] {
39+
polygon-fill: #b5b0b0;
40+
}
41+
#gfw_plantations[spec_simp="Wood fiber / timber"] {
42+
polygon-fill: #0F3B82;
43+
}
44+
#gfw_plantations[spec_simp="Wood fiber / timber mix"] {
45+
polygon-fill: #246ee6;
46+
}
47+
48+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#gfw_plantations {
2+
polygon-opacity: 0.5;
3+
line-color: #FFF;
4+
line-width: 0.5;
5+
line-opacity: 0;
6+
polygon-fill: transparent;
7+
}
8+
9+
#gfw_plantations[type_text="Large industrial plantation"] {
10+
polygon-fill: #F84F40;
11+
}
12+
#gfw_plantations[type_text="Mosaic of medium-sized plantations"] {
13+
polygon-fill: #A53ED5;
14+
}
15+
#gfw_plantations[type_text="Mosaic of small-sized plantations"] {
16+
polygon-fill: #33A02C;
17+
}
18+
#gfw_plantations[type_text="Clearing/ very young plantation"] {
19+
polygon-fill: #a7652a;
20+
}

app/assets/javascripts/map/cartocss/polygon_polygonSymbolizer.xml

+2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
<sld:Title>polygonSymbolizer</sld:Title>
1414
<sld:FeatureTypeStyle>
1515
<sld:Rule>
16+
<!--
1617
<ogc:Filter>
1718
<ogc:PropertyIsNotEqualTo>
1819
<ogc:PropertyName>pais</ogc:PropertyName>
1920
<ogc:Literal>Brasil</ogc:Literal>
2021
</ogc:PropertyIsNotEqualTo>
2122
</ogc:Filter>
23+
-->
2224
<sld:PolygonSymbolizer>
2325
<sld:Fill>
2426
<!-- fill states polygons with RGB color "#FF0000" -->

app/assets/javascripts/map/cartocss/style.cartocss

+8
Original file line numberDiff line numberDiff line change
@@ -567,4 +567,12 @@
567567
line-width: 0;
568568
line-opacity: 1;
569569
}
570+
[layer='khm_protected_areas_wgs'] {
571+
polygon-fill: #3182BD;
572+
polygon-opacity: 0.6;
573+
line-color: #FFF;
574+
line-width: 0.25;
575+
line-opacity: 1;
576+
}
577+
570578
}

0 commit comments

Comments
 (0)