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(shinycssloaders) | |
library(ggplot2) | |
# for spinners 2-3 match the background color of wellPanel | |
options(spinner.color.background="#F5F5F5") | |
ui <- fluidPage( | |
wellPanel( | |
tags$b("This example shows the loading spinner whilst the plot is loading and hides the spinner when the plot is not shown."), |
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
#' An example to create asyncronously evaluated eventReactives. | |
library(shiny) | |
#' An async version of eventReactive, using the 'future' package to spawn a seperate process to evaluate the handler expression. | |
#' Unlike in usual eventReactive, the handlerExpr cannot have a side-effect on the main application, as it is evaluated in a seperate | |
#' process. | |
#' @param eventExpr The expression triggering the handlerExpr. It is evaluated _synchronously_. | |
#' @param handlerExpr The expression being calculated in async. | |
#' @return Returns a reactive that can be used in other reactives that depend on the async result | |
eventReactiveAsync <- function(eventExpr,handlerExpr,event.env = parent.frame(),handler.env=parent.frame(),...) { |