@@ -30,11 +30,12 @@ function Pointcloud(scene, uid) {
30
30
this . name = '' ;
31
31
this . hoverinfo = 'all' ;
32
32
33
- this . idToIndex = [ ] ;
33
+ this . idToIndex = new Int32Array ( 0 ) ;
34
34
this . bounds = [ 0 , 0 , 0 , 0 ] ;
35
35
36
36
this . pointcloudOptions = {
37
37
positions : new Float32Array ( 0 ) ,
38
+ idToIndex : this . idToIndex ,
38
39
sizemin : 0.5 ,
39
40
color : [ 0 , 0 , 0 , 1 ] ,
40
41
borderSize : 1 ,
@@ -83,11 +84,9 @@ proto.updateFast = function(options) {
83
84
var y = this . yData = this . pickYData = options . y ;
84
85
85
86
var len = x . length ,
86
- idToIndex = new Array ( len ) ,
87
+ idToIndex = new Int32Array ( len ) ,
87
88
positions = new Float32Array ( 2 * len ) ,
88
- bounds = this . bounds ,
89
- pId = 0 ,
90
- ptr = 0 ;
89
+ bounds = this . bounds ;
91
90
92
91
var xx , yy ;
93
92
@@ -98,21 +97,22 @@ proto.updateFast = function(options) {
98
97
yy = y [ i ] ;
99
98
100
99
// check for isNaN is faster but doesn't skip over nulls
101
- if ( ! isNumeric ( xx ) || ! isNumeric ( yy ) ) continue ;
100
+ // if(!isNumeric(xx) || !isNumeric(yy)) continue;
102
101
103
- idToIndex [ pId ++ ] = i ;
102
+ idToIndex [ i ] = i ;
104
103
105
- positions [ ptr ++ ] = xx ;
106
- positions [ ptr ++ ] = yy ;
104
+ positions [ i * 2 ] = xx ;
105
+ positions [ i * 2 + 1 ] = yy ;
107
106
108
107
bounds [ 0 ] = Math . min ( bounds [ 0 ] , xx ) ;
109
108
bounds [ 1 ] = Math . min ( bounds [ 1 ] , yy ) ;
110
109
bounds [ 2 ] = Math . max ( bounds [ 2 ] , xx ) ;
111
110
bounds [ 3 ] = Math . max ( bounds [ 3 ] , yy ) ;
112
111
}
113
112
114
- positions = truncate ( positions , ptr ) ;
113
+ // positions = truncate(positions, ptr);
115
114
this . idToIndex = idToIndex ;
115
+ this . pointcloudOptions . idToIndex = idToIndex ;
116
116
117
117
var markerSize ;
118
118
0 commit comments