Kev*_*vin 5 css r shinydashboard
zoom我正在尝试在我的浏览器上实现ShinyDashboard,因为当 Web 浏览器缩放 80% 时,布局看起来更好。
我找到了一篇关于应用程序的文章Shiny,但是,它不适用于Shinydashboard. 当我实现 CSS 时,我得到了很多死空白。
文章 SO:在浏览器中默认缩小闪亮的应用程序
简单代码示例:
library(shiny)
library(shinydashboard)
header <- dashboardHeader()
sidebar <- dashboardSidebar()
body <- dashboardBody(
tags$style("
body {
-moz-transform: scale(0.8, 0.8); /* Moz-browsers */
zoom: 0.8; /* Other non-webkit browsers */
zoom: 80%; /* Webkit browsers */
}
"),
"test")
ui <- dashboardPage(header, sidebar, body)
server <- function(input, output, session) {}
shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)
height我不知道这是否解决了您的问题,但尝试在您的应用程序中 添加
library(shiny)
library(shinydashboard)
header <- dashboardHeader()
sidebar <- dashboardSidebar()
body <- dashboardBody(
fluidPage(
tags$head(tags$style(HTML('
.content-wrapper,
.right-side {
background-color: #ffffff;
height: 1200px;
}
body{
-moz-transform: scale(0.8, 0.8); /* Moz-browsers */
zoom: 0.7; /* Other non-webkit browsers */
zoom: 70%; /* Webkit browsers */
}
'))),
"test")
)
ui <- dashboardPage(header, sidebar, body)
server <- function(input, output, session) {}
shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)