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

support rangebreaks in gl2d traces #4630

Closed
archmoj opened this issue Mar 11, 2020 · 2 comments
Closed

support rangebreaks in gl2d traces #4630

archmoj opened this issue Mar 11, 2020 · 2 comments
Labels
feature something new

Comments

@archmoj
Copy link
Contributor

archmoj commented Mar 11, 2020

It could be of interest to handle axis breaks on a date axis with scattergl (webGL) similar to #1382 which was dedicated for SVG traces on the cartesian subplots.

@archmoj archmoj added the feature something new label Mar 11, 2020
etpinard added a commit that referenced this issue Mar 12, 2020
etpinard added a commit that referenced this issue Mar 12, 2020
@etpinard
Copy link
Contributor

etpinard commented Mar 12, 2020

This one will be tricky, as the linear relationship between the data-space and the pixel-space is at the heart of the regl modules (i.e. regl-scatter2d, regl-line2d and regl-error2d) used by scattergl.

The regl modules compute the data to pixel map in the shaders. For example, for regl-scatter2d:

https://github.com/gl-vis/regl-scatter2d/blob/bd8b5655e349ebe4c971de7ec6df60ca897fc627/circle-vert.glsl#L44-L47

making redraws from axis range updates is blazing fast. For example, on drag:

if(hasScatterGl) {
for(i = 0; i < subplots.length; i++) {
sp = plotinfos[subplots[i]];
xa = sp.xaxis;
ya = sp.yaxis;
if(sp._scene) {
var xrng = Lib.simpleMap(xa.range, xa.r2l);
var yrng = Lib.simpleMap(ya.range, ya.r2l);
sp._scene.update({range: [xrng[0], yrng[0], xrng[1], yrng[1]]});
}
}
}


One could probably make part of data-to-pixel conversion on the JS side and then reuse the same shader code, but I worry that this might lead to a large performance lost.

I'm thinking that passing the piecewise offsets (ax._B as added in #4614) as part of a buffer down to the shader might be the way to go. That said, adding if(ax.breaks) statement in the shader might impact performance. We should be very careful here. Please use https://codepen.io/etpinard/pen/BVdxoY to test (1) first draw, (2) pan and (3) selection perf at 1e5 and 1e6 points.

@nicolaskruchten nicolaskruchten added this to the v1.5x milestone Mar 16, 2020
@archmoj archmoj changed the title Axis breaks on date axis with scattergl support rangebreaks in gl2d traces Jun 8, 2020
@gvwilson
Copy link
Contributor

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

No branches or pull requests

4 participants