Skip to content

support rangebreaks in gl2d traces #4630

Description

@archmoj

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.

Activity

  1. etpinard commented on Mar 12, 2020

    @etpinard
    Contributor

    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.

  2. added this to the v1.5x milestone on Mar 16, 2020
  3. changed the title [-]Axis breaks on date axis with scattergl[/-] [+]support rangebreaks in gl2d traces[/+] on Jun 8, 2020
  4. gvwilson commented on Jun 24, 2024

    @gvwilson
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions