@@ -114,11 +114,13 @@ proto.handlePick = function(pickResult) {
114114 index = this . idToIndex [ pickResult . pointId ] ;
115115 }
116116
117+ var x = this . pickXData [ index ] ;
118+
117119 return {
118120 trace : this ,
119121 dataCoord : pickResult . dataCoord ,
120122 traceCoord : [
121- Number ( this . pickXData [ index ] ) , // non-fancy scattergl has Dates
123+ isNumeric ( x ) || ! Lib . isDateTime ( x ) ? x : Lib . dateTime2ms ( x ) ,
122124 this . pickYData [ index ]
123125 ] ,
124126 textLabel : Array . isArray ( this . textLabels ) ?
@@ -270,7 +272,7 @@ proto.updateFast = function(options) {
270272 pId = 0 ,
271273 ptr = 0 ;
272274
273- var xx , yy ;
275+ var xx , yy , fastType ;
274276
275277 // TODO add 'very fast' mode that bypasses this loop
276278 // TODO bypass this on modebar +/- zoom
@@ -279,18 +281,24 @@ proto.updateFast = function(options) {
279281 yy = y [ i ] ;
280282
281283 // check for isNaN is faster but doesn't skip over nulls
282- if ( ! isNumeric ( yy ) ) continue ;
283- if ( ! isNumeric ( xx ) && ! ( xx instanceof Date ) ) continue ;
284+ fastType = isNumeric ( xx ) || xx instanceof Date ;
284285
285- idToIndex [ pId ++ ] = i ;
286+ if ( isNumeric ( yy ) && ( fastType || Lib . isDateTime ( xx ) ) ) {
286287
287- positions [ ptr ++ ] = xx ;
288- positions [ ptr ++ ] = yy ;
288+ if ( ! fastType ) {
289+ xx = Lib . dateTime2ms ( xx ) ;
290+ }
291+
292+ idToIndex [ pId ++ ] = i ;
289293
290- bounds [ 0 ] = Math . min ( bounds [ 0 ] , xx ) ;
291- bounds [ 1 ] = Math . min ( bounds [ 1 ] , yy ) ;
292- bounds [ 2 ] = Math . max ( bounds [ 2 ] , xx ) ;
293- bounds [ 3 ] = Math . max ( bounds [ 3 ] , yy ) ;
294+ positions [ ptr ++ ] = xx ;
295+ positions [ ptr ++ ] = yy ;
296+
297+ bounds [ 0 ] = Math . min ( bounds [ 0 ] , xx ) ;
298+ bounds [ 1 ] = Math . min ( bounds [ 1 ] , yy ) ;
299+ bounds [ 2 ] = Math . max ( bounds [ 2 ] , xx ) ;
300+ bounds [ 3 ] = Math . max ( bounds [ 3 ] , yy ) ;
301+ }
294302 }
295303
296304 positions = truncate ( positions , ptr ) ;
0 commit comments