Black Lives Matter. Please consider donating to Black Girls Code today.

How to find out if "webgl" is supported?

I hit the weird problem where a scatterplot shows fine with 1000 data points but is empty with 1001.

As it turns out this happens because plotly switches to “webgl” render_mode automatically by default, but it does this even if the device we run on does not support webgl.

I wonder if there is any way to check from Python code within a jupyter notebook whether or not webgl can be properly displayed? In my case the problem arises because the notebook is sometimes shown on a local display (where webgl works) and sometimes via a remote VNC screen (where it does not).