2017-09-16 3 views
2

これは私のprevious questionの拡張です。今私はメインパネルの高さを伸ばすことができません。光沢のあるダッシュボードメインパネルの高さの問題

これは、プロットは、デフォルトのレイアウトスペースの外に付着していると私は高さを高くするmainPanel()のいずれかのオプションを見つけることではないのです

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(

    mainPanel(width = 12, 

     tabsetPanel(

     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", height = "600px"))), 
        column(width = 4, box(title = "Plot2", width = NULL, solidHeader = FALSE, plotOutput("plot2", height = "600px"))), 
        column(width = 4, box(title = "Plot3", width = NULL, solidHeader = FALSE, plotOutput("plot3", height = "600px"))) 


       ) 

     ) 
    ) 
    ) 
)) 

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) 

以下の私のコードです。私はこのmainPanel(width = 12, height, 20 ....)のようにmainPanel()の高さの値を強制しようとしましたが、うまくいかなかったのです。どんな提案も大歓迎です。

+ Main Panel Height issue

---------この場合に役立ちますとき、私は、これは問題ではありません

わからない-------------更新しましたあなたはshinydashboardからの機能ではなく、標準shinyパッケージを使用していない

library(shiny) 
library(shinydashboard) 
library(DT) 

ui <- dashboardPage(
    dashboardHeader(title = "Dynamic boxes"), 


    dashboardSidebar(
    conditionalPanel(condition="input.tabselected==3", 
        textInput("text", "Enter Id:"), 
        box(width = 1, background = 'purple'), 
        actionButton("Ok", "Press Ok",style='padding:8px; font-size:100%') 
    ) 
), 
    dashboardBody(
    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", height = "600px"))), 
    column(width = 4, box(title = "Plot2", width = NULL, solidHeader = FALSE, plotOutput("plot2", height = "600px"))), 
    column(width = 4, box(title = "Plot3", width = NULL, solidHeader = FALSE, plotOutput("plot3", height = "600px"))) 


) 



) 
) 


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) )}) 
    #output$dat4 <- renderDataTable({datatable(data.frame(HairEyeColor),extensions = 'Responsive')}) 
} 

shinyApp(ui, server) 
+0

プロットの高さを '600px' –

+0

@ kevin.arseneauにハードコーディングしました。これは無関係です。 –

答えて

3

)(mainpanelを使用すると、あなたはfluidRowの内側にあなたのtabBoxをラップする必要がいけません。

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

Kevinに感謝します。主にダッシュボードの機能を理解するための作業があります。 –

+0

@SundownBrownbear、心配はありません、私は努力が報われると確信しています。 –

関連する問題