RinteRface / shinydashboardPlus

extensions for shinydashboard
https://shinydashboardplus.rinterface.com
Other
455 stars 77 forks source link

disable the {min-height: 611px} property in body #31

Closed yenzichun closed 3 years ago

yenzichun commented 5 years ago

hi, While searching r shiny dashboard, I found your package very, very useful!

But now I'm facing a problem, which is when I want to create a map on the dashboard, there are some blank part at the bottom. image

I want the map to be fill the whole browser, without the scroll on the right side.

While checking with the inspector, I found that if I can disable the property{min-height: 611px} in the body, then the problem is fixed. image

But I don't know where I can adjust that property. Seems like it's automatically assigned when creating the shiny app. Is there a work-around to solve this?

Here's the sample code:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(dplyr)
library(leaflet)

header <- dashboardHeaderPlus(
    titleWidth = 200,
    enable_rightsidebar = TRUE,
    rightSidebarIcon = "gears"
)
sidebar <-  dashboardSidebar(
    width = 200,
    sidebarMenu(
        id = "tabs",
        menuItem("Map", tabName = 'map1',
                 icon = icon("map-marked-alt")
        )
    )
)
body <- dashboardBody(
    tags$head(
        tags$style(HTML('
                        #myMap {height: calc(90vh) !important;}
                        .content, .container-fluid {padding: 0px;}
                        '))
        ),
    fluidPage(
        leafletOutput("myMap")
    )
)

ui <- dashboardPagePlus(
    header,
    sidebar,
    body,
    collapse_sidebar = T,
    rightsidebar = rightSidebar(),
    skin="green"
)

server <- function(input, output, session) {
    output$myMap = renderLeaflet({
        leaflet(options = leafletOptions(zoomControl = FALSE)) %>% 
            addProviderTiles(providers$Wikimedia)
    })
}

shinyApp(ui, server)

Thank you in advance!

DivadNojnarg commented 3 years ago

It is coming from {shinydashboard} that sets the value inside dashboardPage.