8000 lint · monfera/plotly.js@48d5957 · GitHub
[go: up one dir, main page]

Skip to content

Commit 48d5957

Browse files
committed
lint
1 parent 9354fb3 commit 48d5957

File tree

6 files changed

+28
-30
lines changed

6 files changed

+28
-30
lines changed

src/components/modebar/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
var d3 = require('d3');
1313

14-
var Plotly = require('../../plotly');
1514
var Lib = require('../../lib');
1615
var Icons = require('../../../build/ploticon');
1716

src/plot_api/plot_api.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -598,29 +598,28 @@ function cleanLayout(layout) {
598598
* Clean up Scene layouts
599599
*/
600600
var sceneIds = Plots.getSubplotIds(layout, 'gl3d');
601-
var scene, cameraposition, rotation,
602-
radius, center, mat, eye;
603-
for (i = 0; i < sceneIds.length; i++) {
604-
scene = layout[sceneIds[i]];
605-
606-
/*
607-
* Clean old Camera coords
608-
*/
609-
cameraposition = scene.cameraposition;
610-
if (Array.isArray(cameraposition) && cameraposition[0].length === 4) {
611-
rotation = cameraposition[0];
612-
center = cameraposition[1];
613-
radius = cameraposition[2];
614-
mat = m4FromQuat([], rotation);
615-
eye = [];
616-
for (j = 0; j < 3; ++j) {
601+
for(i = 0; i < sceneIds.length; i++) {
602+
var scene = layout[sceneIds[i]];
603+
604+
// clean old Camera coords
605+
var cameraposition = scene.cameraposition;
606+
if(Array.isArray(cameraposition) && cameraposition[0].length === 4) {
607+
var rotation = cameraposition[0],
608+
center = cameraposition[1],
609+
radius = cameraposition[2],
610+
mat = m4FromQuat([], rotation),
611+
eye = [];
612+
613+
for(j = 0; j < 3; ++j) {
617614
eye[j] = center[i] + radius * mat[2 + 4 * j];
618615
}
616+
619617
scene.camera = {
620618
eye: {x: eye[0], y: eye[1], z: eye[2]},
621619
center: {x: center[0], y: center[1], z: center[2]},
622620
up: {x: mat[1], y: mat[5], z: mat[9]}
623621
};
622+
624623
delete scene.cameraposition;
625624
}
626625
}

src/plots/cartesian/graph_interact.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var tinycolor = require('tinycolor2');
1414
var isNumeric = require('fast-isnumeric');
1515

1616
var Plotly = require('../../plotly');
17+
var Lib = require('../../lib');
1718
var Events = require('../../lib/events');
1819

1920
var prepSelect = require('./select');
@@ -43,20 +44,17 @@ fx.layoutAttributes = {
4344
};
4445

4546
fx.supplyLayoutDefaults = function(layoutIn, layoutOut, fullData) {
46-
var isHoriz, hovermodeDflt;
47-
4847
function coerce(attr, dflt) {
49-
return Plotly.Lib.coerce(layoutIn, layoutOut,
50-
fx.layoutAttributes,
51-
attr, dflt);
48+
return Lib.coerce(layoutIn, layoutOut, fx.layoutAttributes, attr, dflt);
5249
}
5350

5451
coerce('dragmode');
5552

53+
var hovermodeDflt;
5654
if(layoutOut._hasCartesian) {
5755
// flag for 'horizontal' plots:
5856
// determines the state of the mode bar 'compare' hovermode button
59-
isHoriz = layoutOut._isHoriz = fx.isHoriz(fullData);
57+
var isHoriz = layoutOut._isHoriz = fx.isHoriz(fullData);
6058
hovermodeDflt = isHoriz ? 'y' : 'x';
6159
}
6260
else hovermodeDflt = 'closest';
@@ -66,14 +64,16 @@ fx.supplyLayoutDefaults = function(layoutIn, layoutOut, fullData) {
6664

6765
fx.isHoriz = function(fullData) {
6866
var isHoriz = true;
69-
var i, trace;
70-
for (i = 0; i < fullData.length; i++) {
71-
trace = fullData[i];
72-
if (trace.orientation !== 'h') {
67+
68+
for(var i = 0; i < fullData.length; i++) {
69+
var trace = fullData[i];
70+
71+
if(trace.orientation !== 'h') {
7372
isHoriz = false;
7473
break;
7574
}
7675
}
76+
7777
return isHoriz;
7878
};
7979

src/plots/gl3d/layout/defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
4141

4242
var isValid = layoutAttributes[attr].values.indexOf(layoutIn[attr]) !== -1;
4343

44-
var dflt;
4544
if(isOnlyGL3D && isValid) return layoutIn[attr];
4645
}
4746

src/plots/gl3d/scene.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ function initializeGLPlot(scene, fullLayout, canvas, gl) {
131131

132132
try {
133133
scene.glplot = createPlot(glplotOptions);
134-
} catch (e) {
134+
}
135+
catch (e) {
135136
/*
136137
* createPlot will throw when webgl is not enabled in the client.
137138
* Lets return an instance of the module with all functions noop'd.

test/jasmine/tests/gl3dlayout_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var Gl3d = require('@src/plots/gl3d');
22

33

4-
fdescribe('Test Gl3d layout defaults', function() {
4+
describe('Test Gl3d layout defaults', function() {
55
'use strict';
66

77
describe('supplyLayoutDefaults', function() {

0 commit comments

Comments
 (0)
0