如何防止光泽在加载/启动时绘制任何数据?
例如,来自example,
shinyUI(pageWithSidebar(
headerPanel("Click the button"),
sidebarPanel(
sliderInput("obs", "Number of observations:",
min = 0, max = 1000, value = 500),
actionButton("goButton", "Go!")
),
mainPanel(
plotOutput("distPlot")
)
))
shinyServer(function(inhttps://shiny.rstudio.com/articles/isolation.htmlput, output) {
output$distPlot <- renderPlot({
# Take a dependency on input$goButton
input$goButton
# Use isolate() to avoid dependency on input$obs
dist <- isolate(rnorm(input$obs))
hist(dist)
})
})
Shiny会在应用程序启动后立即绘制数据。但是我不希望它在点击按钮之前进行绘图。
有什么想法吗?