Plotlyresult caching webview

We usually embed plotly in the webview.
However we encounter the same problem as you did before that plotly requires a lot of static data to load.

Your solution was PlotlyView.

However usually it is really nice to add text, tables, images etc. aboven/next to below the plots.

This works well in our WebView builder, however if we add a plotly figure the view gets slow (1-2 seconds), is there a possibility to add an argument to the webview like: “Cache plotly” or something?

That would be awesome, as it allows us to really use the Webview the way we want it.

In a broaded perspective, we would like to allow settings cookies/cache things at the client side, but that might be another feature request later on.

Hi Johan,

If you use the to_html function from Plotly it will include the plotly.js source code in the resulting html by default. You can set include_plotlyjs="cdn" to retrieve the bundle from a CDN. This will reduce the size of your resulting html, thereby decreasing loading time.

Hope this helps!

3 Likes

you just made my day. Thanks a lot. We also use a cdn for our own content, i should’ve asked perplexity… Thanks

1 Like