Skip to content

Commit

Permalink
Move UI and server functions to a "For developers" section in the ref…
Browse files Browse the repository at this point in the history
…erence index.
  • Loading branch information
ml-ebs-ext committed Feb 25, 2025
1 parent a1033ae commit 3137a1e
Show file tree
Hide file tree
Showing 19 changed files with 134 additions and 634 deletions.
12 changes: 9 additions & 3 deletions R/mod_boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ BP <- poc( # nolint
#' It also includes a set of listings with information about the population, distribution and statistical comparisons.
#'
#' @name mod_boxplot
#' @inheritParams boxplot_server
#'
#' @keywords main
#'
NULL

#' @describeIn mod_boxplot UI
#' Boxplot UI function
#' @param id Shiny ID `[character(1)]`
#' @keywords developers
#' @export
boxplot_UI <- function(id) { # nolint
# id assert ---- It goes on its own as id is used to provide context to the other assertions
Expand Down Expand Up @@ -188,7 +190,8 @@ boxplot_UI <- function(id) { # nolint
}
}

#' @describeIn mod_boxplot Server
#' Boxplot server function
#' @keywords developers
#'
#' @description
#'
Expand Down Expand Up @@ -727,6 +730,8 @@ boxplot_server <- function(id,
#' Shiny ID of the module receiving the selected subject ID in the data listing. This ID must
#' be present in the app or be NULL.
#'
#' inheritParams boxplot_server
#'
#' @name mod_boxplot
#'
#' @keywords main
Expand Down Expand Up @@ -861,7 +866,8 @@ dataset_info_boxplot <- function(bm_dataset_name, group_dataset_name, ...) {

mod_boxplot <- CM$module(mod_boxplot, check_mod_boxplot, dataset_info_boxplot)

#' @describeIn mod_boxplot Boxplot wrapper when its output is fed into papo module
#' Boxplot wrapper when its output is fed into the papo module
#' @keywords main
#' @export
mod_boxplot_papo <- function(...) {
.Deprecated("mod_boxplot_papo", msg = "'mod_boxplot_papo' is no longer required and should be replaced by 'mod_boxplot'. It is still available for compatibility purposes") # nolint
Expand Down
14 changes: 8 additions & 6 deletions R/mod_corr_hm.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,21 @@ CH_MSG <- poc( # nolint

#' Correlation Heatmap module
#'
#' @param id Shiny ID `[character(1)]`
#'
#' @param default_cat Default selected categories
#'
#' @param default_par Default selected parameters
#'
#' @param default_visit Default selected visits
#'
#' @param default_corr_method Name of default correlation method
#'
#' @name mod_corr_hm
#'
#' @keywords main
#'
NULL

#' @describeIn mod_corr_hm UI
#' Correlation heatmap UI function
#'
#' @keywords developers
#'
#' @param id `[character(1)]`
#'
Expand Down Expand Up @@ -462,7 +460,9 @@ scatter_plot <- function(df, x_var, y_var) {
}


#' @describeIn mod_corr_hm Server
#' Correlation heatmap server function
#'
#' @keywords developers
#'
#' @param id `[character(1)]`
#'
Expand Down Expand Up @@ -862,6 +862,8 @@ ch_subset_data <- function(sel, cat_col, par_col, val_col, vis_col, bm_ds, subj_
#'
#' @name mod_corr_hm
#'
#' @inheritParams corr_hm_server
#'
#' @keywords main
#'
#' @export
Expand Down
11 changes: 7 additions & 4 deletions R/mod_forest.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,16 @@ FP_MSG <- poc(

#' Forest plot module
#'
#' @param id Shiny ID `[character(1)]`
#'
#' @name mod_forest
#' @inheritParams forest_server
#'
#' @keywords main
#'
NULL

#' @describeIn mod_forest UI
#' Forest plot UI function
#'
#' @keywords developers
#'
#' @param id `[character(1)]`
#'
Expand Down Expand Up @@ -461,7 +462,9 @@ gen_result_table_fun_ <- function(ds, sl, fun, label) {
gen_result_table_fun <- strict(gen_result_table_fun_)


#' @describeIn mod_forest Server
#' Forest plot server function
#'
#' @keywords developers
#'
#' @param id `[character(1)]`
#'
Expand Down
11 changes: 8 additions & 3 deletions R/mod_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ LP_CNT <- poc(

# UI and server functions

#' @describeIn mod_lineplot UI
# NOTE: id documented in lineplot_server
#' Lineplot UI function
#' @inheritParams lineplot_server
#' @keywords developers
#' @export
lineplot_UI <- function(id) {
# UI ----
Expand Down Expand Up @@ -545,7 +546,7 @@ generate_ref_line_data <- function(df, show_all_ref_vals) {
}


#' @describeIn mod_lineplot Server
#' Lineplot server function
#'
#' @param id Shiny ID `[character(1)]`
#'
Expand Down Expand Up @@ -635,6 +636,8 @@ generate_ref_line_data <- function(df, show_all_ref_vals) {
#'
#' Default projection for the Y axis
#'
#' @keywords developers
#'
#' @export
#'
lineplot_server <- function(id,
Expand Down Expand Up @@ -1548,6 +1551,8 @@ lineplot_server <- function(id,
#' Shiny ID of the module receiving the selected subject ID in the single subject listing. This ID must
#' be present in the app or be NULL.
#'
#' @inheritParams lineplot_server
#'
#' @name mod_lineplot
#'
#' @keywords main
Expand Down
11 changes: 7 additions & 4 deletions R/mod_roc.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,17 @@ ROC_PLOT_VAL <- poc(

#' ROC module
#'
#' @param id Shiny ID `[character(1)]`
#' @inheritParams roc_server
#'
#' @name mod_roc
#'
#' @keywords main
#'
NULL

#' @describeIn mod_roc UI
#' ROC UI function
#' @keywords developers
#' @inheritParams roc_server
#' @export
roc_UI <- function(id) {
# id assert It goes on its own as id is used to provide context to the other assertions
Expand Down Expand Up @@ -354,8 +356,8 @@ roc_UI <- function(id) {
}
}

#' @describeIn mod_roc Server
#'
#' ROC server function
#' @keywords developers
#' @description
#'
#' ## Input dataframes:
Expand Down Expand Up @@ -387,6 +389,7 @@ roc_UI <- function(id) {
#' one record per subject
#'
#' It expects to contain, at least, `subjid_var`
#' @param id Shiny ID `[character(1)]`
#'
#' @param pred_dataset,resp_dataset,group_dataset `[data.frame()]`
#'
Expand Down
9 changes: 7 additions & 2 deletions R/mod_scatter.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,16 @@ SP <- poc( # nolint
#' It also includes a set of listings with information about the population and the regression and correlation
#' estimates.
#'
#' @inheritParams scatterplot_server
#'
#' @name mod_scatterplot
#'
#' @keywords main
#'
NULL

#' @describeIn mod_scatterplot UI
#' Scatter plot UI function
#' @keywords developers
#' @param id Shiny ID `[character(1)]`
#' @export
scatterplot_UI <- function(id) { # nolint
Expand Down Expand Up @@ -194,7 +197,9 @@ scatterplot_UI <- function(id) { # nolint
}
}

#' @describeIn mod_scatterplot Server
#' Scatter plot server function
#'
#' @keywords developers
#'
#' @description
#'
Expand Down
8 changes: 5 additions & 3 deletions R/mod_scatter_matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ SPM <- poc( # nolint
#' of grouping. It also includes correlation stats.
#'
#' @name mod_scatterplotmatrix
#' @inheritParams scatterplotmatrix_server
#'
#' @keywords main
#'
NULL

#' @describeIn mod_scatterplotmatrix UI
#' Scatter plot matrix UI function
#' @keywords developers
#' @param id Shiny ID `[character(1)]`
#' @export
scatterplotmatrix_UI <- function(id) { # nolint
Expand Down Expand Up @@ -134,8 +136,8 @@ scatterplotmatrix_UI <- function(id) { # nolint
}
}

#' @describeIn mod_scatterplotmatrix Server
#'
#' Scatter plot matrix server function
#' @keywords developers
#' @description
#'
#' ## Input dataframes:
Expand Down
35 changes: 21 additions & 14 deletions R/mod_wfphm.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ WFPHM_MSG <- pack_of_constants( # nolint
#'
NULL

#' @describeIn wfphm_wf UI
#' Waterfall UI function
#' @keywords developers
wfphm_wf_UI <- function(id) { # nolintr

# id assert ---- It goes on its own as id is used to provide context to the other assertions
Expand Down Expand Up @@ -311,7 +312,8 @@ wfphm_wf_UI <- function(id) { # nolintr
}

# nolint start cyclocomp_linter
#' @describeIn wfphm_wf server
#' Waterfall server function
#' @keywords developers
wfphm_wf_server <- function(id,
bm_dataset,
group_dataset,
Expand Down Expand Up @@ -908,7 +910,8 @@ wfphm_wf_rename_cols <- function(df) {
#'
NULL

#' @describeIn wfphm_hmcat UI
#' Waterfall plus heatmap categorical heatmap UI function
#' @keywords developers
wfphm_hmcat_UI <- function(id) { # nolint

# id assert ---- It goes on its own as id is used to provide context to the other assertions
Expand Down Expand Up @@ -943,7 +946,8 @@ wfphm_hmcat_UI <- function(id) { # nolint
)
}

#' @describeIn wfphm_hmcat server
#' Waterfall plus heatmap categorical heatmap server function
#' @keywords developers
wfphm_hmcat_server <- function(id,
dataset,
subjid_var,
Expand Down Expand Up @@ -1906,9 +1910,7 @@ wfphm_hmpar_subset <- function(
#'
#' See the subsections for each of plots particularities
#'
#' @param id Shiny ID `[character(1)]`
#'
#' @param bm_dataset `[shiny::reactive(data.frame) | shinymeta::metaReactive(data.frame)]`
#' @param module_id Shiny ID `[character(1)]`
#'
#' It expects the following format:
#'
Expand All @@ -1917,8 +1919,6 @@ wfphm_hmpar_subset <- function(
#' - `cat_var`, `par_var`, `visit_var` and `subjid_var` columns are factors
#' - It contains at least 1 row
#'
#' @param group_dataset `[shiny::reactive(data.frame) | shinymeta::metaReactive(data.frame)]`
#'
#' It expects the following format:
#'
#' - it contains, at least, the columns specified in the parameters: `subjid_var`
Expand All @@ -1939,8 +1939,6 @@ wfphm_hmpar_subset <- function(
#' named vector containing a set of transformation where the name is the string shown in the selector and the value is
#' function to be applied according to details section.
#'
#' @param tr_choices the names of the entries in tr_mapper
#'
#' @param bar_group_palette `[list(palettes)]`
#'
#' list of custom palettes to apply to bar_grouping. It receives the values used for grouping and must return a DaVinci
Expand Down Expand Up @@ -1980,8 +1978,12 @@ wfphm_hmpar_subset <- function(
#'
NULL

#' @describeIn wfphm UI
#' Waterfall plus heatmap UI function
#'
#' @param id Shiny ID `[character(1)]`
#' @param tr_choices the names of the entries in tr_mapper
#'
#' @keywords developers
#' @export

wfphm_UI <- function(id, tr_choices = names(tr_mapper_def())) { # nolint
Expand Down Expand Up @@ -2066,8 +2068,14 @@ wfphm_UI <- function(id, tr_choices = names(tr_mapper_def())) { # nolint
wfphm_mainpanel
}

#' @describeIn wfphm server
#' Waterfall plus heatmap server function
#' @keywords developers
#' @param bm_dataset `[shiny::reactive(data.frame) | shinymeta::metaReactive(data.frame)]`
#' @param group_dataset `[shiny::reactive(data.frame) | shinymeta::metaReactive(data.frame)]`
#'
#' @keywords developers
#' @inheritParams wfphm_UI
#' @inheritParams mod_wfphm
#' @export
wfphm_server <- function(id,
bm_dataset,
Expand Down Expand Up @@ -2244,7 +2252,6 @@ tr_mapper_def <- function() {

#' @describeIn wfphm dv.manager wrapper for the module
#'
#' @param module_id Shiny id
#' @param bm_dataset_name,group_dataset_name
#'
#' The name of the dataset
Expand Down
3 changes: 3 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ reference:
- title: Mock Applications
- contents:
- has_keyword("mock")
- title: For developers
- contents:
- has_keyword("developers")
- title: Additional Documentation
- subtitle: Lineplot
- contents:
Expand Down
Loading

0 comments on commit 3137a1e

Please sign in to comment.