gpt4 book ai didi

R markdown - flexdashboard - 网格布局 & 滚动 & 标签集

转载 作者:行者123 更新时间:2023-12-04 11:31:29 25 4
gpt4 key购买 nike

我试图弄清楚如何结合网格布局、行标签集和在 Markdown/flexdashboard 中滚动的能力。

enter image description here

我想要实现的是 Tab 3 应该在 Tab 1 & 2 的右侧,并且能够向下滚动到 Tab 4-6(其中 Tab 6 应该在 4/5 的右侧)。
像这样的东西:

enter image description here

这可能吗?

---
title: "Test"
output:
flexdashboard::flex_dashboard:
orientation: row
vertical_layout: scroll

---

```{r setup, include=FALSE}
library(flexdashboard)
```


A {data-orientation=rows}
===================================================

Row {data-width=500 data-height=400 .tabset}
-----------------------------------------------------------------------

### Tab 1 {data-height=400 data-width=500}

```{r}
plot(rnorm(10))
```

### Tab 2 {data-height=400 data-width=500}

```{r}
plot(rnorm(10))
```

Column
-----------------------------------------------------------------------

### Tab 3 {data-height=400 data-width=300}
Some text


Row {data-width=500 data-height=400 .tabset}
-----------------------------------------------------------------------

### Tab 4 {data-height=400 data-width=500}

```{r}
plot(rnorm(10))
```

### Tab 5 {data-height=400 data-width=500}

```{r}
plot(rnorm(10))
```


Column
-----------------------------------------------------------------------

### Tab 6 {data-height=400 data-width=300}

Some text

最佳答案

这是您问题的可能解决方案

enter image description here

这是代码

---
title: "Test"
output: flexdashboard::flex_dashboard
---

```{r setup, include=FALSE}
library(flexdashboard)
require(shinydashboard)
require(shiny)
require(plotly)
```


A {data-orientation=rows}
===================================================

Row
-----------------------------------------------------------------------

```{r}
p1 <- plot_ly(x = 1:10, y = rnorm(10))
tabBox(width=5,tabPanel("Tab1", p1), tabPanel("Tab2"), height = "450px")
```

```{r}
tabBox(width=7, tabPanel("Tab3","Some text"), height = "450px")
```

Row
-----------------------------------------------------------------------

```{r}
p2 <- plot_ly(x = 1:10, y = rnorm(10))
tabBox(width=5, tabPanel("Tab4",p2), tabPanel("Tab5"), height = "450px")
```

```{r}
tabBox(width=7, id = "tabset4", tabPanel("Tab6","Some text"), height = "450px")
```

关于R markdown - flexdashboard - 网格布局 & 滚动 & 标签集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48702343/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com