Skip to content

Instantly share code, notes, and snippets.

@noamross
Last active April 3, 2019 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noamross/ed581efdcd39f1675cec3b325a92c977 to your computer and use it in GitHub Desktop.
Save noamross/ed581efdcd39f1675cec3b325a92c977 to your computer and use it in GitHub Desktop.
flexdashboard/shiny tests
---
title: "test"
output:
flexdashboard::flex_dashboard:
orientation: rows
runtime: shiny
---
```{r setup, include = FALSE}
library(shiny)
```
# Main page
## Row 1
### Box 1
```{r}
# This works
flexdashboard::valueBox(Sys.time())
```
### Box 2
```{r, context = 'server'}
autoInvalidate <- reactiveTimer(2000)
output$text1 <- renderText({
autoInvalidate()
as.character(Sys.time())
})
```
```{r}
# This diplays a box but no value
flexdashboard::valueBox(textOutput("text1", inline = TRUE))
```
### Box 3
```{r, context = 'server'}
output$box1 <- shinydashboard::renderValueBox({
autoInvalidate()
# The shiny
shinydashboard::valueBox(as.character(Sys.time()), subtitle = "")
})
```
```{r}
# This displays the updating value but as text, not a box
shinydashboard::valueBoxOutput("box1")
```
### Text
This displays and updates properly: `r textOutput("text1", inline = TRUE)`.
## New row
```{r}
sessioninfo::session_info()
```
@noamross
Copy link
Author

noamross commented Apr 3, 2019

The resulting dashboard. I'm not getting the updating valueBoxes for boxes 2 or 3. What's going on?

Screenshot 2019-04-03 16 55 33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment