I'm trying to port over my shinydashboards to flexdashboard and I'm running into issues with objects that are rendered server-side.
In this example, I have an input selector that is rendered server-side
output$weeklyWeekSelector <- renderUI({
selectInput('weeklyWeeks',
label = 'Uker',
choices = as.list(weeks),
multiple=TRUE,selectize=FALSE,
selected = weeks[1:26],
size=35)
})
and then displayed on the dashboard:
uiOutput("weeklyWeekSelector")
This works well the first time I load the page, however, if I do the following: 1. Load the page (working fine!) 2. Resize the page (causing it to reload)
Then my displayed input selector will disappear from the dashboard entirely. Not only that, but it will disappear from ALL further instances of the website (I have it on a shiny server). The dashboard/shiny app then needs to be reloaded inside shinyserver (I just copy in new files) for the UI to appear again.
This issue also arises when I render a ggvis plot server-side and pass it through.
This issue arrises when I use both: 1. Shinyserver (dockerfile here: https://github.com/raubreywhite/shiny) 2. rmarkdown::run on RStudio
I've attached the .Rmd file and the data here: https://github.com/rstudio/flexdashboard/issues/61
I don't know if this is a bug with flexdashboard or I'm doing something wrong because I haven't understood the different ways of thinking between flexdashboard and shinydashboard.
Thanks!
I've been looking more into this, and it also seems as though this happens if I reload the page at all. So uiOutput's seem to disappear after the website gets reloaded.
I figured out the problem. It was my YAML at the start of the .rmd file.
Old/wrong YAML:
---
title: "NorMOMO"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: fill
---
New/correct YAML:
---
title: "NorMOMO"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: fill
runtime: shiny
---