黄色面板是显示绘图的位置,如果生成了多个绘图并且无法在页面上查看,则应该可以滚动。绿色面板应该几乎就像页面上的页脚一样,并且即使黄色面板滚动也是固定的。
到目前为止,这是我的代码。我设法得到了蓝色、黄色和绿色的面板,但不确定如何使东西可以滚动和固定。
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.
