Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e609834

Browse filesBrowse files
committed
lint fix
1 parent c11a02a commit e609834
Copy full SHA for e609834

File tree

4 files changed

+37
-37
lines changed
Filter options

4 files changed

+37
-37
lines changed

‎src/plots/mapbox/index.js

Copy file name to clipboardExpand all lines: src/plots/mapbox/index.js
+25-25Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ exports.supplyLayoutDefaults = require('./layout_defaults');
5353
var firstPlot = true;
5454

5555
exports.plot = function plot(gd) {
56-
if (firstPlot) {
56+
if(firstPlot) {
5757
firstPlot = false;
5858
Lib.warn(deprecationWarning);
5959
}
@@ -62,25 +62,25 @@ exports.plot = function plot(gd) {
6262
var calcData = gd.calcdata;
6363
var mapboxIds = fullLayout._subplots[MAPBOX];
6464

65-
if (mapboxgl.version !== constants.requiredVersion) {
65+
if(mapboxgl.version !== constants.requiredVersion) {
6666
throw new Error(constants.wrongVersionErrorMsg);
6767
}
6868

6969
var accessToken = findAccessToken(gd, mapboxIds);
7070
mapboxgl.accessToken = accessToken;
7171

72-
for (var i = 0; i < mapboxIds.length; i++) {
72+
for(var i = 0; i < mapboxIds.length; i++) {
7373
var id = mapboxIds[i];
7474
var subplotCalcData = getSubplotCalcData(calcData, MAPBOX, id);
7575
var opts = fullLayout[id];
7676
var mapbox = opts._subplot;
7777

78-
if (!mapbox) {
78+
if(!mapbox) {
7979
mapbox = new Mapbox(gd, id);
8080
fullLayout[id]._subplot = mapbox;
8181
}
8282

83-
if (!mapbox.viewInitial) {
83+
if(!mapbox.viewInitial) {
8484
mapbox.viewInitial = {
8585
center: Lib.extendFlat({}, opts.center),
8686
zoom: opts.zoom,
@@ -93,24 +93,24 @@ exports.plot = function plot(gd) {
9393
}
9494
};
9595

96-
exports.clean = function (newFullData, newFullLayout, oldFullData, oldFullLayout) {
96+
exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {
9797
var oldMapboxKeys = oldFullLayout._subplots[MAPBOX] || [];
9898

99-
for (var i = 0; i < oldMapboxKeys.length; i++) {
99+
for(var i = 0; i < oldMapboxKeys.length; i++) {
100100
var oldMapboxKey = oldMapboxKeys[i];
101101

102-
if (!newFullLayout[oldMapboxKey] && !!oldFullLayout[oldMapboxKey]._subplot) {
102+
if(!newFullLayout[oldMapboxKey] && !!oldFullLayout[oldMapboxKey]._subplot) {
103103
oldFullLayout[oldMapboxKey]._subplot.destroy();
104104
}
105105
}
106106
};
107107

108-
exports.toSVG = function (gd) {
108+
exports.toSVG = function(gd) {
109109
var fullLayout = gd._fullLayout;
110110
var subplotIds = fullLayout._subplots[MAPBOX];
111111
var size = fullLayout._size;
112112

113-
for (var i = 0; i < subplotIds.length; i++) {
113+
for(var i = 0; i < subplotIds.length; i++) {
114114
var opts = fullLayout[subplotIds[i]];
115115
var domain = opts.domain;
116116
var mapbox = opts._subplot;
@@ -132,7 +132,7 @@ exports.toSVG = function (gd) {
132132

133133
// Append logo if visible
134134
var hidden = subplotDiv.select('.mapboxgl-ctrl-logo').node().offsetParent === null;
135-
if (!hidden) {
135+
if(!hidden) {
136136
var logo = fullLayout._glimages.append('g');
137137
logo.attr('transform', strTranslate(size.l + size.w * domain.x[0] + 10, size.t + size.h * (1 - domain.y[0]) - 31));
138138
logo.append('path')
@@ -185,7 +185,7 @@ exports.toSVG = function (gd) {
185185

186186
// Break into multiple lines twice larger than domain
187187
var maxWidth = size.w * (domain.x[1] - domain.x[0]);
188-
if ((bBox.width > maxWidth / 2)) {
188+
if((bBox.width > maxWidth / 2)) {
189189
var multilineAttributions = attributions.split('|').join('<br>');
190190
attributionText
191191
.text(multilineAttributions)
@@ -209,7 +209,7 @@ exports.toSVG = function (gd) {
209209

210210
// Scale down if larger than domain
211211
var scaleRatio = 1;
212-
if ((bBox.width + 6) > maxWidth) scaleRatio = maxWidth / (bBox.width + 6);
212+
if((bBox.width + 6) > maxWidth) scaleRatio = maxWidth / (bBox.width + 6);
213213

214214
var offset = [(size.l + size.w * domain.x[1]), (size.t + size.h * (1 - domain.y[0]))];
215215
attributionGroup.attr('transform', strTranslate(offset[0], offset[1]) + strScale(scaleRatio));
@@ -223,7 +223,7 @@ function findAccessToken(gd, mapboxIds) {
223223
var context = gd._context;
224224

225225
// special case for Mapbox Atlas users
226-
if (context.mapboxAccessToken === '') return '';
226+
if(context.mapboxAccessToken === '') return '';
227227

228228
var tokensUseful = [];
229229
var tokensListed = [];
@@ -232,42 +232,42 @@ function findAccessToken(gd, mapboxIds) {
232232

233233
// Take the first token we find in a mapbox subplot.
234234
// These default to the context value but may be overridden.
235-
for (var i = 0; i < mapboxIds.length; i++) {
235+
for(var i = 0; i < mapboxIds.length; i++) {
236236
var opts = fullLayout[mapboxIds[i]];
237237
var token = opts.accesstoken;
238238

239-
if (isStyleRequireAccessToken(opts.style)) {
240-
if (token) {
239+
if(isStyleRequireAccessToken(opts.style)) {
240+
if(token) {
241241
Lib.pushUnique(tokensUseful, token);
242242
} else {
243-
if (isStyleRequireAccessToken(opts._input.style)) {
243+
if(isStyleRequireAccessToken(opts._input.style)) {
244244
Lib.error('Uses Mapbox map style, but did not set an access token.');
245245
hasOneSetMapboxStyle = true;
246246
}
247247
wontWork = true;
248248
}
249249
}
250250

251-
if (token) {
251+
if(token) {
252252
Lib.pushUnique(tokensListed, token);
253253
}
254254
}
255255

256-
if (wontWork) {
256+
if(wontWork) {
257257
var msg = hasOneSetMapboxStyle ?
258258
constants.noAccessTokenErrorMsg :
259259
constants.missingStyleErrorMsg;
260260
Lib.error(msg);
261261
throw new Error(msg);
262262
}
263263

264-
if (tokensUseful.length) {
265-
if (tokensUseful.length > 1) {
264+
if(tokensUseful.length) {
265+
if(tokensUseful.length > 1) {
266266
Lib.warn(constants.multipleTokensErrorMsg);
267267
}
268268
return tokensUseful[0];
269269
} else {
270-
if (tokensListed.length) {
270+
if(tokensListed.length) {
271271
Lib.log([
272272
'Listed mapbox access token(s)', tokensListed.join(','),
273273
'but did not use a Mapbox map style, ignoring token(s).'
@@ -285,11 +285,11 @@ function isStyleRequireAccessToken(s) {
285285
);
286286
}
287287

288-
exports.updateFx = function (gd) {
288+
exports.updateFx = function(gd) {
289289
var fullLayout = gd._fullLayout;
290290
var subplotIds = fullLayout._subplots[MAPBOX];
291291

292-
for (var i = 0; i < subplotIds.length; i++) {
292+
for(var i = 0; i < subplotIds.length; i++) {
293293
var subplotObj = fullLayout[subplotIds[i]]._subplot;
294294
subplotObj.updateFx(fullLayout);
295295
}

‎src/traces/choroplethmapbox/index.js

Copy file name to clipboardExpand all lines: src/traces/choroplethmapbox/index.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ module.exports = {
1616
eventData: require('../choropleth/event_data'),
1717
selectPoints: require('../choropleth/select'),
1818

19-
styleOnSelect: function (_, cd) {
20-
if (cd) {
19+
styleOnSelect: function(_, cd) {
20+
if(cd) {
2121
var trace = cd[0].trace;
2222
trace._glTrace.updateOnSelect(cd);
2323
}
2424
},
2525

26-
getBelow: function (trace, subplot) {
26+
getBelow: function(trace, subplot) {
2727
var mapLayers = subplot.getMapLayers();
2828

2929
// find layer just above top-most "water" layer
3030
// that is not a plotly layer
31-
for (var i = mapLayers.length - 2; i >= 0; i--) {
31+
for(var i = mapLayers.length - 2; i >= 0; i--) {
3232
var layerId = mapLayers[i].id;
3333

34-
if (typeof layerId === 'string' &&
34+
if(typeof layerId === 'string' &&
3535
layerId.indexOf('water') === 0
3636
) {
37-
for (var j = i + 1; j < mapLayers.length; j++) {
37+
for(var j = i + 1; j < mapLayers.length; j++) {
3838
layerId = mapLayers[j].id;
3939

40-
if (typeof layerId === 'string' &&
40+
if(typeof layerId === 'string' &&
4141
layerId.indexOf('plotly-') === -1
4242
) {
4343
return layerId;

‎src/traces/densitymapbox/index.js

Copy file name to clipboardExpand all lines: src/traces/densitymapbox/index.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ module.exports = {
1616
hoverPoints: require('./hover'),
1717
eventData: require('./event_data'),
1818

19-
getBelow: function (trace, subplot) {
19+
getBelow: function(trace, subplot) {
2020
var mapLayers = subplot.getMapLayers();
2121

2222
// find first layer with `type: 'symbol'`,
2323
// that is not a plotly layer
24-
for (var i = 0; i < mapLayers.length; i++) {
24+
for(var i = 0; i < mapLayers.length; i++) {
2525
var layer = mapLayers[i];
2626
var layerId = layer.id;
27-
if (layer.type === 'symbol' &&
27+
if(layer.type === 'symbol' &&
2828
typeof layerId === 'string' && layerId.indexOf('plotly-') === -1
2929
) {
3030
return layerId;

‎src/traces/scattermapbox/index.js

Copy file name to clipboardExpand all lines: src/traces/scattermapbox/index.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ module.exports = {
1717
eventData: require('./event_data'),
1818
selectPoints: require('./select'),
1919

20-
styleOnSelect: function (_, cd) {
21-
if (cd) {
20+
styleOnSelect: function(_, cd) {
21+
if(cd) {
2222
var trace = cd[0].trace;
2323
trace._glTrace.update(cd);
2424
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.