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

Add natural stop() effect #1

Closed
laresbernardo opened this issue Mar 1, 2024 · 1 comment · Fixed by #2
Closed

Add natural stop() effect #1

laresbernardo opened this issue Mar 1, 2024 · 1 comment · Fixed by #2
Labels
enhancement New feature or request

Comments

@laresbernardo
Copy link

Thanks for building this really nice add-on. I'm adding it so that it gets triggered once the user marks as finished a whole process of a shiny app I'm working on. Nice (hidden) touch!

Sharing the code as an additional use-case where the fireworks are triggered for 5 seconds and then stop. In case you'd like me to add it to the README, let me know.

In UI

checkboxInput("final_model", "Report as final model", FALSE)

In server

  fw <- fireworks::Fireworks$new()
  observeEvent(input$final_model, {
    fw$stop()
    if (isTRUE(input$final_model)) {
      fw$start()
      Sys.sleep(5)
      fw$stop()
    }
  })

Finally, regarding the "special effects", is there a way to set stop() to stop "launching fireworks" instead of simply getting rid of all at the same time to have a more natural stopping effect?

@hypebright hypebright added the enhancement New feature or request label Mar 1, 2024
@hypebright hypebright changed the title Well done! Thanks for sharing. Looking for natural stop() effect ADd natural stop() effect Mar 1, 2024
@hypebright hypebright changed the title ADd natural stop() effect Add natural stop() effect Mar 1, 2024
@hypebright
Copy link
Owner

Thanks for raising this @laresbernardo .

I can leverage updateOptions to add an "fade out" effect. It can then be provided as an argument to stop(), like so:

fw <- Fireworks$new()
fw$start()
Sys.sleep(5)
fw$stop(fadeOut = TRUE)

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

Successfully merging a pull request may close this issue.

2 participants