Skip to content

Commit 405c214

Browse files
committed
add instructions to add a new component
1 parent 0ce0ade commit 405c214

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ Entries in the logger can be accessed using `logger <- app$get_value(export = "l
212212
The default behaviour of requiring an `actionButton` to be pressed every time a module is run may not always be appropriate or desirable. It is possible to alter the architecture of the modules to run either automatically when certain conditions are met (e.g. after another module runs) or semi-automatically so that pressing the button once is required, but afterwards any changes in inputs automatically rerun the module. Examples of how to achieve this were added in v0.2.6 in the `plot_auto` and `plot_semi` modules in the example app. In the case of the automatic module, the `common$meta$plot_auto$used` flag is set inside the `renderPlot` which ensures that while the module runs automatically, it will only be included in the reproducible version if the module's results have been viewed by the user.
213213

214214
#### Adding extra modules
215-
Further modules can be added using `create_module()` which creates the four files for the module. The module configuration file then needs to be added to `base_module_configs` in `global.R` and should be placed in the relevant position for the analysis since this vector controls the order of chunks within the Rmarkdown output. Any extra data objects that the modules creates must be added to `common.R`. This does not currently create the testing files or function file so these must be added manually.
215+
Further modules can be added using `create_module()` which creates the four files for the module and the test and function files. The module configuration file then needs to be added to `base_module_configs` in `global.R` and should be placed in the relevant position for the analysis since this vector controls the order of chunks within the Rmarkdown output. Any extra data objects that the modules creates must be added to `common.R`. The intro tab also needs manually updating found in `inst/shiny/Rmd/text_intro_tab.Rmd`.
216+
217+
#### Adding extra components
218+
To add a new component, several manual steps are required. Edit the `COMPONENTS` vector in `global.R` with the short name of the new component in the relevant position. In `ui.R`, search for `window_title` and then insert `nav_panel("<long name>", value = "<short name>"),` in the relevant position of the other components. Then also in `ui.R` search for `insert_modules_ui` and add `insert_modules_ui("<short name>", "<long name>"),` in the relevant position. Finally add modules as explained in the section above.
216219

217220
#### Asynchronous modules
218221
Support for asynchronous operations was added in v0.2.0 using the new `ExtendedTask` feature added in `{shiny}` v1.8.1. This has the advantage of allowing long-running operations to run in the background whilst the app remains responsive to the user and any other users connected to the same instance. Running modules asynchronously increases complexity however and requires several changes to structure of modules and the app itself. The `select_async` module contains an implementation that is functionally identical to `select_query` but runs asynchronously.

0 commit comments

Comments
 (0)