【发布时间】:2020-09-11 16:02:39
【问题描述】:
在 Shiny 中是否可以有这样的布局?
理想情况下,我想要一个左右侧边栏(我在shinydashboardPlus 中看到了一些解决方案,但这并不是我所追求的……)
我有一个与此示例结构类似的应用:
mychoices <- c("pick me A",
"pick me - a very long name here",
"no pick me - B",
"another one that is long")
ui <-
navbarPage(
tabPanel("Dataset description",
),
tabPanel("Data",
sidebarLayout(
sidebarPanel(
fluidRow(
column(2,
p(strong("Classes")),
actionButton(inputId = "selectall", label="Select/Deselect all",
style='padding:12px; font-size:80%'),
br(), br(),
checkboxGroupButtons(
inputId = "classes",
choices = mychoices,
selected = mychoices,
direction = "vertical",
width = "100%",
size = "xs",
checkIcon = list(
yes = icon("ok",
lib = "glyphicon"))
),
),
column(6,
br()
),
column(4,
p(strong("Controls")),
p("Transparency"),
sliderInput("trans", NULL,
min = 0, max = 1, value = .5),
actionButton("resetButton", "Zoom/reset plot",
style='padding:6px; font-size:80%'),
actionButton("clear", "Clear selection",
style='padding:6px; font-size:80%'),
actionButton("resetColours", "Reset colours",
style='padding:6px; font-size:80%'),
)
)
),
mainPanel(
tabsetPanel(type = "tabs",
tabPanel("Scatter", id = "panel1",
plotOutput(outputId = "scatter")),
tabPanel("PCA", id = "panel2"))
)
))
)
server <- function(input, output) {}
shinyApp(ui, server)
理想情况下,我想拆分sidebarLayout,以便一列在左侧(类),一列在右侧(控件),因为当应用加载时这两列是overlapping like this。
请对更好的应用程序设计或解决方案有任何建议吗?
【问题讨论】:
-
感谢@Waldi,但在我的帖子中已经提到我已经看过
shinydashboardPlus并且实际上有一个active post 寻求如何修复侧边栏以模仿上述内容。我希望有一个更简单更优雅的解决方案 -
抱歉,我读得太快了……我这边没有其他解决方案。