Skip to content

GL plots seem to be using up multiple GL contexts with Plotly 1.37.1 #2614

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
brian428 opened this issue May 4, 2018 · 4 comments
Closed

Comments

@brian428
Copy link

brian428 commented May 4, 2018

Previously, we were able to show 7-8 or more WebGL plots at once. With 1.37.1, we're hitting the browser GL context limit (typically 16) much earlier. When showing 7 plots, the first two immediately lose their GL contexts and appear as blank.

Here is a repro case: http://jsfiddle.net/brian428/fqhb7kk9/

It seems like Plotly is using up multiple GL contexts for each scattergl plot. With 7 plots, there are 5 console warnings about losing contexts, so it appears that each scattergl plot is using 3 GL contexts for some reason.

We need to show multiple plots together (and allow each one to be individually manipulated by the user), so this is a blocking issue. Can someone take a look?

@etpinard
Copy link
Contributor

etpinard commented May 4, 2018

Duplicate of #2333

@etpinard etpinard marked this as a duplicate of #2333 May 4, 2018
@brian428
Copy link
Author

brian428 commented May 4, 2018

Thanks, I missed that one. Would it help you if add my repro case to that ticket?

@brian428
Copy link
Author

brian428 commented May 4, 2018

Also just to be clear, we had been on 1.35 I believe. So it seems like maybe something changed between 1.35 and 1.37 that made this worse. Maybe the addition of Splom?

@etpinard
Copy link
Contributor

@brian428 sorry for the wait. We just merged #2662 which makes scattergl graphs use 2 (not 3) WebGL contexts as was the case before 1.36.0.

A little more info on the topic: we use two WebGL contexts per scattergl (and splom) graph to improve selection (via select-box and lasso) performance. Since 1.33.0 , WebGL contexts are shared across subplots on the same graph <div>. So, one way to decrease the number of created contexts would be to merge your graphs into subplots on the same graph <div> when possible.

Now, ticket #2333 has some thoughts on sharing WebGL contexts across graph <div>s. Hopefully using an external library like multi-regl will be enough. If not, we might have to add another API method e.g. Plotly.dashboard to solve this problem.

I'll close this issue. But please feel free to comment on #2333.

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

No branches or pull requests

2 participants