Skip to content

Plots: longterm plan for webgl limitations imposed by browsers (Chromium) #273

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

Open
dmfalke opened this issue Nov 23, 2021 · 2 comments
Open

Comments

@dmfalke
Copy link
Member

dmfalke commented Nov 23, 2021

Chromium browsers only allow 16 webgl contexts for a browser instance. This operates across all associated windows and tabs. We have been using the scattergl plotly type to render scatter plot data points, since it can handle a larger number than the svg implementation. When faceting is enabled, we can easily hit the upper limit of 16 webgl contexts, since we currently create individual plotly instance for each facet value. As a temporary solution, we switched to using the svg implementation when faceting is enabled. This is not optimal, since we may end up rendering too many points for the browser to handle with the svg implementation.

Also, in Firefox, at least, scatter point plots can mysteriously disappear from the page altogether if you leave a tab and come back after some time period. It's quite disconcerting!

We need to explore alternative, more robust solutions. Some possibilities that come to mind:

  • Allow plotly to render all of the facets in a single plotly instance. This is probably the most robust solution, but requires re-implementing the current layout directly in plotly.
  • Determine an upper limit of data points for the svg implementation of scatter, and use that to determine if a subplot should use it or scattergl. In addition, we probably want to detect when a webgl context is thrown away and offer the user a mechanism to reload the plot or page. This could likely lead to a lot of code complexity.

See related issues

@dmfalke dmfalke added this to the EDA ClinEpi Phase 2 milestone Nov 23, 2021
@alexcjohnson
Copy link

@dmfalke we're investigating possible solutions to plotly/plotly.js#2333 on behalf of a customer, but it's likely to be a big project so if VEuPathDB has any interest in co-sponsoring the work that would make it more likely to proceed. Please DM me [email protected] if there's interest.

@dmfalke
Copy link
Member Author

dmfalke commented Dec 8, 2021

@alexcjohnson thank you for reaching out. I'm not sure we're equipped to co-sponsor. I will raise this with my supervisor and DM you if this is something we can do. Thanks again!

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

No branches or pull requests

3 participants