Last active
April 3, 2019 21:04
-
-
Save noamross/ed581efdcd39f1675cec3b325a92c977 to your computer and use it in GitHub Desktop.
flexdashboard/shiny tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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() | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The resulting dashboard. I'm not getting the updating valueBoxes for boxes 2 or 3. What's going on?