默认情况下,如何在ShinydashboardPlus中保持右侧边栏的展开?

时间:2020-07-17 03:06:00

标签: r shiny shinydashboard

我希望默认情况下可以扩展右侧边栏,而无需单击右上方的图标。我以为shinydashboardPlus包中的文档中可能有解决方案,但找不到。

以下是该应用的一些示例代码:

if (interactive()) {
  library(shiny)
  library(shinydashboard)
  shinyApp(
    ui = dashboardPagePlus(
      header = dashboardHeaderPlus(
        enable_rightsidebar = TRUE,
        rightSidebarIcon = "gears"
      ),
      sidebar = dashboardSidebar(),
      body = dashboardBody(),
      rightsidebar = rightSidebar(
        background = "dark",
        rightSidebarTabContent(
          id = 1,
          icon = "desktop",
          title = "Tab 1",
          active = TRUE,
          sliderInput(
            "obs",
            "Number of observations:",
            min = 0, max = 1000, value = 500
          )
        ),
        rightSidebarTabContent(
          id = 2,
          title = "Tab 2",
          textInput("caption", "Caption", "Data Summary")
        ),
        rightSidebarTabContent(
          id = 3,
          title = "Tab 3",
          icon = "paint-brush",
          numericInput("obs", "Observations:", 10, min = 1, max = 100)
        )
      ),
      title = "Right Sidebar"
    ),
    server = function(input, output) { }
  )
}

0 个答案:

没有答案