Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scattergl traces with multiple colors set sometimes incorrectly format points in other scattergl traces #3232

Closed
alexcjohnson opened this issue Nov 8, 2018 · 6 comments
Assignees
Labels
bug something broken regression this used to work

Comments

@alexcjohnson
Copy link
Collaborator

see https://codepen.io/alexcjohnson/pen/JeXOGX?editors=1010

The large point above the line should be orange (as it is in the legend) but it ends up blue, taking its color from the previous trace.

Fiddling around with the settings, there seem to be various ways to trigger or avoid this behavior. See also https://codepen.io/donolingerPHX/pen/qQZdxE?editors=1010

Seems to have come in with v1.36.0 - perhaps #2499?

@alexcjohnson alexcjohnson added bug something broken regression this used to work labels Nov 8, 2018
@etpinard
Copy link
Contributor

etpinard commented Nov 9, 2018

Seems to have come in with v1.36.0

Good eye, both codepens work with v1.35.2:

In both cases, the options computed in scattergl/convert.js appear correct:

image

image

looking at [1].color.


perhaps #2499?

Yeah good eye, but maybe changes to regl-scatter2d that accommodate splom traces in #2505 are to blame too.

Here's the diff between the regl-scatter2d version used in 1.35.2 and 1.36.0:

gl-vis/regl-scatter2d@f0d0cd3...7e29a41

@etpinard
Copy link
Contributor

etpinard commented Nov 9, 2018

@etpinard
Copy link
Contributor

etpinard commented Nov 9, 2018

Here's my attempt: https://github.com/plotly/plotly.js/compare/scattergl-maxColors-4096 which uses https://github.com/plotly/plotly.js/compare/scattergl-maxColors-4096 - but unfortunately breaks the gl2d_scatter-color-clustering mock.


Ha, I think I know why Dima used maxColors=255, 255 is the largest integer that can be put in a Uint8Array which is below the maxTextureSize limit of what looks like 16384.

image

Doing this with 16 bits would give: (2**16-1) = 65535 which of course is > 16384

@etpinard
Copy link
Contributor

etpinard commented Nov 9, 2018

Well, 255 colors is for sure not enough. Looks like we could theoretically reach 16384 with just one WebGL texture. @archmoj would you be interested in looking at this further?

@archmoj archmoj self-assigned this Nov 9, 2018
@archmoj
Copy link
Contributor

archmoj commented Nov 9, 2018

Interesting. Let me have a look.

@dy
Copy link
Contributor

dy commented Nov 15, 2018

Hey guys can we possibly create a problematic test case in regl-scatter2d mocks (after we merge gl-vis/regl-scatter2d#15)?

maxColors=255 there is wrong, in fact that is 256 colors. But that is not the point - for the case when the trace has more than 255 colors regl-scatter2d just puts all of them into an attribute buffer directly, so all of the trace colors get displayed, none of them lost. That does not even cause memory overhead, because if we want to use big texture with color palette (more than 256x256), we have to use two Uint16s pointers for color id, but that is the same as single Uint32 color value, therefore having a long buffer with colors directly is valid solution.

The issue seems to be something different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken regression this used to work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants