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