2017-06-15 44 views
0

我有几个盒子,用户输入后会用图表和表格填充。在shinydashboard body中切割背景颜色

因为我已经改变了布局是基于列的,背景颜色似乎是第一个框下被削减这样的: enter image description here

我不知道为什么会这样。

这里是一个示例代码重现布局:

library(shiny) 
library(shinydashboard) 
sidebar <- dashboardSidebar(
    sidebarMenu(
    busyIndicator(text="Loading..."), 
    tags$head(
     tags$style(
     HTML(' 
      #uploadfile{height: 25px} 
      #rat{height: 25px; font-size: 10px} 
      #pnum{height: 25px; font-size: 10px} 
      #mytext{width: 50px} 
      .content-wrapper, 
      .right-side { 
      background-color: #EBE5D0; 
      } 
      li { cursor: pointer; cursor: hand; } 
      ') 
     ) 
     ), 
    menuItem("Network", icon = icon("table"), tabName = "network", badgeColor = "green") 
     ) 
    ) 

body <- dashboardBody(
    tabItems(
    tabItem(tabName = "network", 
      column(width = 2, 
        box(
         title="INPUT FILES",solidHeader = TRUE, status="primary", 
         fileInput('file1',"file 1", multiple=F,accep=".Rdata"), 
         fileInput('file2',"file 2", multiple=F,accep=".Rdata"), 
         fileInput('file3',"file 3", multiple=F,accep=".Rdata"), 
         fileInput('file4',"file 4", multiple=F,accep=".Rdata"), 
         uiOutput("phenoselect"), 
         uiOutput("phenolog"),     
         tags$div(align = 'left', 
           class = 'multicol', uiOutput("covarselect")), 
         uiOutput("snpPlotButton"), 
         height = 800, 
         width = NULL 
        ) 
      ), 
      column(width = 8, 
        box(
        title="PLOT",solidHeader = TRUE, status="primary", 
        plotOutput('plotSNPmaf',height="500px"), 
        height = 800, 
        width = NULL 
        ), 
        box(
        title="TABLE",solidHeader = TRUE, status="primary", 
        dataTableOutput("seqMetaGene"), 
        uiOutput("BoxPlotButton"), 
        width = NULL 
        ), 
        box(
        title="BOXPLOT",solidHeader = TRUE, status="primary", 
        plotOutput("boxplotSnps"), 
        width = NULL 
        ) 
      ) 
    ) 
)) 


ui<- dashboardPage(
    dashboardHeader(title = "Results"), 
    sidebar, 
    body 
) 


server <- function(input, output,session) {} 

shinyApp(ui = ui, server = server) 
+0

你试过吗?身体{0} {0} {0}}余量:0; 填充:0;最小高度:100%; } – tech2017

+0

谢谢,@ tech2017,我现在试过了,不幸的是我仍然得到相同的结果 – Bea

回答

1

您需要在fluidRow来包装你column S,这样它会工作。

这样的:工作示例的

fluidRow(column(...), 
     column(...)) 

截图: enter image description here

+0

它的工作,谢谢! – Bea