Created
October 1, 2013 16:20
-
-
Save xiaodaigh/6781097 to your computer and use it in GitHub Desktop.
Shiny output doesn't run if no input?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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