Skip to content

Commit ae856da

Browse files
committed
high precision fancy scattergl for gl-line2d too - don't lose precision in convert
1 parent 5dcf20a commit ae856da

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@
5959
"es6-promise": "^3.0.2",
6060
"fast-isnumeric": "^1.1.1",
6161
"gl-contour2d": "^1.1.2",
62-
"gl-error2d": "^1.0.0",
62+
"gl-error2d": "monfera/gl-line2d#64-bit",
6363
"gl-error3d": "^1.0.0",
6464
"gl-heatmap2d": "^1.0.2",
65-
"gl-line2d": "^1.3.0",
65+
"gl-line2d": "monfera/gl-line2d#64-bit",
6666
"gl-line3d": "^1.1.0",
6767
"gl-mat4": "^1.1.2",
6868
"gl-mesh3d": "^1.2.0",

src/traces/scattergl/convert.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function LineWithMarkers(scene, uid) {
5151

5252
this.hasLines = false;
5353
this.lineOptions = {
54-
positions: new Float32Array(0),
54+
positions: new Float64Array(0),
5555
color: [0, 0, 0, 1],
5656
width: 1,
5757
fill: [false, false, false, false],
@@ -357,13 +357,13 @@ proto.updateFast = function(options) {
357357
this.scatter.update(this.scatterOptions);
358358
}
359359
else {
360-
this.scatterOptions.positions = new Float32Array(0);
360+
this.scatterOptions.positions = new Float64Array(0);
361361
this.scatterOptions.glyphs = [];
362362
this.scatter.update(this.scatterOptions);
363363
}
364364

365365
// turn off fancy scatter plot
366-
this.scatterOptions.positions = new Float32Array(0);
366+
this.scatterOptions.positions = new Float64Array(0);
367367
this.scatterOptions.glyphs = [];
368368
this.fancyScatter.update(this.scatterOptions);
369369

@@ -506,7 +506,7 @@ proto.updateLines = function(options, positions) {
506506
var p = 0;
507507
var x = this.xData;
508508
var y = this.yData;
509-
linePositions = new Float32Array(2 * x.length);
509+
linePositions = new Float64Array(2 * x.length);
510510

511511
for(i = 0; i < x.length; ++i) {
512512
linePositions[p++] = x[i];
@@ -542,7 +542,7 @@ proto.updateLines = function(options, positions) {
542542
this.lineOptions.fillColor = [fillColor, fillColor, fillColor, fillColor];
543543
}
544544
else {
545-
this.lineOptions.positions = new Float32Array(0);
545+
this.lineOptions.positions = new Float64Array(0);
546546
}
547547

548548
this.line.update(this.lineOptions);

0 commit comments

Comments
 (0)