【问题标题】:R Shiny: Automatic wellpanel wrapping UIR Shiny:自动井板包装用户界面
【发布时间】:2014-10-22 10:29:23
【问题描述】:

在我的 UI 上,我试图让我的过滤器显示在 Wellpanel 中。当应用程序运行时,它看起来就像下拉菜单和相关的复选框位于它的“顶部”,而不是被包裹在里面。

这是我的意思的图片:http://imgur.com/QJrrseT

可重现的例子:

用户界面

    require(shiny)
    require(devtools)
    library(grDevices)
    library(xlsx)


shinyUI(fluidPage(
  fluidRow(
    column(3,
    wellPanel(
      )),
    column(9,
      fluidRow(
      wellPanel(
          column(3,
              uiOutput("filter1"))
        ))

    ))
))

服务器

shinyServer(function(input, output) {

 output$filter1 <- renderUI({
 selectInput("filter1", label="Filter 1", choices = c("No Filter","a","b"))
 })
})

【问题讨论】:

    标签: r user-interface shiny shiny-server


    【解决方案1】:

    您可以在wellPanel 上添加一些样式来解决问题:

    library(shiny)
    runApp(list(ui= fluidPage(
      fluidRow(
        column(3, wellPanel()),
        column(9,
               fluidRow( wellPanel(style = "overflow: hidden;", 
                 column(3, uiOutput("filter1"))
               ))
        )
      )
    )
    , server = function(input, output) {
    
      output$filter1 <- renderUI({
        selectInput("filter1", label="Filter 1", choices = c("No Filter","a","b")
                    , selectize = FALSE)
      })
    })
    )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-04
      • 2022-10-14
      • 2020-07-18
      • 2016-06-04
      • 1970-01-01
      • 2014-07-11
      相关资源
      最近更新 更多