Skip to content

Commit dc72d33

Browse files
committed
fix typos
1 parent f3e1c2b commit dc72d33

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

src/plot_api/plot_api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,13 @@ Plotly.plot = function(gd, data, layout, config) {
249249
function drawData() {
250250
var calcdata = gd.calcdata;
251251

252+
// in case of traces that were heatmaps or contour maps
253+
// previously, remove them and their colorbars explicitly
252254
for(var i = 0; i < calcdata.length; i++) {
253255
var trace = calcdata[i][0].trace,
254256
isVisible = (trace.visible === true),
255257
uid = trace.uid;
256258

257-
// in case of traces that were heatmaps or contour maps
258-
// previously, remove them and their colorbars explicitly
259259
if(!isVisible || !Plots.traceIs(trace, '2dMap')) {
260260
fullLayout._paper.selectAll(
261261
'.hm' + uid +

src/plots/plots.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ plots.registerSubplot = function(_module) {
145145
* in the defaults step. Use plots.getSubplotIds to grab the current
146146
* subplot ids later on in Plotly.plot.
147147
*
148-
* @param {array} data plotly data array
148+
* @param {array} data : plotly data array
149149
* (intended to be _fullData, but does not have to be).
150-
* @param {object} layout plotly layout object
150+
* @param {object} layout : plotly layout object
151151
* (intended to be _fullLayout, but does not have to be).
152-
* @param {string} type subplot type to look for.
152+
* @param {string} type : subplot type to look for.
153153
*
154154
* @return {array} list of subplot ids (strings).
155-
* N.B. these ids possibly un-ordered.
155+
* N.B. these ids are possibly un-ordered.
156156
*
157157
* TODO incorporate cartesian/gl2d axis finders in this paradigm.
158158
*/
@@ -189,8 +189,8 @@ plots.findSubplotIds = function findSubplotIds(data, layout, type) {
189189
/**
190190
* Get the ids of the current subplots.
191191
*
192-
* @param {object} layout plotly full layout object.
193-
* @param {string} type subplot type to look for.
192+
* @param {object} layout : plotly full layout object.
193+
* @param {string} type : subplot type to look for.
194194
*
195195
* @return {array} list of ordered subplot ids (strings).
196196
*
@@ -231,9 +231,9 @@ plots.getSubplotIds = function getSubplotIds(layout, type) {
231231
/**
232232
* Get the data traces associated with a particular subplot.
233233
*
234-
* @param {object} layout plotly layout object
234+
* @param {object} layout : plotly layout object
235235
* (intended to be _fullLayout, but does not have to be).
236-
* @param {string} type subplot type to look for.
236+
* @param {string} type : subplot type to look for.
237237
*
238238
* @return {array} array of plotly traces.
239239
*
@@ -503,7 +503,7 @@ plots.supplyDefaults = function(gd) {
503503
// finally, fill in the pieces of layout that may need to look at data
504504
plots.supplyLayoutModuleDefaults(newLayout, newFullLayout, newFullData);
505505

506-
// clean subplots and other artifact from previous plot calls
506+
// clean subplots and other artifacts from previous plot calls
507507
cleanPlot(newFullData, newFullLayout, oldFullData, oldFullLayout);
508508

509509
/*
@@ -550,27 +550,26 @@ function cleanPlot(newFullData, newFullLayout, oldFullData, oldFullLayout) {
550550
oldLoop:
551551
for(i = 0; i < oldFullData.length; i++) {
552552
var oldTrace = oldFullData[i];
553+
var oldUid = oldTrace.uid;
553554

554555
for(j = 0; j < newFullData.length; j++) {
555-
var newTrace = newFullData.length;
556+
var newTrace = newFullData[j];
556557

557-
if(oldTrace.uid === newTrace.uid) continue oldLoop;
558+
if(oldUid === newTrace.uid) continue oldLoop;
558559
}
559560

560-
var uid = oldTrace.uid;
561-
562561
// clean old heatmap and contour traces
563562
if(hasPaper) {
564563
oldFullLayout._paper.selectAll(
565-
'.hm' + uid +
566-
',.contour' + uid +
567-
',#clip' + uid
564+
'.hm' + oldUid +
565+
',.contour' + oldUid +
566+
',#clip' + oldUid
568567
).remove();
569568
}
570569

571570
// clean old colorbars
572571
if(hasInfoLayer) {
573-
oldFullLayout._infolayer.selectAll('.cb' + uid).remove();
572+
oldFullLayout._infolayer.selectAll('.cb' + oldUid).remove();
574573
}
575574
}
576575
}

0 commit comments

Comments
 (0)