【问题标题】:Input menu contents do not overflow row box in flexdashboard输入菜单内容不会溢出 flexdashboard 中的行框
【发布时间】:2020-09-27 15:46:14
【问题描述】:


我正在使用带有闪亮的 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 图片:

非常感谢,

豪尔赫

【问题讨论】:

    标签: r shiny flexdashboard selectinput


    【解决方案1】:

    您说将来会有更多图表,但我认为您可以在 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))
    })
    ```
    

    【讨论】:

    • 谢谢 Daniel,但我确实希望将这种设计与两个(或 3 个)连续的 selectInput 菜单保持一致。这是一个外观示例(使用闪亮):jaap.shinyapps.io/powerSensor
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多