Shiny中有一个主面板和两个侧面板

web*_*ing 4 shiny

使用有光泽,没有人碰巧知道如何创建一个主面板(中)和两个侧面板的UI(左,右),每一个都有自己的水平和垂直滚动条?

非常感谢.

Xio*_*Jin 5

你可以使用fluidRowcolumn.这是一个例子.您可以调整列宽,只要总数增加到12.

library(shiny)

ui <- shinyUI(fluidPage(

   titlePanel("Old Faithful Geyser Data"),

   fluidRow(
     column(2,
            sliderInput("bins",
                        "Number of bins:",
                        min = 1,
                        max = 50,
                        value = 30),
            style="overflow-x: scroll; overflow-y: scroll"),
     column(8,
            plotOutput("distPlot")),
     column(2,
            textInput("test", "Test"),
            style="overflow-x: scroll; overflow-y: scroll")
   )
))

server <- shinyServer(function(input, output) {

   output$distPlot <- renderPlot({
      x    <- faithful[, 2] 
      bins <- seq(min(x), max(x), length.out = input$bins + 1)

      hist(x, breaks = bins, col = 'darkgray', border = 'white')
   })
})

shinyApp(ui = ui, server = server)
Run Code Online (Sandbox Code Playgroud)