Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit f8524dc

Browse files
committed
try
1 parent 51b9777 commit f8524dc

18 files changed

+5
-27
lines changed

src/plots/geo/constants.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,25 +135,18 @@ params.fillLayers = ['ocean', 'land', 'lakes'];
135135
// base layer with a only a line color
136136
params.lineLayers = ['subunits', 'countries', 'coastlines', 'rivers', 'frame'];
137137

138+
// base layer order
138139
params.layers = [
139-
'bg',
140-
'ocean', 'land', 'lakes',
141-
'subunits', 'countries', 'coastlines', 'rivers',
142-
'lataxis', 'lonaxis', 'frame',
143-
'backplot',
144-
'frontplot'
145-
];
146-
147-
params.layersForChoropleth = [
148140
'bg',
149141
'ocean', 'land',
142+
'backplot',
143+
'lakes', 'rivers',
150144
'subunits', 'countries', 'coastlines',
151145
'lataxis', 'lonaxis', 'frame',
152-
'backplot',
153-
'rivers', 'lakes',
154146
'frontplot'
155147
];
156148

149+
// adjectives as in 'countrycolor', 'coastlinewidth', etc.
157150
params.layerNameToAdjective = {
158151
ocean: 'ocean',
159152
land: 'land',

src/plots/geo/geo2.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ function Geo(opts) {
5858
this.bounds = null;
5959
this.midPt = null;
6060

61-
this.hasChoropleth = false;
62-
6361
this.traceHash = {};
6462
this.layers = {};
6563
this.basePaths = {};
@@ -132,15 +130,6 @@ proto.fetchTopojson = function() {
132130
proto.update = function(geoCalcData, fullLayout) {
133131
var geoLayout = fullLayout[this.id];
134132

135-
// important: maps with choropleth traces have a different layer order
136-
this.hasChoropleth = false;
137-
for(var i = 0; i < geoCalcData.length; i++) {
138-
if(geoCalcData[i][0].trace.type === 'choropleth') {
139-
this.hasChoropleth = true;
140-
break;
141-
}
142-
}
143-
144133
this.updateProjection(fullLayout, geoLayout);
145134
this.updateBaseLayers(fullLayout, geoLayout);
146135
this.updateDims(fullLayout, geoLayout);
@@ -245,11 +234,7 @@ proto.updateBaseLayers = function(fullLayout, geoLayout) {
245234
);
246235
}
247236

248-
var allLayers = this.hasChoropleth ?
249-
constants.layersForChoropleth :
250-
constants.layers;
251-
252-
var layerData = allLayers.filter(function(d) {
237+
var layerData = constants.layers.filter(function(d) {
253238
return isTopoLayer(d) ? geoLayout['show' + d] :
254239
isAxisLayer(d) ? geoLayout[d].showgrid :
255240
true;
-44 Bytes
Loading
-874 Bytes
Loading
-3.07 KB
Loading
-2.54 KB
Loading
Loading
-3.09 KB
Loading
-201 Bytes
Loading

test/image/baselines/geo_first.png

-864 Bytes
Loading
-2 KB
Loading
-180 Bytes
Loading
Loading
-2.29 KB
Loading
-103 Bytes
Loading

test/image/baselines/geo_second.png

2.75 KB
Loading
3.1 KB
Loading
5.1 KB
Loading

0 commit comments

Comments
 (0)