Too many active WebGL contexts

Hi,

I am plotting 10 graphs on the same page. Each plot is created with Plotly.newplot then updated with plotly.react.
I found that each time I open my application in 3 tabs simultaneously, some plots dissapear and I get this error in my console:
Warning Too many active WebGL contexts. Oldest context will be lost

And I’m using chrome.

Any help ?

Yeah, that’s unfortunately correct. Chrome’s WebGL context limit is 16. So 3 tabs of 10 WebGL graphs will go over the limit.

There’s not much one can do at the moment. You might want to subscribe to https://github.com/plotly/plotly.js/issues/2333 for the most up-to-date news on the topic.

Is there any solutions for that.

[Too many active WebGL contexts. Oldest context will be lost.] ?

In plotly express some plots have a render_mode function which you can change to “svg”, it generates plots much slower but it will stop older ones disappearing. I did this after generating lots of px.scatter plots and it worked ok. More info here: Webgl vs svg in Python