我想创建一个闪亮的应用程序,使用tabsetPanel,但是当我创建选项卡,在应用中的内容不再填充窗口的整个空间和叶上白色的大缺口不填充整个页面正确和低于输出。以下是它发生的一个非常基本的例子。没有选项卡,该应用程序完美地作为一个流动页面工作,但对于我正在做的工作,我需要将其分解为选项卡。TabsetPanel闪亮
一个简单的例子:
`library(shiny)
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Old Faithful Geyser Data"),
mainPanel(
tabsetPanel(
tabPanel("Test",
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)),
#Create second tab just for demonstration
tabPanel("Second Test", h3("Test")
))))
# Define server logic required to draw a histogram
server <- function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
{ "example second tab" }
}
# Run the application
shinyApp(ui = ui, server = server) `
我试图摆弄fillPage和fluidPage,但它要么使情况变得更糟通过将对象移动到错误的地方或者什么都没有发生。这是发生在我身上吗?有没有人有任何想法是什么原因可以做到这一点,如果是的话,它是如何解决的?
如果要调整标签集面板的宽度和高度,这篇文章可能会有所帮助:https://stackoverflow.com/questions/19096439/shiny-how-to-adjust-the-width-of-the -tabsetpanel –