@@ -45,12 +45,17 @@ proto.handlePick = function(selection) {
45
45
] ;
46
46
var traceCoordinate = [ 0 , 0 , 0 ] ;
47
47
48
- if ( Array . isArray ( this . data . x [ 0 ] ) ) {
48
+ if ( ! Array . isArray ( this . data . x ) ) {
49
+ traceCoordinate [ 0 ] = selectIndex [ 0 ] ;
50
+ } else if ( Array . isArray ( this . data . x [ 0 ] ) ) {
49
51
traceCoordinate [ 0 ] = this . data . x [ selectIndex [ 1 ] ] [ selectIndex [ 0 ] ] ;
50
52
} else {
51
53
traceCoordinate [ 0 ] = this . data . x [ selectIndex [ 0 ] ] ;
52
54
}
53
- if ( Array . isArray ( this . data . y [ 0 ] ) ) {
55
+
56
+ if ( ! Array . isArray ( this . data . y ) ) {
57
+ traceCoordinate [ 1 ] = selectIndex [ 1 ] ;
58
+ } else if ( Array . isArray ( this . data . y [ 0 ] ) ) {
54
59
traceCoordinate [ 1 ] = this . data . y [ selectIndex [ 1 ] ] [ selectIndex [ 0 ] ] ;
55
60
} else {
56
61
traceCoordinate [ 1 ] = this . data . y [ selectIndex [ 1 ] ] ;
@@ -195,8 +200,8 @@ proto.update = function(data) {
195
200
yaxis = sceneLayout . yaxis ,
196
201
zaxis = sceneLayout . zaxis ,
197
202
scaleFactor = scene . dataScale ,
198
- xlen = z [ 0 ] . length ,
199
- ylen = z . length ,
203
+ xlen = data . _xlength ,
204
+ ylen = data . _ylength ,
200
205
coords = [
201
206
ndarray ( new Float32Array ( xlen * ylen ) , [ xlen , ylen ] ) ,
202
207
ndarray ( new Float32Array ( xlen * ylen ) , [ xlen , ylen ] ) ,
@@ -226,7 +231,11 @@ proto.update = function(data) {
226
231
} ) ;
227
232
228
233
// coords x
229
- if ( Array . isArray ( x [ 0 ] ) ) {
234
+ if ( ! Array . isArray ( x ) ) {
235
+ fill ( xc , function ( row ) {
236
+ return xaxis . d2l ( row , 0 , xcalendar ) * scaleFactor [ 0 ] ;
237
+ } ) ;
238
+ } else if ( Array . isArray ( x [ 0 ] ) ) {
230
239
fill ( xc , function ( row , col ) {
231
240
return xaxis . d2l ( x [ col ] [ row ] , 0 , xcalendar ) * scaleFactor [ 0 ] ;
232
241
} ) ;
@@ -238,7 +247,11 @@ proto.update = function(data) {
238
247
}
239
248
240
249
// coords y
241
- if ( Array . isArray ( y [ 0 ] ) ) {
250
+ if ( ! Array . isArray ( x ) ) {
251
+ fill ( yc , function ( row , col ) {
252
+ return yaxis . d2l ( col , 0 , xcalendar ) * scaleFactor [ 1 ] ;
253
+ } ) ;
254
+ } else if ( Array . isArray ( y [ 0 ] ) ) {
242
255
fill ( yc , function ( row , col ) {
243
256
return yaxis . d2l ( y [ col ] [ row ] , 0 , ycalendar ) * scaleFactor [ 1 ] ;
244
257
} ) ;
0 commit comments