Description
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.
- Note Faceting: individual
FacetedPlot
types #259, in which we will have aFacetedXYPlot
component. This would be the natural place to change the current approach we are taking with faceting, usingFacetedPlot
.
- Note Faceting: individual
- 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