如何重新定位tabBox的标题?

时间:2016-11-08 03:51:21

标签: shiny shinydashboard

我正在努力重新定位仪表板,因为我在附图中显示了它,它正在削减tabBox标题的一部分。我尝试使用side = "right"tags$style(HTML(".tab-content{width:300px}"))并更改了width = "n values",但它没有进行任何更改。有谁知道如何解决这个问题?我真的很感激!

ui <- dashboardPage(

  dashboardHeader(title="Deteccao de arvores individuais de LiDAR em Shiny App - R", titleWidth = 800),
  dashboardSidebar(tags$style(HTML(".main-sidebar{width: 300px;}")),
    sidebarMenu(
      menuItem("Defina seus parametros e preferencias", icon =icon("dashboard"))),
    conditionalPanel( 
       fileInput('layer', 'Select the CHM.asc file', multiple=FALSE, accept='asc', width = "350px"),
       selectInput("fws", "Select the size of windows to find trees", choices = c("3x3"= (fws<-3), "5x5"= (fws<-5), "7x7"= (fws<-7)), width = "350px"),
       checkboxInput("checkbox", "Would you like to apply the smoothing model for canopy?", value = FALSE, width = "350px"), selectInput("sws", "Select the size of the smoothing window for trees", choices = c("3x3" = (sws<-3), "5x5" = (sws<-5), "7x7"=(sws<-7)), width = "350px"),
       checkboxInput("checkp", "Plot individual trees detected in CHM", value=FALSE, width="350px"),
       checkboxInput("checkpd", "Download the shapefile (.shp) of Individual trees detected", value = FALSE, width = "350px"), uiOutput("shapefile"),
       actionButton("action", "RUN!"))

      ),

  dashboardBody( 
    fluidRow(
      tabBox(title= tagList(shiny::icon("cogs"), "Results"), width = "200px", height = "600px", side = "right",
                tabPanel("Visualization of CHM", plotOutput("mapPlot")),
                tabPanel("Trees detected from rLiDAR", tableOutput("arvlist"), downloadButton("downList", "Download Tree List")),
                tabPanel("Summary of LiDAR metrics", tableOutput("sumy"), downloadButton("downSumy", "Download Summary of LiDAR metrics")),
                tabPanel("Profile of height model", plotOutput("hist"), downloadButton("downHist", "Download Height's Histogram of Density")), #histograma de densidade
                tabPanel("Individual trees detected - Model 2D of CHM", plotOutput("plotTrees"), downloadButton("downDetec", "Download CHM of Trees Detected"))


                 )


    ))
  )

enter image description here

1 个答案:

答案 0 :(得分:0)

改变宽度可以解决问题

library(shinydashboard)

ui <- dashboardPage(

  dashboardHeader(title="Deteccao de arvores individuais de LiDAR em Shiny App - R", titleWidth = 800),
  dashboardSidebar(tags$style(HTML(".main-sidebar{width: 200px;}")),
                   sidebarMenu(
                     menuItem("Defina seus parametros e preferencias", icon =icon("dashboard"))),
                   conditionalPanel( 
                     fileInput('layer', 'Select the CHM.asc file', multiple=FALSE, accept='asc', width = "350px"),
                     selectInput("fws", "Select the size of windows to find trees", choices = c("3x3"= (fws<-3), "5x5"= (fws<-5), "7x7"= (fws<-7)), width = "350px"),
                     checkboxInput("checkbox", "Would you like to apply the smoothing model for canopy?", value = FALSE, width = "350px"), selectInput("sws", "Select the size of the smoothing window for trees", choices = c("3x3" = (sws<-3), "5x5" = (sws<-5), "7x7"=(sws<-7)), width = "350px"),
                     checkboxInput("checkp", "Plot individual trees detected in CHM", value=FALSE, width="350px"),
                     checkboxInput("checkpd", "Download the shapefile (.shp) of Individual trees detected", value = FALSE, width = "350px"), uiOutput("shapefile"),
                     actionButton("action", "RUN!"))

  ),

  dashboardBody( 
    fluidRow(
      tabBox(title= tagList(shiny::icon("cogs"), "Results"), width = "500px", height = "600px", side = "right",
             tabPanel("Visualization of CHM", plotOutput("mapPlot")),
             tabPanel("Trees detected from rLiDAR", tableOutput("arvlist"), downloadButton("downList", "Download Tree List")),
             tabPanel("Summary of LiDAR metrics", tableOutput("sumy"), downloadButton("downSumy", "Download Summary of LiDAR metrics")),
             tabPanel("Profile of height model", plotOutput("hist"), downloadButton("downHist", "Download Height's Histogram of Density")), #histograma de densidade
             tabPanel("Individual trees detected - Model 2D of CHM", plotOutput("plotTrees"), downloadButton("downDetec", "Download CHM of Trees Detected"))


      )


    ))
)

希望它有所帮助!