Skip to content

Commit 05d8b1c

Browse files
committed
lint (mostly scoped variables)
1 parent b1700a7 commit 05d8b1c

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

src/plot_api/plot_api.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,16 @@ Plotly.plot = function(gd, data, layout, config) {
256256

257257
function getCdSubplot(calcdata, subplot) {
258258
var cdSubplot = [];
259-
var i, cd, trace;
260-
for (i = 0; i < calcdata.length; i++) {
261-
cd = calcdata[i];
262-
trace = cd[0].trace;
263-
if (trace.xaxis+trace.yaxis === subplot) cdSubplot.push(cd);
259+
260+
for(var i = 0; i < calcdata.length; i++) {
261+
var cd = calcdata[i];
262+
var trace = cd[0].trace;
263+
264+
if(trace.xaxis + trace.yaxis === subplot) {
265+
cdSubplot.push(cd);
266+
}
264267
}
268+
265269
return cdSubplot;
266270
}
267271

src/plots/gl3d/layout/defaults.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,27 @@
99

1010
'use strict';
1111

12-
var Plotly = require('../../../plotly');
12+
var Lib = require('../../../lib');
13+
var Plots = require('../../plots');
1314
var layoutAttributes = require('./layout_attributes');
1415
var supplyGl3dAxisLayoutDefaults = require('./axis_defaults');
1516

1617

1718
module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
18-
if (!layoutOut._hasGL3D) return;
19+
if(!layoutOut._hasGL3D) return;
1920

20-
var scenes = Plotly.Plots.getSubplotIdsInData(fullData, 'gl3d');
21-
var i;
21+
var scenes = Plots.getSubplotIdsInData(fullData, 'gl3d');
2222

2323
// Get number of scenes to compute default scene domain
2424
var scenesLength = scenes.length;
25+
2526
var sceneLayoutIn, sceneLayoutOut;
2627

2728
function coerce(attr, dflt) {
28-
return Plotly.Lib.coerce(sceneLayoutIn, sceneLayoutOut, layoutAttributes, attr, dflt);
29+
return Lib.coerce(sceneLayoutIn, sceneLayoutOut, layoutAttributes, attr, dflt);
2930
}
3031

31-
for (i = 0; i < scenesLength; ++i) {
32+
for(var i = 0; i < scenesLength; i++) {
3233
var scene = scenes[i];
3334
/*
3435
* Scene numbering proceeds as follows
@@ -41,7 +42,7 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
4142
* Also write back a blank scene object to user layout so that some
4243
* attributes like aspectratio can be written back dynamically.
4344
*/
44-
sceneLayoutIn;
45+
4546
if(layoutIn[scene] !== undefined) sceneLayoutIn = layoutIn[scene];
4647
else layoutIn[scene] = sceneLayoutIn = {};
4748

@@ -78,10 +79,10 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
7879
* for the mode. In this case we must force change it here as the default coerce
7980
* misses it above.
8081
*/
81-
if (!hasAspect) {
82+
if(!hasAspect) {
8283
sceneLayoutIn.aspectratio = sceneLayoutOut.aspectratio = {x: 1, y: 1, z: 1};
8384

84-
if (aspectMode === 'manual') sceneLayoutOut.aspectmode = 'auto';
85+
if(aspectMode === 'manual') sceneLayoutOut.aspectmode = 'auto';
8586
}
8687

8788
/*

0 commit comments

Comments
 (0)