【发布时间】:2022-01-01 07:53:46
【问题描述】:
我有一个使用 flexdashboard 构建的 rmarkdown 仪表板,其中包含许多输入的全局侧边栏适用于大多数页面,但有一个或两个需要不同的侧边栏。有没有办法只为一个单独的页面覆盖全局侧边栏,或者阻止全局侧边栏在一个特定页面上呈现?
作为示例,以下内容几乎可以让我到达那里,但将全局和本地侧边栏呈现为在第 3 页上重叠,并添加了奇数列的空白。
---
title: "My Page"
output: flexdashboard::flex_dashboard
runtime: shiny
---
Sidebar {.sidebar}
=====================================
```{r}
checkboxGroupInput(inputId = "options", label = "Some Options:", choices = c("One", "Two", "Three"), selected = c("One", "Two", "Three"))
```
Page 1
=====================================
Column
-------------------------------------
### Some things here.
Page 2
=====================================
Column
-------------------------------------
### Some other things here.
Page 3
=====================================
Inputs {.sidebar}
-------------------------------------
```{r}
checkboxGroupInput(inputId = "diff_options", label = "Some Different Options:", choices = c("a", "b", "c"), selected = c("a", "b", "c"))
```
Column
-------------------------------------
### Some very different things here.
看起来像这样。
我知道我可以通过让每个页面都有自己的自定义侧边栏来解决这个问题,但是有很多这样的侧边栏,这会变得相当繁琐。
【问题讨论】:
标签: css r shiny r-markdown flexdashboard