shiny dashboard mainpanel height issue

后端 未结 1 1608
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-02 13:40

This is an extension of my previous question. Now I am not able to extend the height of my main panel.

This is my code below

library(shiny)
library(         


        
1条回答
  •  别那么骄傲
    2021-01-02 13:59

    You are not using the functions from shinydashboard but rather the standard shiny package and you need to wrap your tabBox inside a fluidRow.

    library(shiny)
    library(shinydashboard)
    library(shinyBS)
    library(DT)
    
    ui <- dashboardPage(
      dashboardHeader(),
      dashboardSidebar(
        sidebarPanel(
          textInput("text", "Enter Id:"),
          box(width = 1, background  = 'purple'),
          actionButton("Ok", "Press Ok",style='padding:8px; font-size:100%')
        )
    
      ),
      dashboardBody(
    
                  fluidRow(
                  tabBox(width = 12, height = NULL,
    
                    tabPanel("About", value=1, h6("The objective is to test width of ShinyApp in tabPanel design", br(),
                                                  br(),
    
                                                  "Distribution Prototype"
    
                    )
                    ),
    
    
                    tabPanel("Data", value=2,
    
                             fluidRow(
    
                               valueBoxOutput("vbox1", width = 2),
                               valueBoxOutput("vbox2", width = 2),
                               valueBoxOutput("vbox3", width = 2),
                               valueBoxOutput("vbox4", width = 2),
                               valueBoxOutput("vbox5", width = 2),
                               valueBoxOutput("vbox6", width = 2)
    
    
                             ),
    
                             fluidRow(
    
                               column(width = 4,  box(title = "Iris", width = NULL, solidHeader = FALSE, dataTableOutput("dat1"))),
                               column(width = 4,  box(title = "MT Cars", width = NULL, solidHeader = FALSE, dataTableOutput("dat2"))),
                               column(width = 4,  box(title = "Old Faithful Gyser", width = NULL, solidHeader = FALSE, dataTableOutput("dat3")))),
    
                             fluidRow(
    
    
                               column(width = 4,  box(title = "Plot1", width = NULL, solidHeader = FALSE, plotOutput("plot1"))),
                               column(width = 4,  box(title = "Plot2", width = NULL, solidHeader = FALSE, plotOutput("plot2"))),
                               column(width = 4,  box(title = "Plot3", width = NULL, solidHeader = FALSE, plotOutput("plot3")))
    
    
                             )
    
                    )
                  )
        )
      ))
    
    server <- function(input, output) {
    
      output$vbox1 <- renderValueBox({ valueBox( "One","Yes",icon = icon("stethoscope"))})
      output$vbox2 <- renderValueBox({ valueBox( "Two","Yes",icon = icon("stethoscope"))})
      output$vbox3 <- renderValueBox({ valueBox( "Three","Yes",icon = icon("stethoscope"))})
      output$vbox4 <- renderValueBox({ valueBox( "Four","Yes",icon = icon("stethoscope"))})
      output$vbox5 <- renderValueBox({ valueBox( "Five","Yes",icon = icon("stethoscope"))})
      output$vbox6 <- renderValueBox({ valueBox( "Six","Yes",icon = icon("stethoscope"))})
    
      output$dat1 <- renderDataTable({datatable(iris)})
      output$dat2 <- renderDataTable({datatable(mtcars,extensions = 'Responsive' )})
      output$dat3 <- renderDataTable({datatable(faithful,rownames = FALSE, options = list(autoWidth = TRUE)  )})
    
    }
    
    shinyApp(ui, server)
    

    0 讨论(0)
提交回复
热议问题