Shiny stopped displaying rendered plots

Hi all,

I have a Shiny app that suddenly stopped displaying several ggplots. The sidebar shows up but not the main panel. There are no error messages or warning. The app just hangs on listener as shown here.

shinyApp(ui = ui, server = server)

Listening on http://127.0.0.1:3277

The plots work from the console and were working fine, thus I suspect a Shiny environment parameter must have gotten changed. Does anyone have any ideas?

The following minimal example does the behavior.

ui <- fluidPage(
  sidebarPanel(
  
    # select trade
    selectInput(inputId = "trade",
                label   = "Trade",
                choices = trades,
                selected = defaultTrade
    ),
    
    mainPanel(
      # performance time series plots
      plotOutput(outputId = "tsPlotRev", height = "195px")
    )
  )
)

server <- function(input, output, session) {(
output$tsPlotVol <- renderPlot(
  ggplot(data.frame(tsData), 
            aes(x = as.Date(weekDate), y = as.numeric(revenue) / 1000000, color = as.factor(isHist))) +
    geom_line() + scale_x_date(date_breaks = "4 week", date_labels = "%y-%W") + 
    theme(axis.text.x = element_text(angle = 45, hjust = 0.75), legend.position = "none") + 
    labs(x = NULL, y = "revenue (million USD)")
)
)}

shinyApp(ui = ui, server = server)

Any ideas?

Thanks,

John Lancaster

Your code is not reproducible as choices in the selectInput seem to depend on a 'trades' object.

However, I guess an issue might be that your outputId is called 'tsPlotRev' while your are trying to write to 'output$tsPlotVol'.

1 Like

Thank you, you were correct. I fixed it and things worked. But that deepens the mystery for me.

I pulled the minimal example from a much larger app, that stopped working. I grabbed the wrong plotOutput for the example. Now the minimal example works but the larger app does not. Obviously I have not isolated the problem with the larger app.

Back to the grinding.

Thanks @radmuzom

1 Like

Also the trades object is irrelevant to the example as it is not used.

If you are interested I can post the relevant data.

John

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.