Skip to content

Commit 2059d2a

Browse files
committed
handle typed arrays in axes ticktext, hoverlabel & getDataConversions
1 parent 25d3b4f commit 2059d2a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/plots/cartesian/axes.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ var getDataConversions = axes.getDataConversions = function(gd, trace, target, t
228228
// In the case of an array target, make a mock data array
229229
// and call supplyDefaults to the data type and
230230
// setup the data-to-calc method.
231-
if(Array.isArray(d2cTarget)) {
231+
if(Lib.isArrayOrTypedArray(d2cTarget)) {
232232
ax = {
233233
type: autoType(targetArray, undefined, {
234234
autotypenumbers: gd._fullLayout.autotypenumbers
@@ -1282,7 +1282,7 @@ function arrayTicks(ax) {
12821282

12831283
// without a text array, just format the given values as any other ticks
12841284
// except with more precision to the numbers
1285-
if(!Array.isArray(text)) text = [];
1285+
if(!Lib.isArrayOrTypedArray(text)) text = [];
12861286

12871287
for(var i = 0; i < vals.length; i++) {
12881288
var vali = tickVal2l(vals[i]);
@@ -1618,7 +1618,7 @@ axes.tickText = function(ax, x, hover, noSuffixPrefix) {
16181618
var tickVal2l = axType === 'category' ? ax.d2l_noadd : ax.d2l;
16191619
var i;
16201620

1621-
if(arrayMode && Array.isArray(ax.ticktext)) {
1621+
if(arrayMode && Lib.isArrayOrTypedArray(ax.ticktext)) {
16221622
var rng = Lib.simpleMap(ax.range, ax.r2l);
16231623
var minDiff = (Math.abs(rng[1] - rng[0]) - (ax._lBreaks || 0)) / 10000;
16241624

@@ -1697,8 +1697,8 @@ axes.tickText = function(ax, x, hover, noSuffixPrefix) {
16971697
axes.hoverLabelText = function(ax, values, hoverformat) {
16981698
if(hoverformat) ax = Lib.extendFlat({}, ax, {hoverformat: hoverformat});
16991699

1700-
var val = Array.isArray(values) ? values[0] : values;
1701-
var val2 = Array.isArray(values) ? values[1] : undefined;
1700+
var val = Lib.isArrayOrTypedArray(values) ? values[0] : values;
1701+
var val2 = Lib.isArrayOrTypedArray(values) ? values[1] : undefined;
17021702
if(val2 !== undefined && val2 !== val) {
17031703
return (
17041704
axes.hoverLabelText(ax, val, hoverformat) + ' - ' +

0 commit comments

Comments
 (0)