1


我正在使用带有闪亮的 flexdashboard 创建一个反应式仪表板。我希望标题下方的第一行包含两个单独的 selectInput() 菜单。我保持行的高度很小(50),因为下面会有更多的图表,我需要空间。但是,在呈现仪表板时,单击输入菜单以选择另一个选项会导致下拉菜单“消失”在行后面(而不是溢出)。这使得选择第二个或第三个元素以下的项目变得困难。如何使内容溢出?这是一个可重现的代码+屏幕截图:

---
title: "Test Dashboard"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: fill
runtime: shiny
---

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

Row {data-height=50}
-----------------------------------------------------------------------

### Window 1

```{r}
selectInput("project", label = NULL, choices = c("A","B","C","D"))
```

### Window 2
```{r}
selectInput("data", label = NULL, choices = c("1","2","3","4","5", "6"))
```


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

### Chart B

```{r}
renderPlot({
  plot(rnorm(1000), type = "l", main = paste("Project:",input$project, " Data:", input$data))
})
```

附上它的外观图像。

Flexdasboard 图片:

非常感谢,

乔治

4

1 回答 1

0

您说将来会有更多图表,但我认为您可以在 Flexdashboard 的“下方”渲染各个图表,以节省空间。我改变了,行到列,让我知道。

---
title: "Test Dashboard"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: fill
runtime: shiny
---

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

Column {data-width=600}
-----------------------------------------------------------------------

### Window 1

```{r}
selectInput("project", label = NULL, choices = c("A","B","C","D"))
```

### Window 2
```{r}
selectInput("data", label = NULL, choices = c("1","2","3","4","5", "6"))
```


Column {data-width=400}
-----------------------------------------------------------------------

### Chart B

```{r}
renderPlot({
  plot(rnorm(1000), type = "l", main = paste("Project:",input$project, " Data:", input$data))
})
```
于 2020-06-09T00:21:20.593 回答