【发布时间】:2020-06-26 20:33:24
【问题描述】:
黄色面板是显示绘图的地方,如果生成了多个绘图并且无法在页面上查看,则应该可以滚动。绿色面板应该几乎就像页面上的页脚一样,并且即使黄色面板滚动也是固定的。
到目前为止,这是我的代码。我设法获得了蓝色、黄色和绿色面板,但不确定如何使内容可滚动和固定。
data <- mtcars
ui <- fluidPage(
tags$head(
tags$style(HTML("body, pre { height: 100%}")),
tags$style("#panel1 {background: green; height: 100%; position: fixed}"),
),
fluidRow(id='row1',
column(2,id='panel1',
selectizeInput(inputId= "obs", label= "Obs",
choices= names(mtcars),
selected= names(mtcars)[1],
multiple=F),
selectizeInput(inputId= "sublevel", label= "Sublevel",
choices= sort(unique(mtcars$cyl)),
selected= sort(unique(mtcars$cyl))[1],
multiple=F)
),
column(10, id='panel2',offset = 2,
fluidRow(tableOutput("tab")),
fluidRow(textOutput("hi"))
)
)
)
server <- function(input, output){
sorted <- reactive({data %>% arrange_(input$obs) %>% filter(cyl == input$sublevel)})
output$tab= renderTable(sorted())
output$hi<-renderPrint(paste0("hello"))
}
shinyApp(ui = ui, server = server)
Any help is very much appreciated.
【问题讨论】:
-
也许使用 iframe 作为黄色面板,例如 this?
标签: shiny layout css r layout shiny shinyapps