Skip to content
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

Virtual WebGL Workaround Fails On 3d Plots #7298

Closed
robertclaus opened this issue Dec 4, 2024 · 9 comments · Fixed by #7313
Closed

Virtual WebGL Workaround Fails On 3d Plots #7298

robertclaus opened this issue Dec 4, 2024 · 9 comments · Fixed by #7313
Assignees
Labels
bug something broken cs customer success P1 needed for current cycle

Comments

@robertclaus
Copy link

robertclaus commented Dec 4, 2024

Plotly's documentation recommends using the virtual-webgl script to support more plots than the browser's WebGL context limit allows. This works great for displaying many large scatter charts, but with this in place 3D plots, surface plots, and mesh3d plots (and likely others) do not seem to render.

https://plotly.com/python/webgl-vs-svg/

Image
Image

@gvwilson gvwilson added bug something broken P2 considered for next cycle cs customer success labels Dec 6, 2024
@archmoj
Copy link
Contributor

archmoj commented Dec 6, 2024

@robertclaus

Could you possibly fork and tweak this codepen to replicate the bug you noticed?

Alternatively you may use fig2pen to convert a python example to codepen.

Please note in both cases you should add the virtual-webgl script in the html before loading the plotly.js script.

Thank you!

@alexcjohnson
Copy link
Collaborator

FYI apparently virtual-webgl has compatibility issues with Bokeh too, though I haven't investigated myself holoviz/panel#7375

@gvwilson gvwilson added P1 needed for current cycle and removed P2 considered for next cycle labels Dec 9, 2024
@gvwilson
Copy link
Contributor

gvwilson commented Dec 9, 2024

@archmoj just sent you a slack - please dive into this one.

@samhinshaw
Copy link
Contributor

@archmoj I have not been able to reproduce it in codepen yet. I am going to see if I can isolate any further differences between codepen and the environment we are experiencing the bug in.

Two attempts:
https://codepen.io/samhinshaw/pen/QwLKdjZ
https://codepen.io/samhinshaw/details/EaYgZyj

@samhinshaw
Copy link
Contributor

Ah. I figured it out.

From this thread:

this error hints that at the moment when WebGL is initialized, the canvas size is 0 pixels.

Our layouts do not have width & height set. If we set them explicitly in the layout, the chart renders.

Before After
Image Image

@samhinshaw
Copy link
Contributor

samhinshaw commented Dec 11, 2024

@archmoj Here is a codepen reproducing the bug: https://codepen.io/samhinshaw/pen/gbYwgvz

The root cause appears to be specific interactions with flexbox and the parameter responsive = True

@archmoj
Copy link
Contributor

archmoj commented Dec 11, 2024

Thank you @samhinshaw for the replicating the bug 🙏
Since this seems like a browser specific bug, I am wondering if you could possibly add a workaround for this in place?

@archmoj
Copy link
Contributor

archmoj commented Dec 11, 2024

@gvwilson FYI - samhinshaw and I are now working together a fix at plotly.js level at our Vancouver office.
After that, I should release a plotly.js release candidate patch (v3.0.0-rc.2) to help close this ticket as soon as possible.

@archmoj
Copy link
Contributor

archmoj commented Dec 11, 2024

@samhinshaw
When opening the new issue at plotly.js level please use the simplified version of codepen (i.e. without importing react, etc.) and use the latest official version of plotly.js v2.35.2 instead of the RC of v3.
Thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken cs customer success P1 needed for current cycle
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants