Plotly performance in shiny app

Hi everyone,

I am creating a shiny app with large input data - around 6 Mio. observations. The app is used for interactive analysis. In each tab I have maybe 5 plots - a total of max. 15 plots. I have used plotly, b/c at some point it was faster than ggplot. However, I also have quite a lot of filters for my data and depending on the analyses, so a lot of rendering is going on.

At this point I'm only working with 10% of the data and am already having performance issues. I will have to use 100% of the data at some point.

I have two stacked bar plots and than that mostly histograms. I have looked into possibilities to increase performance and have stumbled onto toWebGL() and partial_bundle() but I'm not quite sure how they work and how I would apply them to my plots.

Any feedback and help is welcome regarding performance. If needed I can also provide a reprex.

Thanks! Anna

Edit: I was thinking if conditional filters would work, so not all filters are available at a time. Has anyone had any experience with that?

Does your data come from a sql database? If so you could consider plotting from the database (which should be faster) with dbplot package, I would also suggest renderCachedPlot() but if you have a lot of filters then that wouldn't be practical.

Thanks for your reply!

The data does not come from a database but from a .csv file. I will first try different formats before trying to use a database

I have a follow up question. Does renderCachedPlot() work with plotly? How would I replace plotlyOutput() in the UI and renderPlotly() in the server respectively?

renderCachedPlot() doesn't work with plotly...perhaps someday plotly will have it's own caching version, but it's not in our immediate plans

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.