Pipelines can be used as part of Shiny widgets or apps. In the following example, we define a simple pipeline which generates a chart, and use that to power a shiny widget.
In this example, we emulate streaming dataset using the shiny::reactivePoll
function and randomly sampling from an existing sample dataset in the package.
data("iris")
shinyPipeline <- AnalysisPipeline()
shinyPipeline %>>% setLoggerDetails(target = "none")
shinyPipeline %>>% univarCatDistPlots(uniCol = "Species", priColor = "blue", optionalPlots = 0, storeOutput = T) -> shinyPipeline
We then use the pipeline within the shiny::renderPlot
function, and set the sampled data to execute the pipeline, and generate the chart. Since the data keeps changing due to our reactive poll, the expression within the shiny::renderPlot
function keeps getting called in the reactive context.