Skip to content

scattergl lines trace fails with 100k points in plotly.js 1.42 #3226

@jonmmease

Description

@jonmmease

There seems to be a regression in 1.42 for scattegl traces with mode='lines' and >100k points.

Originally discussed in https://community.plot.ly/t/trouble-with-scattergl-lines-with-lots-of-points/15408/2

CodePen: https://codepen.io/jonmmease/pen/qQZWXB

function gaussianRand() {
  var rand = 0;
  for (var i = 0; i < 6; i += 1) {
    rand += Math.random();
  }
  return (rand / 6)-0.5;
}

// 100,000 fails
var point_num = 100000;

// 99,999 is fine
// var point_num = 99999;

var Y = [];
for (var i = 0; i < point_num; i++) {
	Y.push((gaussianRand()*8));
}

var data = [{
	type: "scattergl",
	mode: "line",
	y: Y
}]

var layout = {showlegend: false}
Plotly.plot('graph', data = data, layout = layout)

with <= 99,999 points the plot works as expected
newplot

but with >= 100,000 points the plot doesn't render and the following JavaScript error is raised

TypeError: opts.marker is undefined.          plotly-1.42.4.js:168110:1

version 1.41.3 doesn't have this error. Thanks!

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions