Plotly.js: Scattergl markers are not rendered but you can hover over them

Created on 9 Apr 2019  路  19Comments  路  Source: plotly/plotly.js

The behavior here is similar to a previous bug I hit (issue 2999) but that bug's reproducing case no longer reproduces for me so I think this might be the same behavior from a different issue.

If I plot a large number of markers with scattergl, it works fine. If I then plot a subset, it does not. The transition point seems to be ~100k markers. That is, once I plot more than ~100k, plotting below ~100k shows the issue.

Here is a really simple reproducing example:

https://codepen.io/rhamner/pen/XQpRbx

If I use 'scatter' instead of 'scattergl' it works fine, but our actual use case is much larger than 100k points so scatter doesn't work.

The browser generates hundreds of these warnings:

[.WebGL-00000080DCBEE1F0]GL ERROR :GL_INVALID_OPERATION : glDrawArrays: attempt to access out of range vertices in attribute 0

I'm using chrome Version 73.0.3683.103 (Official Build) (64-bit). This specific sample code does not show the issue in firefox, but I do hit the issue in firefox with our actual code and I'm not sure why.

bug

Most helpful comment

But that line is not called in the codepen demonstrating the issue.

Right, because your https://codepen.io/MojtabaSamimi/pen/VJddPx has (only) 1e4 points. See https://codepen.io/etpinard/pen/EBRpqz which has 1e5 points - and appears buggy still.

All 19 comments

our actual use case is much larger than 100k points so scatter doesn't work.
@rhamner it is close to how many points?

@archmoj on the order of 1M. The actual one where I noticed this originally was ~300k points dropping down to ~15k points.

Right the cross-over should be at 1e5 pts. Something must be up with point-cluster. Note that we never cluster x/y scattergl data below 1e5 pts.

https://github.com/plotly/plotly.js/blob/636a356b485b22d2213af984ea9e5bc134a44498/src/traces/scattergl/index.js#L77-L85

Scanning through that...if I understood correctly, newPlot will not show this issue? I tried it out in that codepen I included and the issue goes away. Is that a valid stopgap?

I am having an issue similar to this. The points simply do not show up when using scattergl, but show up just fine when using scatter.

Here is a simple codepen demonstrating this. https://codepen.io/wweitzel/pen/MRJVYd

The first plot is with scatter and the second is scattergl.

@wweitzel that sounds like a very different problem. I'm seeing

image

from your https://codepen.io/wweitzel/pen/MRJVYd


Something must be up with your WebGL support. Can you try to answer the following questions:

  • do you see any errors in your browser console?
  • which browser are you using?
  • which OS are you on?

thank you.

image

Above image is the console error

This is on Chrome version 73.0.3683.103 (Official Build) (64-bit) on windows 10, 64 bit

That's what I thought. This isn't at all related to this issue.

See if your setup supports WebGL by going on https://get.webgl.org/ . If you see

image

than please open a new ticket. Thanks for reporting.

You are right. Seems my setup does not support WebGL. Sorry for the misunderstanding.

This issue appears to be (going to be) fixed (in the next release v.1.49.0) after bumping [email protected] which uses [email protected] in https://github.com/plotly/plotly.js/pull/3904.
Codepen

after bumping [email protected] which uses [email protected] in #3904.

I doubt it. We shouldn't be calling point-cluster from regl-scatter. Our call to point-cluster is here:

https://github.com/plotly/plotly.js/blob/d75e956db2fffe23bcf818c3ca9eb8952f68eab2/src/traces/scattergl/calc.js#L67

But that line is not called in the codepen demonstrating the issue.

But that line is not called in the codepen demonstrating the issue.

Right, because your https://codepen.io/MojtabaSamimi/pen/VJddPx has (only) 1e4 points. See https://codepen.io/etpinard/pen/EBRpqz which has 1e5 points - and appears buggy still.

@rhamner
A candidate fix illustrated in this demo.

Closed by #4323 .

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

empet picture empet  路  3Comments

nicolaskruchten picture nicolaskruchten  路  3Comments

mithi picture mithi  路  3Comments

n-riesco picture n-riesco  路  3Comments

bryaan picture bryaan  路  3Comments