Search code examples
iosiphoneipadplotly

Why is iPad not able to render "offline" plotly plots but iPhone can?


If I host an offline plotly plot on a website (for example, on a github.io page here), I'm able to view the plot on my desktop and my iPhone (iOS 12.0, Safari) but not on my iPad (iOS 12.1, Safari, and Chrome) -- I get a "WebGL is not supported by your browser" message.

However, for all these devices, the plots on a webpage such as this one renders with no problems. What causes the difference in rendering offline plotly plots between my iPhone and iPad?


Solution

  • Definitely a weird case, I'm adding another answer to try to explain better what I think it is.

    Python's plotly (aka plotly.py) uses plotly.js under the hood, when you download a plot as html it includes the library plotly.js in the html file (you can check it using the browser's development tools).

    The offline module of the same plotly.py's version will always include the same plotly.js version, whereas online module probably includes the plotly.js currently being used by plotly's plot.ly platform, or at least That would explain the divergence between those modules. The examples on plotly's documentation seem to be rendered without even using plotly.js by checking the code using the browser's tools.

    In addition, plotly.js is going through a rewriting process of its WebGL code as you can see in this issue that was originally targeted for version 2 but might come in sooner, where you can see in a comment:

    Along with this transition - or perhaps even better before it - we should find a way to test webgl plots in iOS - perhaps using https://www.browserstack.com/screenshots/api ? We need to make sure that bugs we've fixed before - such as #280, #1868 (any others that are iOS-specific?) - don't come back with this rewrite.

    where you can see references to issues similar to this one.

    TL DR: other than keep your browsers and plotlys up to date there's not much you can do about this, plotly's code is quite dynamic so you should check for updates every now and then.