Skip to content

Commit bae2e2e

Browse files
committed
straight-through processing
1 parent 51b0c98 commit bae2e2e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/traces/pointcloud/convert.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ function Pointcloud(scene, uid) {
3030
this.name = '';
3131
this.hoverinfo = 'all';
3232

33-
this.idToIndex = [];
33+
this.idToIndex = new Int32Array(0);
3434
this.bounds = [0, 0, 0, 0];
3535

3636
this.pointcloudOptions = {
3737
positions: new Float32Array(0),
38+
idToIndex: this.idToIndex,
3839
sizemin: 0.5,
3940
color: [0, 0, 0, 1],
4041
borderSize: 1,
@@ -83,11 +84,9 @@ proto.updateFast = function(options) {
8384
var y = this.yData = this.pickYData = options.y;
8485

8586
var len = x.length,
86-
idToIndex = new Array(len),
87+
idToIndex = new Int32Array(len),
8788
positions = new Float32Array(2 * len),
88-
bounds = this.bounds,
89-
pId = 0,
90-
ptr = 0;
89+
bounds = this.bounds;
9190

9291
var xx, yy;
9392

@@ -98,21 +97,22 @@ proto.updateFast = function(options) {
9897
yy = y[i];
9998

10099
// 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;
102101

103-
idToIndex[pId++] = i;
102+
idToIndex[i] = i;
104103

105-
positions[ptr++] = xx;
106-
positions[ptr++] = yy;
104+
positions[i * 2] = xx;
105+
positions[i * 2 + 1] = yy;
107106

108107
bounds[0] = Math.min(bounds[0], xx);
109108
bounds[1] = Math.min(bounds[1], yy);
110109
bounds[2] = Math.max(bounds[2], xx);
111110
bounds[3] = Math.max(bounds[3], yy);
112111
}
113112

114-
positions = truncate(positions, ptr);
113+
//positions = truncate(positions, ptr);
115114
this.idToIndex = idToIndex;
115+
this.pointcloudOptions.idToIndex = idToIndex;
116116

117117
var markerSize;
118118

0 commit comments

Comments
 (0)