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 152a396

Browse files
committed
move 'frame' layer back to below front and back plot layers
1 parent 73e8725 commit 152a396

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/plots/geo/constants.js

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

138-
// TODO should 'frame' sit below or above front and back plot?
139-
140138
params.layers = [
141139
'bg',
142140
'ocean', 'land', 'lakes',
143141
'subunits', 'countries', 'coastlines', 'rivers',
144-
'lataxis', 'lonaxis',
142+
'lataxis', 'lonaxis', 'frame',
145143
'backplot',
146-
'frontplot',
147-
'frame'
144+
'frontplot'
148145
];
149146

150147
params.layersForChoropleth = [
151148
'bg',
152149
'ocean', 'land',
153150
'subunits', 'countries', 'coastlines',
154-
'lataxis', 'lonaxis',
151+
'lataxis', 'lonaxis', 'frame',
155152
'backplot',
156153
'rivers', 'lakes',
157-
'frontplot',
158-
'frame'
154+
'frontplot'
159155
];
160156

161157
params.layerNameToAdjective = {

src/plots/geo/geo2.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ proto.updateProjection = function(fullLayout, geoLayout) {
198198
isNaN(t[0]) || isNaN(t[0])
199199
) {
200200
Lib.warn('Invalid geo settings');
201+
202+
// TODO fallback to default ???
201203
}
202204

203205
// px coordinates of view mid-point,
@@ -299,12 +301,12 @@ proto.updateBaseLayers = function(fullLayout, geoLayout) {
299301

300302
proto.updateDims = function(fullLayout, geoLayout) {
301303
var b = this.bounds;
302-
var frameWidth = geoLayout.framewidth || 0;
304+
var hFrameWidth = (geoLayout.framewidth || 0) / 2;
303305

304-
var l = b[0][0] - frameWidth;
305-
var t = b[0][1] - frameWidth;
306-
var w = b[1][0] - l + frameWidth;
307-
var h = b[1][1] - t + frameWidth;
306+
var l = b[0][0] - hFrameWidth;
307+
var t = b[0][1] - hFrameWidth;
308+
var w = b[1][0] - l + hFrameWidth;
309+
var h = b[1][1] - t + hFrameWidth;
308310

309311
Drawing.setRect(this.clipRect, l, t, w, h);
310312

0 commit comments

Comments
 (0)