@@ -145,14 +145,14 @@ plots.registerSubplot = function(_module) {
145
145
* in the defaults step. Use plots.getSubplotIds to grab the current
146
146
* subplot ids later on in Plotly.plot.
147
147
*
148
- * @param {array } data plotly data array
148
+ * @param {array } data : plotly data array
149
149
* (intended to be _fullData, but does not have to be).
150
- * @param {object } layout plotly layout object
150
+ * @param {object } layout : plotly layout object
151
151
* (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.
153
153
*
154
154
* @return {array } list of subplot ids (strings).
155
- * N.B. these ids possibly un-ordered.
155
+ * N.B. these ids are possibly un-ordered.
156
156
*
157
157
* TODO incorporate cartesian/gl2d axis finders in this paradigm.
158
158
*/
@@ -189,8 +189,8 @@ plots.findSubplotIds = function findSubplotIds(data, layout, type) {
189
189
/**
190
190
* Get the ids of the current subplots.
191
191
*
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.
194
194
*
195
195
* @return {array } list of ordered subplot ids (strings).
196
196
*
@@ -231,9 +231,9 @@ plots.getSubplotIds = function getSubplotIds(layout, type) {
231
231
/**
232
232
* Get the data traces associated with a particular subplot.
233
233
*
234
- * @param {object } layout plotly layout object
234
+ * @param {object } layout : plotly layout object
235
235
* (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.
237
237
*
238
238
* @return {array } array of plotly traces.
239
239
*
@@ -503,7 +503,7 @@ plots.supplyDefaults = function(gd) {
503
503
// finally, fill in the pieces of layout that may need to look at data
504
504
plots . supplyLayoutModuleDefaults ( newLayout , newFullLayout , newFullData ) ;
505
505
506
- // clean subplots and other artifact from previous plot calls
506
+ // clean subplots and other artifacts from previous plot calls
507
507
cleanPlot ( newFullData , newFullLayout , oldFullData , oldFullLayout ) ;
508
508
509
509
/*
@@ -550,27 +550,26 @@ function cleanPlot(newFullData, newFullLayout, oldFullData, oldFullLayout) {
550
550
oldLoop:
551
551
for ( i = 0 ; i < oldFullData . length ; i ++ ) {
552
552
var oldTrace = oldFullData [ i ] ;
553
+ var oldUid = oldTrace . uid ;
553
554
554
555
for ( j = 0 ; j < newFullData . length ; j ++ ) {
555
- var newTrace = newFullData . length ;
556
+ var newTrace = newFullData [ j ] ;
556
557
557
- if ( oldTrace . uid === newTrace . uid ) continue oldLoop;
558
+ if ( oldUid === newTrace . uid ) continue oldLoop;
558
559
}
559
560
560
- var uid = oldTrace . uid ;
561
-
562
561
// clean old heatmap and contour traces
563
562
if ( hasPaper ) {
564
563
oldFullLayout . _paper . selectAll (
565
- '.hm' + uid +
566
- ',.contour' + uid +
567
- ',#clip' + uid
564
+ '.hm' + oldUid +
565
+ ',.contour' + oldUid +
566
+ ',#clip' + oldUid
568
567
) . remove ( ) ;
569
568
}
570
569
571
570
// clean old colorbars
572
571
if ( hasInfoLayer ) {
573
- oldFullLayout . _infolayer . selectAll ( '.cb' + uid ) . remove ( ) ;
572
+ oldFullLayout . _infolayer . selectAll ( '.cb' + oldUid ) . remove ( ) ;
574
573
}
575
574
}
576
575
}
0 commit comments