Create a Shiny app that can be used immediately, or incorporated into a larger Shiny app.

composable_shiny_app(ui, server, title = NULL, enableBookmarking = "server",
  output = NULL)

Arguments

ui

UI part of the Shiny app.

server

Server part of the Shiny app. This should take a single parameter, env.

title

Title of the app.

enableBookmarking

Parameter passed to shinyApp. A bookmark button is displayed unless enableBookmarking is "disable".

output

Name in env that will contain a reactive value that produces an output (eg for use as a gadget).

Value

A shiny.appobj.

This object has two additional properties, $component_ui and $component_server.

A larger composable Shiny app would incorporate $component_ui into its own ui, and make sure to call $component_server(env) from from its own server function.

Note that Shiny now has its own system for creating Shiny "modules". Varistran components will be converted to also support this style over time. shiny_plot already supports this.

Details

Unlike a normal Shiny app, the server function is passed an environment, "env". This contains $input, $output and $server elements conventionally passed to a Shiny server function. However env can also be used to store reactive expressions that other components of a larger app might need to access.