闪亮的仪表板空盒子大小

时间:2017-07-07 16:35:06

标签: shiny box shinydashboard

我正在使用仪表板开发闪亮的应用程序。在输入数据之前,我有很好的短语和警告,但它们出现在框外或边缘上,如下图所示。我不知道该怎么做。

我尝试在这样的框中创建空格:

box(width=12,
    tabsetPanel(
        tabPanel("Count matrix",
            h4(""),
            DT::dataTableOutput("dataRaw"))))

文字是来自:

的输出
dataRaw <- reactive({
    validate(need(input$countMatrix != 0, "To perform analysis, please select an input file")))

问题是:

enter image description here

1 个答案:

答案 0 :(得分:1)

我创建了一个你想要实现的最小例子。 此处tags$head(tags$style(HTML(".tab-pane { height: 70vh; overflow-y: auto; }" )))将标签面板的高度设置为占据屏幕的70%。

     library(shiny)
     library(shinydashboard)


     ui <- dashboardPage(
       dashboardHeader(title = "Basic dashboard"),
       dashboardSidebar(),
       dashboardBody(
         box(width=12,
             tags$head(tags$style(HTML(".tab-pane { height: 70vh; overflow-y: auto; }" ))),
             tabsetPanel(
               tabPanel("Count matrix",
                        h4(""),
                        DT::dataTableOutput("dataRaw"))))

       )
     )

     server <- function(input, output) {
       dataRaw <- reactive({
         validate(need(input$countMatrix != 0, "To perform analysis, please select an input file"))
       })

       output$dataRaw <- DT::renderDataTable(dataRaw())
     }

     shinyApp(ui, server) 

使用上面的代码可以得到这样的结果:

enter image description here

希望它有所帮助!

相关问题