rstudio / flexdashboard

Easy interactive dashboards for R
https://pkgs.rstudio.com/flexdashboard/
Other
816 stars 300 forks source link

Reactive plots disappear after browser window refresh #164

Closed AnatolyVuets closed 3 years ago

AnatolyVuets commented 6 years ago

Hello, flexdashboard team! I would appreciate any help on the following issue: Reactive plots disappear when I refresh my dashboard page in browser. I'm using the most recent development versions of flexdashboard, shiny and plotly. RStudio v 1.1.383; R v 3.4.3

Code example:

## some data preparations 

 renderPlotly({
selectedData() %>%
  plot_ly(x = ~funnel_ymd, y = ~value, color = ~variable, colors = "Dark2",
          yaxis = ~paste0("y", id)) %>%
  add_bars() %>%
  subplot(nrows = 14, shareX = TRUE)
})

However, analogous non-reactive plot does not suffer from this issue:

## some data preparations 
constData %>%
  plot_ly(x = ~funnel_ymd, y = ~value, color = ~variable, colors = "Dark2",
          yaxis = ~paste0("y", id)) %>%
  add_bars() %>%
  subplot(nrows = 14, shareX = TRUE)
dwall1 commented 6 years ago

Did you ever find a way to resolve this issue? I'm experiencing something similar withmy flexdashboard app

AnatolyVuets commented 6 years ago

dwall1, unfortunately I did not manage to solve this problem and ended up using Shiny Dashboard which is more flexible and rich in options. I would recommend you to try it

dwall1 commented 6 years ago

Thanks for letting me know

Ljupch0 commented 5 years ago

I'm having the same issue on all of my flexdashboard runtime:shiny apps. Any update?

Ljupch0 commented 5 years ago

It seems that shinydashboard is the way to go.

dvictori commented 4 years ago

I'm also facing this issue in a flexdashboard that connects to a Postgres database. Has anyone solved this?

dvictori commented 4 years ago

I've found out what is causing the problem. In my original flexdashborad, when I added runtime: shiny, the text was indented at the same level of the output block. So when I reloaded the flexdashboard - even in RStudio viewer - the rendered outputs would stop working.

When I removed the indentation from runtime:shiny, things got back to normal. So for anyone having this issue, check your indentation on the YAML at the top of the document.

cpsievert commented 3 years ago

Closing due to lack of a reproducible example

JosephCrispell commented 3 years ago

Thank you @dvictori - that worked perfectly for me! Been smacking my head against this one for the last hour!?!?!