Skip to content

Commit 525e3c7

Browse files
committed
lint
1 parent 88f552a commit 525e3c7

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

src/plots/plots.js

+23-21
Original file line numberDiff line numberDiff line change
@@ -435,23 +435,29 @@ plots.sendDataToCloud = function(gd) {
435435
return false;
436436
};
437437

438+
// Fill in default values:
439+
//
440+
// gd.data, gd.layout:
441+
// are precisely what the user specified
442+
//
443+
// gd._fullData, gd._fullLayout:
444+
// are complete descriptions of how to draw the plot
445+
//
446+
// gd._fullLayout._modules
447+
// is a list of all the trace modules required to draw the plot
448+
//
438449
plots.supplyDefaults = function(gd) {
439-
// fill in default values:
440-
// gd.data, gd.layout:
441-
// are precisely what the user specified
442-
// gd._fullData, gd._fullLayout:
443-
// are complete descriptions of how to draw the plot
444450
var oldFullLayout = gd._fullLayout || {},
445451
newFullLayout = gd._fullLayout = {},
446-
newLayout = gd.layout || {},
447-
oldFullData = gd._fullData || [],
452+
newLayout = gd.layout || {};
453+
454+
var oldFullData = gd._fullData || [],
448455
newFullData = gd._fullData = [],
449-
newData = gd.data || [],
450456
newData = gd.data || [];
451457

452458
var modules = newFullLayout._modules = [];
453-
var i, trace, fullTrace, _module, axList, ax;
454459

460+
var i, _module;
455461

456462
// first fill in what we can of layout without looking at data
457463
// because fullData needs a few things from layout
@@ -462,9 +468,7 @@ plots.supplyDefaults = function(gd) {
462468

463469
// then do the data
464470
for(i = 0; i < newData.length; i++) {
465-
trace = newData[i];
466-
467-
fullTrace = plots.supplyDataDefaults(trace, i, newFullLayout);
471+
var fullTrace = plots.supplyDataDefaults(newData[i], i, newFullLayout);
468472
newFullData.push(fullTrace);
469473

470474
// detect plot type
@@ -476,8 +480,9 @@ plots.supplyDefaults = function(gd) {
476480
else if(plots.traceIs(fullTrace, 'ternary')) newFullLayout._hasTernary = true;
477481
else if('r' in fullTrace) newFullLayout._hasPolar = true;
478482

483+
// fill in modules list
479484
_module = fullTrace._module;
480-
if(_module && modules.indexOf(_module)===-1) modules.push(_module);
485+
if(_module && modules.indexOf(_module) === -1) modules.push(_module);
481486
}
482487

483488
// special cases that introduce interactions between traces
@@ -498,27 +503,24 @@ plots.supplyDefaults = function(gd) {
498503
// clean subplots and other artifacts from previous plot calls
499504
plots.cleanPlot(newFullData, newFullLayout, oldFullData, oldFullLayout);
500505

501-
/*
502-
* Relink functions and underscore attributes to promote consistency between
503-
* plots.
504-
*/
506+
// relink functions and _ attributes to promote consistency between plots
505507
relinkPrivateKeys(newFullLayout, oldFullLayout);
506508

507509
plots.doAutoMargin(gd);
508510

509511
// can't quite figure out how to get rid of this... each axis needs
510512
// a reference back to the DOM object for just a few purposes
511-
axList = Plotly.Axes.list(gd);
513+
var axList = Plotly.Axes.list(gd);
512514
for(i = 0; i < axList.length; i++) {
513-
ax = axList[i];
515+
var ax = axList[i];
514516
ax._gd = gd;
515517
ax.setScale();
516518
}
517519

518520
// update object references in calcdata
519521
if((gd.calcdata || []).length === newFullData.length) {
520522
for(i = 0; i < newFullData.length; i++) {
521-
trace = newFullData[i];
523+
var trace = newFullData[i];
522524
(gd.calcdata[i][0] || {}).trace = trace;
523525
}
524526
}
@@ -725,7 +727,7 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut) {
725727
plots.supplyLayoutModuleDefaults = function(layoutIn, layoutOut, fullData) {
726728
var i, _module;
727729

728-
// TODO incorporate into subplotRegistry
730+
// TODO incorporate into subplotsRegistry
729731
Plotly.Axes.supplyLayoutDefaults(layoutIn, layoutOut, fullData);
730732

731733
// plot module layout defaults

0 commit comments

Comments
 (0)