Description Usage Arguments Value Examples
Conditionally file a signal at fixed fps.
1 | fpsWhen(when, rate)
|
when |
A reactive that evaluates to TRUE or FALSE. |
rate |
Number of signals to fire per second |
A reactive giving the time in seconds since the last signal. The first time after a pause is always zero - this way summing the signal gives the amount of sum the output signal has been running
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | shinyApp(
ui = fluidPage(
textOutput("delta"),
textOutput("running"),
textOutput("count"),
checkboxInput("pause", "pause")
),
server = function(input, output) {
tick <- reactive(!input$pause) %>% fpsWhen(10)
running <- tick %>% reducePast(`+`, 0)
count <- tick %>% count()
output$delta <- renderText(tick())
output$running <- renderText(running())
output$count <- renderText(count())
}
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.