Is it possible to adjust the heights of all plots in a shiny dashboard that are included in boxes to any screen resolution. As you can I try using css
but the plots are getting bigger. If I reduce from 100vh
manually then they fit better but I would like a generic solution since the result differs from screen to screen resolution.
library(shiny)
library(shinydashboard)
shinyApp(
ui = dashboardPagePlus(
header = dashboardHeaderPlus(
enable_rightsidebar = TRUE,
rightSidebarIcon = "gears"
),
sidebar = dashboardSidebar(),
body = dashboardBody(
tags$head(tags$style(".shiny-plot-output{height:100vh !important;}")),
navbarPage("Navbar!",
tabPanel("Plot",
boxPlus(
plotOutput("plot1")
)
),
tabPanel("Summary",
boxPlus(
plotOutput("plot2")
)
))
),
title = "Right Sidebar"
),
server = function(input, output) {
output$plot1 <- renderPlot({
plot(cars, type=input$plotType)
})
output$plot2 <- renderPlot({
plot(cars, type=input$plotType)
})
}
)