在浏览器中默认缩小闪亮的应用程序
Zoom out shiny app at default in browser
当我打开闪亮的应用程序时,我发现当我缩小到 75% 时它们看起来更好看。我怎样才能强制闪亮的应用程序以 75% 的速度打开,也在服务器上?我已经尝试过他们在 this link 中提到的方法,但它似乎不起作用。
css:
.content-wrapper,
.right-side {
background-color: #ffffff;
}
#controls {
zoom: 0.75;
}
谢谢
使用这个 SO 答案:
library(shiny)
# Define UI for application that draws a histogram
ui <- shinyUI(fluidPage(
tags$style("
body {
-moz-transform: scale(0.8, 0.8); /* Moz-browsers */
zoom: 0.8; /* Other non-webkit browsers */
zoom: 80%; /* Webkit browsers */
}
"),
# Application title
titlePanel("Old Faithful Geyser Data"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
))
# Define server logic required to draw a histogram
server <- shinyServer(function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
})
# Run the application
shinyApp(ui = ui, server = server)
当我打开闪亮的应用程序时,我发现当我缩小到 75% 时它们看起来更好看。我怎样才能强制闪亮的应用程序以 75% 的速度打开,也在服务器上?我已经尝试过他们在 this link 中提到的方法,但它似乎不起作用。 css:
.content-wrapper,
.right-side {
background-color: #ffffff;
}
#controls {
zoom: 0.75;
}
谢谢
使用这个 SO 答案:
library(shiny)
# Define UI for application that draws a histogram
ui <- shinyUI(fluidPage(
tags$style("
body {
-moz-transform: scale(0.8, 0.8); /* Moz-browsers */
zoom: 0.8; /* Other non-webkit browsers */
zoom: 80%; /* Webkit browsers */
}
"),
# Application title
titlePanel("Old Faithful Geyser Data"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
))
# Define server logic required to draw a histogram
server <- shinyServer(function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
})
# Run the application
shinyApp(ui = ui, server = server)