2016-03-31 15 views
1

Shinyダッシュボードページを作成しようとしています。さまざまな種類のプロットをタブページに表示し、ユーザーが設定を動的に変更できるようにしています。私はこれにライン10を変更した場合カラムを使用してシャイニーダッシュボードのtabBoxコントロールを制御する

library(shiny) 
    library(shinydashboard) 

    body <- dashboardBody(
    fluidRow(
     tabBox(
      title = "First tabBox", 
      # The id lets us use input$tabset1 on the server to find the current tab 
      id = "tabset1", 
      tabPanel("Tab1", "First tab content", plotOutput('test')), 
      tabPanel("Tab2", "Tab content 2") 
     ), 
     tabBox(
      side = "right", 
      selected = "Tab3", 
      tabPanel("Tab1", "Tab content 1"), 
      tabPanel("Tab2", "Tab content 2"), 
      tabPanel("Tab3", "Note that when side=right, the tab order is reversed.") 
     ) 
    ), 
    fluidRow(
     tabBox(
      # Title can include an icon 
      title = tagList(shiny::icon("gear"), "tabBox status"), 
      tabPanel("Tab1", 
        "Currently selected tab from first box:", 
        verbatimTextOutput("tabset1Selected") 
      ), 
      tabPanel("Tab2", "Tab content 2") 
     ) 
    ) 
) 

    shinyApp(
    ui = dashboardPage(
     dashboardHeader(title = "tabBoxes"), 
     dashboardSidebar(), 
     body 
    ), 
    server = function(input, output) { 
     # The currently selected tab from the first box 
     output$tabset1Selected <- renderText({ 
      input$tabset1 
     }) 
     output$test = renderPlot(
      boxplot(len ~ dose, data = ToothGrowth, 
      boxwex = 0.25, at = 1:3 - 0.2, 
      subset = supp == "VC", col = "yellow", 
      main = "Guinea Pigs' Tooth Growth", 
      xlab = "Vitamin C dose mg", 
      ylab = "tooth length", 
      xlim = c(0.5, 3.5), ylim = c(0, 35), yaxs = "i")) 
    } 
) 

::私は列に見出しと箱ひげ図の分割を取得

tabPanel("Tab1", column(4,"First tab content"), 
       column(8, plotOutput('test')) 
       ), 

を、光沢のあるダッシュボードページは、私がページの積層バージョン(https://rstudio.github.io/shinydashboard/structure.html#tabbox)を取得することができますtabBoxはそれらを含むように展開されなくなりました。

tabPanelの内容を制御して、出力の列フォーマットを許可する方法はありますか?

答えて

2

fluidRowまたはfluidPageの中に列をラップするだけです。その後、tabPanelは適切なサイズになり、列に合わせて広がります。

+0

これは簡単に狂っていました。なぜ私はそれを以前に気付かなかったのか分かりません。ありがとうございました! – KirkDCO

関連する問題