0

I am using flexdashboard with RMarkdown to create an application. However the height of the application does not change accordingly or as per the specified measurements.

---
title: "Flexdashboard not adjusting height"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
runtime: shiny
---
    
    
```{r, height=850}
library(shiny)
shinyAppDir(
  system.file("examples/06_tabsets", package="shiny"),
  options = list(height=850)
)
```
## Another

I include the height option but it loads with a scroll bar (my RStudio session is shown below) Shiny app loading with a scroll bar.

R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.0.2        htmltools_0.5.1.1     tools_4.0.2           flexdashboard_0.5.1.1
 [5] yaml_2.2.1            rmarkdown_2.7         knitr_1.31            jsonlite_1.7.2       
 [9] xfun_0.21             digest_0.6.27         rlang_0.4.10          evaluate_0.14        
Daniel_j_iii
  • 3,041
  • 2
  • 11
  • 27
Keniajin
  • 1,649
  • 2
  • 20
  • 43

2 Answers2

1

Another workaround using CSS3 as suggested here and added a fluidRow with the overflow and 100vh style.

---
title: "Flexdashboard not adjusting height"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
runtime: shiny
---

```{r , height = "100%"}
library(shiny)
fluidRow(style = " overflow: auto;  height: calc(100vh - 50px) !important;",
shinyAppDir(
  system.file("examples/06_tabsets", package="shiny"))
)
```
Keniajin
  • 1,649
  • 2
  • 20
  • 43
0

Updating your R to the latest Version could potentially fix your issue, Your code works on my machine without your issue. Also opening a fresh new project in a new directory with create a clean environment. Is your web browser set to zoom ~150%?

enter image description here

Daniel_j_iii
  • 3,041
  • 2
  • 11
  • 27
  • 1
    I think it is an RStudio version problem. Which version of RStudio are you using? I downgraded to Version 1.1.463 from Version 1.4 the app worked well – Keniajin Apr 07 '21 at 07:36
  • Could this be affected by the `pandoc` version? The two have different versions, `pandoc 2.11.4` in `RStudio 1.4.*` and `pandoc 1.19.2.1` in `RStudio 1.1.463 `. I tried running the app from `R` GUI with the pandoc path set to `Sys.setenv(RSTUDIO_PANDOC="C:\Program Files\RStudio\bin\pandoc")` and the difference is observed – Keniajin Apr 07 '21 at 08:10
  • I don’t think flexdashbaords use pandoc, pandoc is only for PDF output, this is more the rendering of Rmarkdown I think – Daniel_j_iii Apr 07 '21 at 12:53