4
我希望将闪亮绘图的输出高度和宽度调整为当前窗口大小。我试图使用下面但没用。根据窗口大小动态调整闪亮绘图输出的高度和/或宽度
ShinyUi <- fluidPage(
# Application title
titlePanel("title"),
sidebarLayout(
sidebarPanel(
... inputs ...
),
mainPanel(
plotlyOutput("distPlot", height = 'auto', width = 'auto')
)
))
ShinyServer <- function(input, output, session) {
output$distPlot <- renderPlotly({
p <- ggplot(dataShow, aes(x=dataShow$X, y=dataShow$Y)) +
geom_point(shape=1, alpha = 0.5, color = "grey50")
ggplotly(p)
})
}
# Run the application
shinyApp(ui = ShinyUi, server = ShinyServer)
您是否知道在服务器功能中使用其他选项,而不是上述UI功能的用法?
你已经在使用'fluidPage()'? – BigDataScientist
@BigDataScientist请查看更新后的文章中包含的代码结构。 – Prradep
当你说'闪亮阴谋输出高度和宽度调整到当前窗口大小'时,你是什么意思?你想让它占据一定比例的屏幕尺寸吗? – SBista