Skip to content

Instantly share code, notes, and snippets.

@noamross
Last active Apr 3, 2019
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@noamross 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