Skip to content

Commit

Permalink
Merge branch 'main' into enhancement/units-edition-results
Browse files Browse the repository at this point in the history
  • Loading branch information
Gero1999 authored Jan 13, 2025
2 parents 94426f9 + 66c7fea commit d165ea4
Show file tree
Hide file tree
Showing 36 changed files with 2,234 additions and 376 deletions.
64 changes: 64 additions & 0 deletions .github/contributing/adding-tlg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Adding new Tables, Listing and Graphs
In order to add new TLGs, two things are needed:
### TLG definition
Specified in [tlg.yaml](../../inst/shiny/tlg.yaml) file. Entry in that file is responsible for providing some metadata regarding the TLG (like name, descriptions, links), a function reference for creating the resulting TLG and options, taken as arguments by the generating function, that allow for quick and easy definition of widgets to be rendered in the application UI. This then allows the user to customize plots in accordance to their needs.

### `R` function
The code that creates the actual results.

## Listings
Currently not implemented.

## Tables
Currently not implemented

## Graphs
### yaml
The `Graph` entry should have the following format. Identifying keys (wrapped in `<>`) should be provided by the creator and be unique within their scope (indentation level).
```yaml
# unique identifier for given entry
<entry id>:
# true / false whether TLG should be included as default
is_default:
# type of the TLG, in this case must be Graph
type:
# name of the dataset
dataset:
# standarized id of the TLG, e.g. pkcg01
pkid:
# short label to be displayed as tab name
label:
# longer descriptions, to be displayed in the order table
description:
# link to the documentation of the TLG
link:
# name of the function exported by the package, responsible for generating TLG, must return a list of plots to be displayed
fun:
# options that can be passed as arguments to the function
options:
# option id, the same as the argument that is passed to the rendering function, must be unique in the scope of the TLG entry
<option id>:
# type of the option/widget, one of: text, numeric, select
type:
# label to be displayed in the editing widget
label:
# default value to be provided in the field;
# if provided, will overwrite function argument defaults;
# if left empty, function defaults will be applied;
# if type is 'select', '.all' keyword can be applied to select all choices;
default:
# applicable to 'select' type, whether to allow for multiple values to be selected
multiple:
# applicable to 'select' type, choices to pick from the dropdown, either specified outright or using a special keyword:
# - '.colnames' keyword will pull the choices from the data column names
# - '$COLUMN_NAME' keyword will pull choices from values of a specific column
choices:
# will create a label to help visually group related widgets; should be a character string; N should be replaced with an integer to uniquely identify the keyword
.group_label_N:

template:
# You can also specify template definitions. This is a character string with id of another TLG definition. All options will be copied over from template id. Any provided parameters will be a) overwritten if existing in the template or b) added as new.
```

### function
Function should be defined within `aNCA` package and accept at least a `data` argument for providing results to be plotted. Should return a list of plots (might be just one plot).
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ inst/guidelines
inst/templates
inst/shiny/data
!inst/shiny/data/DummyRO_ADNCA.csv
!inst/shiny/data/adnca_labels.csv
.Rprofile
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,9 @@ Each pull request must be accepted by at least one reviewer before it can be mer
When the change is done, pull request is open and the description is filled, please move your issue from **In Progress** to **Needs review** status, so it can be picked up by a reviewer. From this point it is up to the contributor and the person validating the change to work out any kinks and lead to merging the changes.

#### For reviewers
When reviewing a pull request, please do try to follow the [conventional comments](https://conventionalcomments.org/) guidelines. Ideas and labels described in that convention can be very helpful in getting your thoughts across and facilitate meaningful cooperation. That said, they are not applicable in every circumstance and you are free to do whatever you feel is suitable, as long as it aims to provide valid discussion.
When reviewing a pull request, please do try to follow the [conventional comments](https://conventionalcomments.org/) guidelines. Ideas and labels described in that convention can be very helpful in getting your thoughts across and facilitate meaningful cooperation. That said, they are not applicable in every circumstance and you are free to do whatever you feel is suitable, as long as it aims to provide valid discussion.

# In-depth guides
Here are some useful links with in-depth documentation regarding specific parts of the pacakage and how to utilise in-build tools to extend the capabilities of the application:

- [Adding TLGs](.github/contributing/adding-tlg.md)
8 changes: 8 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,38 @@ Imports:
dplyr,
DT,
forcats,
ggh4x,
ggplot2,
glue,
haven,
htmlwidgets,
logger,
magrittr,
nestcolor,
PKNCA,
plotly,
purrr,
reactable,
reactable.extras,
rio,
rmarkdown,
scales,
shiny,
shinyBS,
shinycssloaders,
shinyFiles,
shinyjqui,
shinyjs,
shinyWidgets,
stats,
stringi,
stringr,
tern,
tidyr,
tools,
utils,
units,
yaml,
zip
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Expand Down
20 changes: 20 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@

export(anonymize_pk_data)
export(apply_filters)
export(apply_labels)
export(as_factor_preserve_label)
export(calculate_summary_stats)
export(create_conc)
export(create_dose)
export(filter_breaks)
export(flexible_violinboxplot)
export(format_data)
export(g_pkconc_ind_lin)
export(g_pkconc_ind_log)
export(general_lineplot)
export(general_meanplot)
export(geometric_mean)
export(get_conversion_factor)
export(get_label)
export(has_label)
export(lambda_slope_plot)
export(parse_annotation)
export(parse_tlg_definitions)
export(pkcg01)
export(pptestcd_dict)
export(reshape_pknca_results)
export(run_app)
Expand All @@ -39,6 +46,7 @@ importFrom(PKNCA,PKNCAdata)
importFrom(PKNCA,PKNCAdose)
importFrom(PKNCA,pk.nca)
importFrom(PKNCA,pknca_units_table)
importFrom(checkmate,assert_numeric)
importFrom(dplyr,across)
importFrom(dplyr,arrange)
importFrom(dplyr,case_when)
Expand All @@ -47,14 +55,17 @@ importFrom(dplyr,filter)
importFrom(dplyr,group_by)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,n)
importFrom(dplyr,pull)
importFrom(dplyr,rename)
importFrom(dplyr,rename_with)
importFrom(dplyr,rowwise)
importFrom(dplyr,select)
importFrom(dplyr,slice)
importFrom(dplyr,summarise)
importFrom(dplyr,ungroup)
importFrom(dplyr,where)
importFrom(ggh4x,scale_y_facet)
importFrom(ggplot2,aes)
importFrom(ggplot2,facet_wrap)
importFrom(ggplot2,geom_errorbar)
Expand All @@ -64,6 +75,8 @@ importFrom(ggplot2,ggplot)
importFrom(ggplot2,ggplot_build)
importFrom(ggplot2,ggplot_gtable)
importFrom(ggplot2,labs)
importFrom(ggplot2,scale_x_continuous)
importFrom(glue,glue)
importFrom(grid,convertUnit)
importFrom(htmlwidgets,JS)
importFrom(logger,log_debug)
Expand All @@ -72,10 +85,12 @@ importFrom(logger,log_fatal)
importFrom(logger,log_info)
importFrom(logger,log_trace)
importFrom(logger,log_warn)
importFrom(magrittr,`%>%`)
importFrom(plotly,event_data)
importFrom(plotly,plotlyOutput)
importFrom(plotly,plotly_build)
importFrom(plotly,renderPlotly)
importFrom(purrr,imap)
importFrom(reactable,colDef)
importFrom(reactable,getReactableState)
importFrom(reactable,reactable)
Expand All @@ -86,20 +101,25 @@ importFrom(reactable.extras,dropdown_extra)
importFrom(reactable.extras,text_extra)
importFrom(rio,export_list)
importFrom(rmarkdown,render)
importFrom(scales,breaks_log)
importFrom(scales,label_log)
importFrom(shinyBS,bsModal)
importFrom(shinyFiles,shinyDirChoose)
importFrom(shinyWidgets,dropdown)
importFrom(shinyWidgets,pickerInput)
importFrom(shinyWidgets,switchInput)
importFrom(shinyWidgets,updatePickerInput)
importFrom(shinycssloaders,withSpinner)
importFrom(shinyjqui,orderInput)
importFrom(shinyjqui,updateOrderInput)
importFrom(stats,sd)
importFrom(stringi,stri_rand_strings)
importFrom(tern,g_ipp)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,pivot_wider)
importFrom(tools,file_ext)
importFrom(units,set_units)
importFrom(utils,read.csv)
importFrom(utils,write.csv)
importFrom(yaml,read_yaml)
importFrom(zip,zipr)
Loading

0 comments on commit d165ea4

Please sign in to comment.