Loading page elements one by one

Hi all,
Part of my application is to recommend to users a gallery of ML generated plots based on their own data (or example data from R packages). There will be at least 50 plots displayed every time and possibly many more.
My problem is that they're all displayed at one time,making in some cases huge waiting times.
I would like to find a way to have them displayed one by one, as soon as one has been generated.
In the simple example below, instead of all 4 showing plots showing at one time, I'd like to have them shown individually as soon as they're ready.

  library(shiny); library(ggplot2)
  ui <- fluidPage(
            style = "height: 160px; text-align:center",
            plotOutput("Mosaic_Plot1"), plotOutput("Mosaic_Plot2"), plotOutput("Mosaic_Plot3"), plotOutput("Mosaic_Plot4")
            style = "height: 40px; text-align:center",
            actionButton("mosEdit1", "Edit this plot"), actionButton("mosEdit2", "Edit this plot"), actionButton("mosEdit3", "Edit this plot"), 
            actionButton("mosEdit4", "Edit this plot")
  server <- function(input, output, session) {
    output$Mosaic_Plot1 <- renderPlot({ggplot(data = diamonds, aes(carat, price)) + geom_point()}, width = 280, height = 160)
    output$Mosaic_Plot2 <- renderPlot({ggplot(data = diamonds, aes(x = color, y = price, color = color)) + geom_point() + geom_jitter()}, width = 280, height = 160)
    output$Mosaic_Plot3 <- renderPlot({ggplot(data = diamonds, aes(carat)) + geom_histogram()}, width = 280, height = 160)
    output$Mosaic_Plot4 <- renderPlot({ggplot(data = diamonds, aes(depth, table)) + geom_point()}, width = 280, height = 160)
  shinyApp(ui, server)

I tried several options with embedded uiOutputs, fillPage, ... but nothing worked so far.
Many thanks for any suggestions on how to make this work.

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