diff --git a/src/traces/scattergl/convert.js b/src/traces/scattergl/convert.js index a0088cb696f..5a75c56cc26 100644 --- a/src/traces/scattergl/convert.js +++ b/src/traces/scattergl/convert.js @@ -59,7 +59,7 @@ function convertStyle(gd, trace) { opts.markerSel = convertMarkerSelection(trace, trace.selected); opts.markerUnsel = convertMarkerSelection(trace, trace.unselected); - if(!trace.unselected && Array.isArray(trace.marker.opacity)) { + if(!trace.unselected && Lib.isArrayOrTypedArray(trace.marker.opacity)) { var mo = trace.marker.opacity; opts.markerUnsel.opacity = new Array(mo.length); for(i = 0; i < mo.length; i++) { @@ -187,15 +187,18 @@ function convertTextStyle(gd, trace) { optsOut.color = tfc; } - if(Array.isArray(tfs) || Array.isArray(tff)) { + if(Lib.isArrayOrTypedArray(tfs) || Array.isArray(tff)) { // if any textfont param is array - make render a batch optsOut.font = new Array(count); for(i = 0; i < count; i++) { var fonti = optsOut.font[i] = {}; - fonti.size = Array.isArray(tfs) ? - (isNumeric(tfs[i]) ? tfs[i] : 0) : - tfs; + fonti.size = ( + Lib.isTypedArray(tfs) ? tfs[i] : + Array.isArray(tfs) ? ( + isNumeric(tfs[i]) ? tfs[i] : 0 + ) : tfs + ); fonti.family = Array.isArray(tff) ? tff[i] : tff; } @@ -214,7 +217,7 @@ function convertMarkerStyle(trace) { var optsOut = {}; var i; - var multiSymbol = Array.isArray(optsIn.symbol); + var multiSymbol = Lib.isArrayOrTypedArray(optsIn.symbol); var multiColor = Lib.isArrayOrTypedArray(optsIn.color); var multiLineColor = Lib.isArrayOrTypedArray(optsIn.line.color); var multiOpacity = Lib.isArrayOrTypedArray(optsIn.opacity); diff --git a/src/traces/scattergl/hover.js b/src/traces/scattergl/hover.js index 04709c058ee..6e7c03a947c 100644 --- a/src/traces/scattergl/hover.js +++ b/src/traces/scattergl/hover.js @@ -109,7 +109,7 @@ function calcHover(pointData, x, y, trace) { var font = trace.textfont; if(font) { - di.ts = Array.isArray(font.size) ? font.size[id] : font.size; + di.ts = Lib.isArrayOrTypedArray(font.size) ? font.size[id] : font.size; di.tc = Array.isArray(font.color) ? font.color[id] : font.color; di.tf = Array.isArray(font.family) ? font.family[id] : font.family; } @@ -118,7 +118,7 @@ function calcHover(pointData, x, y, trace) { if(marker) { di.ms = Lib.isArrayOrTypedArray(marker.size) ? marker.size[id] : marker.size; di.mo = Lib.isArrayOrTypedArray(marker.opacity) ? marker.opacity[id] : marker.opacity; - di.mx = Array.isArray(marker.symbol) ? marker.symbol[id] : marker.symbol; + di.mx = Lib.isArrayOrTypedArray(marker.symbol) ? marker.symbol[id] : marker.symbol; di.mc = Lib.isArrayOrTypedArray(marker.color) ? marker.color[id] : marker.color; } @@ -143,10 +143,10 @@ function calcHover(pointData, x, y, trace) { if(hoverlabel) { di.hbg = Array.isArray(hoverlabel.bgcolor) ? hoverlabel.bgcolor[id] : hoverlabel.bgcolor; di.hbc = Array.isArray(hoverlabel.bordercolor) ? hoverlabel.bordercolor[id] : hoverlabel.bordercolor; - di.hts = Array.isArray(hoverlabel.font.size) ? hoverlabel.font.size[id] : hoverlabel.font.size; + di.hts = Lib.isArrayOrTypedArray(hoverlabel.font.size) ? hoverlabel.font.size[id] : hoverlabel.font.size; di.htc = Array.isArray(hoverlabel.font.color) ? hoverlabel.font.color[id] : hoverlabel.font.color; di.htf = Array.isArray(hoverlabel.font.family) ? hoverlabel.font.family[id] : hoverlabel.font.family; - di.hnl = Array.isArray(hoverlabel.namelength) ? hoverlabel.namelength[id] : hoverlabel.namelength; + di.hnl = Lib.isArrayOrTypedArray(hoverlabel.namelength) ? hoverlabel.namelength[id] : hoverlabel.namelength; } var hoverinfo = trace.hoverinfo; if(hoverinfo) {