Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to create progress bar without a close button #3067

Closed
wants to merge 2 commits into from
Closed

Allow to create progress bar without a close button #3067

wants to merge 2 commits into from

Conversation

ColinFay
Copy link
Contributor

will close #2979

Demo apps:

system("cd tools && yarn build")
pkgload::load_all()

ui <- fluidPage(
  plotOutput("plot")
)

server <- function(input, output) {
  output$plot <- renderPlot({
    withProgress(
      closeButton = FALSE, 
      message = 'Calculation in progress',
      detail = 'This may take a while...', 
      value = 0, 
      {
        for (i in 1:15) {
          incProgress(1/15)
          Sys.sleep(0.25)
        }
      }
    )
    plot(cars)
  })
}

shinyApp(ui, server)

ui <- fluidPage(
  plotOutput("plot")
)

server <- function(input, output, session) {
  output$plot <- renderPlot({
    progress <- Progress$new(session, min=1, max=15, closeButton = FALSE)
    on.exit(progress$close())
    
    progress$set(message = 'Calculation in progress',
                 detail = 'This may take a while...')
    
    for (i in 1:15) {
      progress$set(value = i)
      Sys.sleep(0.5)
    }
    plot(cars)
  })
}

shinyApp(ui, server)

@schloerke schloerke deleted the branch rstudio:master November 1, 2021 15:55
@schloerke schloerke closed this Nov 1, 2021
@ColinFay
Copy link
Contributor Author

ColinFay commented Nov 1, 2021

@schloerke any reason for closing this PR?

@schloerke
Copy link
Collaborator

@ColinFay I believe this was an automated action by GitHub.

Re-opening and setting the base branch to main

@schloerke
Copy link
Collaborator

@ColinFay I can not manually point the merge branch. Do you mind resubmitting the PR? Sorry for the hassle

@ColinFay
Copy link
Contributor Author

ColinFay commented Nov 1, 2021

Ah, i just noticed you've deleted the master branch. I seem to remember that if you delete a branch, all PR to that branch are automatically closed 🤔

I've been bitten by this before when accidentally deleting a dev branch 😅

will redo the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Progress with 'closeButton' option
2 participants