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

Skip to content

Commit 4aca315

Browse files
committed
lint in scattergl.plot
1 parent 6fda595 commit 4aca315

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

src/traces/scattergl/index.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -395,15 +395,16 @@ function plot(gd, subplot, cdata) {
395395
scene.line2d.update(scene.lineOptions);
396396
scene.lineOptions = scene.lineOptions.map(function(lineOptions) {
397397
if(lineOptions && lineOptions.positions) {
398-
var pos = [], srcPos = lineOptions.positions;
398+
var pos = [];
399+
var srcPos = lineOptions.positions;
399400

400401
var firstptdef = 0;
401402
while(isNaN(srcPos[firstptdef]) || isNaN(srcPos[firstptdef + 1])) {
402403
firstptdef += 2;
403404
}
404405
var lastptdef = srcPos.length - 2;
405406
while(isNaN(srcPos[lastptdef]) || isNaN(srcPos[lastptdef + 1])) {
406-
lastptdef += -2;
407+
lastptdef -= 2;
407408
}
408409
pos = pos.concat(srcPos.slice(firstptdef, lastptdef + 2));
409410
lineOptions.positions = pos;
@@ -437,36 +438,38 @@ function plot(gd, subplot, cdata) {
437438
if(trace._nexttrace) fillData.push(i + 1);
438439
if(fillData.length) scene.fillOrder[i] = fillData;
439440

440-
var pos = [], srcPos = (lineOptions && lineOptions.positions) || stash.positions;
441+
var pos = [];
442+
var srcPos = (lineOptions && lineOptions.positions) || stash.positions;
443+
var firstptdef, lastptdef;
441444

442445
if(trace.fill === 'tozeroy') {
443-
var firstpdef = 0;
444446
while(isNaN(srcPos[firstpdef + 1])) {
445-
firstpdef += 2;
447+
firstptdef = 0;
448+
firstptdef += 2;
446449
}
447-
var lastpdef = srcPos.length - 2;
448450
while(isNaN(srcPos[lastpdef + 1])) {
449-
lastpdef += -2;
451+
lastptdef = srcPos.length - 2;
452+
lastptdef -= 2;
450453
}
451-
if(srcPos[firstpdef + 1] !== 0) {
452-
pos = [ srcPos[firstpdef], 0 ];
454+
if(srcPos[firstptdef + 1] !== 0) {
455+
pos = [srcPos[firstptdef], 0];
453456
}
454-
pos = pos.concat(srcPos.slice(firstpdef, lastpdef + 2));
455-
if(srcPos[lastpdef + 1] !== 0) {
456-
pos = pos.concat([ srcPos[lastpdef], 0 ]);
457+
pos = pos.concat(srcPos.slice(firstptdef, lastptdef + 2));
458+
if(srcPos[lastptdef + 1] !== 0) {
459+
pos = pos.concat([srcPos[lastptdef], 0]);
457460
}
458461
}
459462
else if(trace.fill === 'tozerox') {
460-
var firstptdef = 0;
461463
while(isNaN(srcPos[firstptdef])) {
464+
firstptdef = 0;
462465
firstptdef += 2;
463466
}
464-
var lastptdef = srcPos.length - 2;
465467
while(isNaN(srcPos[lastptdef])) {
466-
lastptdef += -2;
468+
lastptdef = srcPos.length - 2;
469+
lastptdef -= 2;
467470
}
468471
if(srcPos[firstptdef] !== 0) {
469-
pos = [ 0, srcPos[firstptdef + 1] ];
472+
pos = [0, srcPos[firstptdef + 1]];
470473
}
471474
pos = pos.concat(srcPos.slice(firstptdef, lastptdef + 2));
472475
if(srcPos[lastptdef] !== 0) {

0 commit comments

Comments
 (0)