我想确定Shiny浏览器窗口的大小,以帮助我更好地布局我的情节div.具体来说,我想确定窗口的宽高比,看看我应该在屏幕上分布多少div,它看起来还不错.我最初的想法是情节的数量floor(width/(height-navbar_height)).
我做了一些寻找这个,我目前无法找到一个可能的解决方案,目前我认为这个功能根本不存在于clientData结构中.有什么想法吗?
这是我的代码:
library(shiny)
library(ggplot2)
library(ggiraph)
df <- data.frame(achseX = LETTERS[1:24], achseY = 1:24, facetX = as.factor(rep(1:4, each = 6)))
server <- function(input, output) {
output$ggplot <- renderPlot({
ggplot(data = df) + geom_bar_interactive(aes(tooltip = achseY, x = achseX, y = achseY), stat = "identity") +
theme_minimal() + facet_grid(.~ facetX, scales = "free_x")
})
output$plot <- renderggiraph({
gg <- ggplot(data = df) + geom_bar_interactive(aes(tooltip = achseY, x = achseX, y = achseY), stat = "identity") +
theme_minimal() + facet_grid(.~ facetX, scales = "free_x") …Run Code Online (Sandbox Code Playgroud)