-
Notifications
You must be signed in to change notification settings - Fork 3
Creating a new analysis module
Joe Marlo edited this page Sep 26, 2022
·
6 revisions
Analysis modules should be structured as Shiny modules and follow the golem
framework. The process to create a new module is:
- Use the
dev/02_dev.R
script to create a new module template - Write your analysis module
- Integrate the module into the main application by placing it in the
R/app_ui.R
andR/app_server.R
files
-
app_ui.R
: Add code in two places. Follow the pattern in the dashboard body here and dashboard sidebar here -
app_server.R
: Add code in the server following the pattern here - Store the module ID in the module_ids object established in the
R/utils_global.R
file
Any data that needs to passed between the main server and modules or between modules should be saved to the store
object. This is equivalent to "stratégie du petit" in the Engineering Shiny book. The store
object should be passed to the module as an argument, and, if modified by the module, should be returned by the module.