Skip to content

Selection changes Z-order when using scattergl #3740

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

Closed
Rob-DL opened this issue Apr 6, 2019 · 0 comments · Fixed by #3810
Closed

Selection changes Z-order when using scattergl #3740

Rob-DL opened this issue Apr 6, 2019 · 0 comments · Fixed by #3810
Assignees
Labels
bug something broken
Milestone

Comments

@Rob-DL
Copy link

Rob-DL commented Apr 6, 2019

Backstory
I’m building an application where I use plotly.js to visualize a lot of data points, up to 10k. So, for performance reasons I’m using scattergl type plots. The application has a feature that performs linear fitting on data selected by the user, using the box-select or lasso-select tools. The resulting trend line is then plotted on top of the data.

The problem
When a user selects, and then de-selects points (by double-click) after the trend has been plotted, the Z-order of the traces is somehow changed. This causes the trend line to appear behind the data resulting in poor visibility. The problem does not occur when using type: ‘scatter’ instead of ‘scattergl’.

How to reproduce
The behaviour can be reproduced with the steps below and the following codepen:
https://codepen.io/Convo/pen/GLZYdw 2

  1. Notice that the trend-line is plotted on top of the data
  2. Use the box-select tool to select a few points
  3. Double-click anywhere on the plot to clear the selection
  4. Notice that the trend line is now plotted below the data.

As you can see the Z-order has been swapped after using the selection tool. This is undesired behavirou.

Related forum post:
https://community.plot.ly/t/selection-changes-z-order-when-using-scattergl/21924

@etpinard etpinard added the bug something broken label Apr 8, 2019
etpinard added a commit that referenced this issue Apr 12, 2019
@etpinard etpinard self-assigned this Apr 15, 2019
@etpinard etpinard added this to the v1.48.0 milestone Apr 15, 2019
etpinard added a commit that referenced this issue Apr 24, 2019
etpinard added a commit that referenced this issue Apr 25, 2019
... locking down fixes for:
    - #3740
    - #2958
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants