flexdashboard
flexdashboard copied to clipboard
Flexdashboard doesn't work with Shiny URL state.
I am trying to combine flexdashboard
with Shiny state bookmarking. When used alone (example from the docs) Shiny app works fine, but when put in flexdasboard, url is not updated:
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
```{r}
shinyApp(
ui=function(req) {
fluidPage(
textInput("txt", "Text"),
checkboxInput("chk", "Checkbox")
)
},
server=function(input, output, session) {
observe({
# Trigger this observer every time an input changes
reactiveValuesToList(input)
session$doBookmark()
})
onBookmarked(function(url) {
updateQueryString(url)
})
},
enableBookmarking = "url")
```
Is this even possible?
I have the same question. Can anyone answer that? Thank you!
I posted same question in the RStudio Community. State (bookmark) for markdown+shiny (or flexdashboard) was working until few weeks ago. Did something change?
I am also unable to bookmark the shiny state in flexdashboard.
You can try it out here:
http://colorado.rstudio.com:3939/content/1120/
If you choose certain inputs, you will get a bookmark URL, but that URL will not return the selected inputs:
http://colorado.rstudio.com/rsc/tracker-dash/?inputs&grp=%22Core%22&per=%22YTD%22&seg=%22Mainstream%22
I would have expected the URL above to return a shiny app for Core/YTD/Mainstream inputs. Instead it returns the default inputs.
Update: I had to remove the bookmark from the example above, so this is no longer an example of the problem.
Ran into this issue also but found a workaround
From https://cran.r-project.org/src/contrib/Archive/shiny/ previous versions 1.0.3
You can do it like so
download.file("http://cran.r-project.org/src/contrib/Archive/shiny/shiny_1.0.3.tar.gz",
+ dest="shiny_1.0.3.tar.gz")
install.packages("shiny_1.0.3.tar.gz",repos=NULL,type="source")
Duly noted you will have to test your dashboard. I found that the last couple of plotly package versions depends one of the newer-ish versions of shiny (1.0.5)