在flexdashboard中结合多个页面的不同类型的vertical_layout

时间:2017-04-05 07:55:36

标签: r layout r-markdown flexdashboard

我创建了一个包含多个页面的flexdashboard文档。我希望在第一页上vetical_layout: fill,但在第二页我希望vertical_layout: scroll。我的文档开头是这样的:

---
title: "DASHBOARD"
output:
  flexdashboard::flex_dashboard:
    orientation: columns
    logo: logo.png
    vertical_layout: fill
---

如何查看包含vertical_layout: scroll的第二页?

2 个答案:

答案 0 :(得分:4)

您可以覆盖单个(H2)列上的全局--- title: "Changing Vertical Layout" output: flexdashboard::flex_dashboard: orientation: columns vertical_layout: fill --- ```{r setup, include=FALSE} library(flexdashboard) library(ggplot2) ``` Page 1 ================================ Column {data-width=650} ----------------------------------------------------------------------- ### Panel A ```{r} qplot(cars$speed) qplot(cars$dist) ``` Column {data-width=350} ----------------------------------------------------------------------- ### Panel B ```{r} qplot(cars$speed) ``` ### Panel C ```{r} qplot(cars$dist) ``` Page 2 ================================ Column { vertical_layout: scroll} ----------------------------------------------------------------------- ### Panel A ```{r} qplot(cars$speed) qplot(cars$dist) ``` ```{r} qplot(cars$speed) qplot(cars$dist) ``` ```{r} qplot(cars$speed) qplot(cars$dist) ``` 值。

id

enter image description here enter image description here 这是覆盖全球价值的类似例子。 (但in this case,他们正在改变页面(H1)级别的方向。)

答案 1 :(得分:0)

以下解决方案适合我。在YAML标题中,我使用“vertical_layout:fill”将默认行为设置为“fill”。然后,我在页面标题和列标题中使用下面的CSS样式作为需要滚动的页面。

Page 3 {style="position:relative;"}
========================================================

Column {style="height:100pc;"}
--------------------------------------------------------

### Chart A

``` {r}
```

### Chart B

``` {r}
```