plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Does plotly.js really support virtual-webgl?

Open agarny opened this issue 3 months ago • 3 comments

From what I understand, support for virtual-webgl was added in version 2.28.0, but this doesn't seem to make a difference for me. I mean, I am currently using version 3.1.0 and I am getting the Too many active WebGL contexts. Oldest context will be lost. warning even though I added <script src="https://unpkg.com/browse/[email protected]/src/virtual-webgl.js"></script> to my HTML file, as mentioned here. So, what am I missing?

Otherwise, I understand that the virtual-webgl script is for WebGL1, not WebGL2. However, from here, I also understand that the WebGL1 wrapper is pretty slow. So, is it really worth using?

agarny avatar Aug 28 '25 01:08 agarny

I use virtual-webgl very successfully in my own project. It does impact performance, but it's the only way I know of to put dozens of WebGL plots on the same page. It's not supported by all browsers - Safari in particular fails to use it. I haven't tested every other browser, I'm fortunate to be able to just tell my users to stick to Chrome.

alexjohnson-kobold avatar Sep 09 '25 13:09 alexjohnson-kobold

Thanks for sharing your experience. I don't personally use Safari, but some of my users likely do, so that alone is a no-go for me. Also, I wish I could try it for myself. Not sure why it's not working in my setup. 🤔

agarny avatar Sep 09 '25 22:09 agarny

I found the performance with virtual-webgl to be unacceptable for our use case. What worked was increasing the WebGL contexts in Chrome, or just use Firefox (which has a much higher default limit). I've opened a ticket against Chromium to increase the limit, but it hasn't really gone anywhere: https://issues.chromium.org/issues/437316557

mofojed avatar Sep 19 '25 17:09 mofojed