I would like to build a shiny panel with the following layout:
The yellow panel is where plots will be displayed and should be scroll-able if multiple plots are produced and can't be viewed on the page. The green panel should almost be like a footer on the page and fixed even as the yellow panel is scrolled.
This is my code so far. I have managed to get the blue, yellow and green panels, but am unsure how to make things scroll-able and fixed.
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.