Skip to content

Commit 66494c7

Browse files
committed
some linting
1 parent 59588cc commit 66494c7

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

src/plots/cartesian/dragbox.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -717,11 +717,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
717717
// FIXME: code duplication with cartesian.plot
718718
if(fullLayout._glcanvas && fullLayout._glcanvas.size()) {
719719
fullLayout._glcanvas.each(function(d) {
720-
if(d.regl) {
721-
d.regl.clear({
722-
color: true
723-
});
724-
}
720+
if(d.regl) d.regl.clear({color: true});
725721
});
726722
}
727723

@@ -735,8 +731,8 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
735731
// scattergl translate
736732
if(subplot._scene && subplot._scene.update) {
737733
// FIXME: possibly we could update axis internal _r and _rl here
738-
var xaRange = Lib.simpleMap(xa2.range, xa2.r2l),
739-
yaRange = Lib.simpleMap(ya2.range, ya2.r2l);
734+
var xaRange = Lib.simpleMap(xa2.range, xa2.r2l);
735+
var yaRange = Lib.simpleMap(ya2.range, ya2.r2l);
740736
subplot._scene.update(
741737
{range: [xaRange[0], yaRange[0], xaRange[1], yaRange[1]]}
742738
);

src/plots/cartesian/index.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,13 @@ function plotOne(gd, plotinfo, cdSubplot, transitionOpts, makeOnCompleteCallback
221221
}
222222

223223
exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {
224-
var oldModules = oldFullLayout._modules || [],
225-
newModules = newFullLayout._modules || [];
224+
var oldModules = oldFullLayout._modules || [];
225+
var newModules = newFullLayout._modules || [];
226+
var oldPlots = oldFullLayout._plots || {};
226227

227-
var hadScatter, hasScatter, hadGl, hasGl, i, oldPlots, ids, subplotInfo, moduleName;
228+
var hadScatter, hasScatter;
229+
var hadGl, hasGl;
230+
var i, k, subplotInfo, moduleName;
228231

229232

230233
for(i = 0; i < oldModules.length; i++) {
@@ -240,12 +243,8 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout)
240243
}
241244

242245
if(hadScatter && !hasScatter) {
243-
oldPlots = oldFullLayout._plots;
244-
ids = Object.keys(oldPlots || {});
245-
246-
for(i = 0; i < ids.length; i++) {
247-
subplotInfo = oldPlots[ids[i]];
248-
246+
for(k in oldPlots) {
247+
subplotInfo = oldPlots[k];
249248
if(subplotInfo.plot) {
250249
subplotInfo.plot.select('g.scatterlayer')
251250
.selectAll('g.trace')
@@ -260,11 +259,8 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout)
260259
}
261260

262261
if(hadGl && !hasGl) {
263-
oldPlots = oldFullLayout._plots;
264-
ids = Object.keys(oldPlots || {});
265-
266-
for(i = 0; i < ids.length; i++) {
267-
subplotInfo = oldPlots[ids[i]];
262+
for(k in oldPlots) {
263+
subplotInfo = oldPlots[k];
268264

269265
if(subplotInfo._scene) {
270266
subplotInfo._scene.destroy();

0 commit comments

Comments
 (0)