Shiny App Here: https://huisinglab.shinyapps.io/server_epiromics_shiny/
To reduce time, I've set up a remote cache on AWS for the displayed plots, as it takes ~1 min to generate each without a cache. However, I wanted to add an option for users to download the displayed plot, and was hoping to find a way to do this without having to re-plot each time.
Here is the current downloadHandler code, but despite the fact that pt1() is cached when renderPlot is run, clicking to download leads to shiny re-plotting.
output$downloadPlot <- downloadHandler(
filename = function() {
paste0("Enhancer_Visual_Index_", sep = "", input$index, ".eps")
},
content = function(file) {
showModal(
modalDialog(
"Generating visual for download in EPS format. This may take a minute or two...",
footer = NULL
)
)
on.exit(removeModal())
cairo_ps(file, height = 25)
pt1()
dev.off()
}
)
Any advice would be appreciated! Thank you