Skip to content

Instantly share code, notes, and snippets.

@xiaodaigh
Created October 1, 2013 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiaodaigh/6781097 to your computer and use it in GitHub Desktop.
Save xiaodaigh/6781097 to your computer and use it in GitHub Desktop.
Shiny output doesn't run if no input?
library(shiny)
library(shinyIncubator)
options(shiny.reactlog=TRUE);
shinyServer(function(input, output,session) {
output$test <- renderPlot({
input$meh
print("wassup")
withProgress(session, min=1, max=15, {
setProgress(message = 'Calculation in progress', detail = 'This may take a while...')
for (i in 1:15) {
print(i)
setProgress(value = i)
Sys.sleep(0.5)
}
})
plot(1,1)
})
#outputOptions(output, 'test', suspendWhenHidden=FALSE)
#outputOptions(output, 'test1', suspendWhenHidden=FALSE)
})
library(shinyIncubator)
shinyUI(pageWithSidebar(
headerPanel("Shiny Text"),
sidebarPanel(),
# Show the caption and plot of the requested variable against mpg
mainPanel(
actionButton("id","meh"),
tabsetPanel(
tabPanel("test1",plotOutput("test"),
progressInit()),
tabPanel("test2",plotOutput("test1"))
)
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment