diff --git a/src/traces/scattergl/convert.js b/src/traces/scattergl/convert.js index 74a2a1d9ea1..f99a4a73a62 100644 --- a/src/traces/scattergl/convert.js +++ b/src/traces/scattergl/convert.js @@ -401,7 +401,7 @@ proto.updateFast = function(options) { this.idToIndex = idToIndex; // form selected set - if(selection) { + if(selection && selection.length) { selPositions = new Float64Array(2 * selection.length); for(i = 0, l = selection.length; i < l; i++) { @@ -559,7 +559,7 @@ proto.updateFancy = function(options) { var sizes, selIds; - if(selection) { + if(selection && selection.length) { selIds = {}; for(i = 0; i < selection.length; i++) { selIds[selection[i].pointNumber] = true;