【发布时间】:2016-06-06 03:36:55
【问题描述】:
我想创建一个闪亮的应用程序,其中有一个 sidebarPanel 和 tabesetPanel。
我使用下面的代码创建了应用程序
library(shiny)
library(ggplot2)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
h1("Shiny app"),
tags$hr(),
h2("several options here"),
width =2),
mainPanel(uiOutput("tb"))
)
)
server <- function(input,output){
output$diamonds1 <- renderPlot({
ggplot(diamonds, aes(x=carat, y=price, col=clarity)) +
geom_point(alpha=0.5)+ facet_wrap(~color, scales="free")
})
output$diamonds2 <- renderPlot({
ggplot(diamonds, aes(x=carat, y=price, col=clarity)) +
geom_point(alpha=0.5)+ facet_wrap(~cut, scales="free")
})
output$info <- renderPrint({
nearPoints(diamonds, input$plot_click, threshold = 10, maxpoints = 1,
addDist = TRUE)
})
output$tb <- renderUI({
tabsetPanel(tabPanel("First plot",
plotOutput("diamonds1")),
tabPanel("Second plot",
plotOutput("diamonds2", click = "plot_click"),
verbatimTextOutput("info")))
})
}
shinyApp(ui = ui, server = server)
我希望 tabsetPanel 覆盖 sidebarPanel 右侧的整个区域。
按照the answers of this question的建议,我尝试了以下
div(, class ="span12")
和
), style='width: 1000px;)
但是,tabset 面板和绘图仍然没有覆盖 sidebarPanel 右侧的整个区域。
有什么建议吗?
更新
感谢@K。罗德的回答,情节现在覆盖了侧边栏面板旁边页面的整个高度,但仍然没有覆盖整个宽度
【问题讨论】: