| preview_module {SIAtools} | R Documentation | 
Preview a module
Description
Previews a SIA module in a standalone development environment. See the details below.
Usage
preview_module(
  module_id = NULL,
  ui_imports = NULL,
  server_imports = NULL,
  ui_elements = sia_head_tag(),
  save_and_document = TRUE,
  load = TRUE,
  proj = curr_proj(),
  ...
)
Arguments
| module_id | character, name of the module to preview (including the
prefix). If  | 
| ui_imports | list, UI objects exported from the  | 
| server_imports | list, reactive objects exported from the
 | 
| ui_elements | elements to include in  | 
| save_and_document | logical, whether to save all unsaved files (only available in RStudio)
and document the package. Defaults to  | 
| load | logical, whether to load your package
before running the module preview. Defaults to  | 
| proj | character, a path to the project. Defaults to current project. | 
| ... | Arguments passed on to  
 | 
Details
The function takes module's function bindings and puts (or evaluates) them
inside a bare bone shiny::shinyApp(). By default, a customized head tag is
injected in order to mimic the "environment" of full {ShinyItemAnalysis}
app. See sia_head_tag() for more details. Besides, a onSessionEnded hook
is set to call shiny::stopApp() after the client disconnects, so the
"process" is automatically quit after you close the preview in your browser
or RStudio viewer.
In order to use the function bindings, preview_module() attempts to
load your package without the actual installation by
default.
Note that you have to install the package as usual for
{ShinyItemAnalysis} to detect your modules.
Using objects from the  {ShinyItemAnalysis} app
Note that this "emulated" preview environment is really meant to test the
basic UI layout and functionality and is not able to receive any object from
{ShinyItemAnalysis} app. However, you can pass any object like
{ShinyItemAnalysis} does to server_imports argument manually. For further
details and examples, please refer to vignette("imports", "SIAtools")
vignette.
Value
Shiny app object of class shiny.appobj.
See Also
Other module management functions:
add_module(),
get_modules(),
remove_module()
Examples
if (interactive()) {
  preview_module()
}