@@ -16,6 +16,7 @@ var fill = require('ndarray-fill');
1616var ops = require ( 'ndarray-ops' ) ;
1717var tinycolor = require ( 'tinycolor2' ) ;
1818
19+ var Lib = require ( '../../lib' ) ;
1920var str2RgbaArray = require ( '../../lib/str2rgbarray' ) ;
2021
2122var MIN_RESOLUTION = 128 ;
@@ -45,17 +46,17 @@ proto.handlePick = function(selection) {
4546 ] ;
4647 var traceCoordinate = [ 0 , 0 , 0 ] ;
4748
48- if ( ! Array . isArray ( this . data . x ) ) {
49+ if ( ! Lib . isArrayOrTypedArray ( this . data . x ) ) {
4950 traceCoordinate [ 0 ] = selectIndex [ 0 ] ;
50- } else if ( Array . isArray ( this . data . x [ 0 ] ) ) {
51+ } else if ( Lib . isArrayOrTypedArray ( this . data . x [ 0 ] ) ) {
5152 traceCoordinate [ 0 ] = this . data . x [ selectIndex [ 1 ] ] [ selectIndex [ 0 ] ] ;
5253 } else {
5354 traceCoordinate [ 0 ] = this . data . x [ selectIndex [ 0 ] ] ;
5455 }
5556
56- if ( ! Array . isArray ( this . data . y ) ) {
57+ if ( ! Lib . isArrayOrTypedArray ( this . data . y ) ) {
5758 traceCoordinate [ 1 ] = selectIndex [ 1 ] ;
58- } else if ( Array . isArray ( this . data . y [ 0 ] ) ) {
59+ } else if ( Lib . isArrayOrTypedArray ( this . data . y [ 0 ] ) ) {
5960 traceCoordinate [ 1 ] = this . data . y [ selectIndex [ 1 ] ] [ selectIndex [ 0 ] ] ;
6061 } else {
6162 traceCoordinate [ 1 ] = this . data . y [ selectIndex [ 1 ] ] ;
@@ -231,11 +232,11 @@ proto.update = function(data) {
231232 } ) ;
232233
233234 // coords x
234- if ( ! Array . isArray ( x ) ) {
235+ if ( ! Lib . isArrayOrTypedArray ( x ) ) {
235236 fill ( xc , function ( row ) {
236237 return xaxis . d2l ( row , 0 , xcalendar ) * scaleFactor [ 0 ] ;
237238 } ) ;
238- } else if ( Array . isArray ( x [ 0 ] ) ) {
239+ } else if ( Lib . isArrayOrTypedArray ( x [ 0 ] ) ) {
239240 fill ( xc , function ( row , col ) {
240241 return xaxis . d2l ( x [ col ] [ row ] , 0 , xcalendar ) * scaleFactor [ 0 ] ;
241242 } ) ;
@@ -247,11 +248,11 @@ proto.update = function(data) {
247248 }
248249
249250 // coords y
250- if ( ! Array . isArray ( x ) ) {
251+ if ( ! Lib . isArrayOrTypedArray ( x ) ) {
251252 fill ( yc , function ( row , col ) {
252253 return yaxis . d2l ( col , 0 , xcalendar ) * scaleFactor [ 1 ] ;
253254 } ) ;
254- } else if ( Array . isArray ( y [ 0 ] ) ) {
255+ } else if ( Lib . isArrayOrTypedArray ( y [ 0 ] ) ) {
255256 fill ( yc , function ( row , col ) {
256257 return yaxis . d2l ( y [ col ] [ row ] , 0 , ycalendar ) * scaleFactor [ 1 ] ;
257258 } ) ;
0 commit comments