Skip to content

Commit

Permalink
Merge branch 'main' into refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
donyunardi authored Sep 20, 2023
2 parents ef7e7f6 + 139971a commit 8d01b4e
Show file tree
Hide file tree
Showing 25 changed files with 216 additions and 286 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
LICENSE
^renv$
^renv\.lock$
CODE_OF_CONDUCT.md
Expand Down
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ The package maintainer also reserves the right to adjust the criteria to recogni
If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

<!-- urls -->
[docs]: https://insightsengineering.github.io/teal/index.html
[articles]: https://insightsengineering.github.io/teal/main/articles/index.html
[license]: https://insightsengineering.github.io/teal/main/LICENSE-text.html
[docs]: https://insightsengineering.github.io/teal/latest-tag/index.html
[articles]: https://insightsengineering.github.io/teal/latest-tag/articles/index.html
[license]: https://insightsengineering.github.io/teal/latest-tag/LICENSE-text.html
[insights]: https://github.com/insightsengineering/teal/pulse
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ body:
id: code-of-conduct
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal/CODE_OF_CONDUCT.html)
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal/latest-tag/CODE_OF_CONDUCT.html)
options:
- label: I agree to follow this project's Code of Conduct.
required: true
- type: checkboxes
id: contributor-guidelines
attributes:
label: Contribution Guidelines
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal/CONTRIBUTING.html)
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal/latest-tag/CONTRIBUTING.html)
options:
- label: I agree to follow this project's Contribution Guidelines.
required: true
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ body:
id: code-of-conduct
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal/CODE_OF_CONDUCT.html)
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal/latest-tag/CODE_OF_CONDUCT.html)
options:
- label: I agree to follow this project's Code of Conduct.
required: true
- type: checkboxes
id: contributor-guidelines
attributes:
label: Contribution Guidelines
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal/CONTRIBUTING.html)
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal/latest-tag/CONTRIBUTING.html)
options:
- label: I agree to follow this project's Contribution Guidelines.
required: true
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ body:
id: code-of-conduct
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal/CODE_OF_CONDUCT.html)
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal/latest-tag/CODE_OF_CONDUCT.html)
options:
- label: I agree to follow this project's Code of Conduct.
required: true
- type: checkboxes
id: contributor-guidelines
attributes:
label: Contribution Guidelines
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal/CONTRIBUTING.html)
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal/latest-tag/CONTRIBUTING.html)
options:
- label: I agree to follow this project's Contribution Guidelines.
required: true
Expand Down
17 changes: 10 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: teal
Title: Exploratory Web Apps for Analyzing Clinical Trials Data
Version: 0.14.0.9004
Date: 2023-08-24
Version: 0.14.0.9007
Date: 2023-09-13
Authors@R: c(
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre")),
person("Pawel", "Rucki", , "[email protected]", role = "aut"),
Expand All @@ -20,11 +20,14 @@ Authors@R: c(
person("F. Hoffmann-La Roche AG", role = c("cph", "fnd")),
person("Maximilian", "Mordig", role = "ctb")
)
Description: A shiny based interactive exploration framework for analyzing
clinical trials data. teal currently provides a dynamic filtering
facility and different data viewers. teal shiny applications are built
using standard shiny modules.
License: Apache License 2.0 | file LICENSE
Description: A 'shiny' based interactive exploration framework for
analyzing clinical trials data. 'teal' currently provides a dynamic
filtering facility and different data viewers. 'teal' 'shiny'
applications are built using standard 'shiny' modules.
License: Apache License 2.0
URL: https://insightsengineering.github.io/teal/,
https://github.com/insightsengineering/teal/
BugReports: https://github.com/insightsengineering/teal/issues
Depends:
R (>= 4.0),
shiny (>= 1.7.0),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

S3method(c,teal_slices)
S3method(get_code,tdata)
S3method(get_join_keys,default)
S3method(get_join_keys,tdata)
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# teal 0.14.0.9004
# teal 0.14.0.9007

### Miscellaneous

Expand Down
22 changes: 22 additions & 0 deletions R/teal_slices.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,28 @@ as.teal_slices <- function(x) { # nolint
}


#' @rdname teal_slices
#' @export
#' @keywords internal
#'
c.teal_slices <- function(...) {
x <- list(...)
checkmate::assert_true(all(vapply(x, is.teal_slices, logical(1L))), .var.name = "all arguments are teal_slices")

all_attributes <- lapply(x, attributes)
all_attributes <- coalesce_r(all_attributes)
all_attributes <- all_attributes[names(all_attributes) != "class"]

do.call(
teal_slices,
c(
unique(unlist(x, recursive = FALSE)),
all_attributes
)
)
}


#' Deep copy `teal_slices`
#'
#' it's important to create a new copy of `teal_slices` when
Expand Down
4 changes: 3 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@

# Use non-exported function(s) from teal.slice.
# This is a temporary measure and will be removed two release cycles from now (now meaning 0.13.0).
list_to_teal_slices <- getFromNamespace("list_to_teal_slices", "teal.slice") # nolint
list_to_teal_slices <- getFromNamespace("list_to_teal_slices", "teal.slice")
# This one is here because setdiff_teal_slice should not be exported from teal.slice.
setdiff_teal_slices <- getFromNamespace("setdiff_teal_slices", "teal.slice")
# This one is here because it is needed by c.teal_slices but we don't want it exported from teal.slice.
coalesce_r <- getFromNamespace("coalesce_r", "teal.slice")
# all *Block objects are private in teal.reporter
RcodeBlock <- getFromNamespace("RcodeBlock", "teal.reporter") # nolint
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- Related datasets, for example a set of `data.frames` with key columns to enable data joins
- `MultiAssayExperiment` objects which are R data structures for representing and analyzing multi-omics experiments
- `teal` modules:
- `teal modules` are shiny modules built within the `teal` framework that specify analysis to be performed. For example, it can be a module for exploring outliers in the data, or a module for visualizing the data in line plots. Although these can be created from scratch, lost of `teal` modules have been released and we recommend starting with modules found in the following packages:
- `teal modules` are shiny modules built within the `teal` framework that specify analysis to be performed. For example, it can be a module for exploring outliers in the data, or a module for visualizing the data in line plots. Although these can be created from scratch, many `teal` modules have been released and we recommend starting with modules found in the following packages:
- [`teal.modules.general`](https://insightsengineering.github.io/teal.modules.general/): general modules for exploring relational/independent/`CDISC` data
- [`teal.modules.clinical`](https://insightsengineering.github.io/teal.modules.clinical/): modules specific to `CDISC` data and clinical trial reporting
- [`teal.modules.hermes`](https://insightsengineering.github.io/teal.modules.hermes/): modules for analyzing `MultiAssayExperiment` objects
Expand Down Expand Up @@ -103,9 +103,9 @@ shinyApp(app$ui, app$server)

![App recording](man/figures/readme_app.gif)

Please see [`teal` gallery](https://insightsengineering.github.io/teal.gallery) and [TLG Catalog](https://insightsengineering.github.io/tlg-catalog) to see examples of `teal` apps.
Please see [`teal.gallery`](https://insightsengineering.github.io/teal.gallery) and [TLG Catalog](https://insightsengineering.github.io/tlg-catalog) to see examples of `teal` apps.

Please start with the ["Getting Started" article](https://insightsengineering.github.io/teal/articles/teal.html) and then other [package vignettes](https://insightsengineering.github.io/teal/articles/index.html) for more detailed guide.
Please start with the ["Getting Started" article](https://insightsengineering.github.io/teal/latest-tag/articles/teal.html) and then other [package vignettes](https://insightsengineering.github.io/teal/articles/index.html) for more detailed guide.

## Getting help

Expand Down
35 changes: 22 additions & 13 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,58 @@ navbar:
href: https://github.com/insightsengineering/teal

articles:
- title: Articles
- title: Get Started
navbar: ~
contents:
- teal
- title: Articles
navbar: Using teal
contents:
- filter-panel
- including-general-data-in-teal
- teal-options
- teal-bs-themes
- title: Articles
navbar: Data in teal Apps
contents:
- including-adam-data-in-teal
- including-general-data-in-teal
- including-mae-data-in-teal
- preprocessing-data
- title: Articles
navbar: Extending teal
contents:
- creating-custom-modules
- adding-support-for-reporting
- teal-options
- teal-bs-themes

reference:
- title: teal Core Functions
desc: These are the main functions needed to build a teal app.
- title: Core `teal` Functions
desc: Main functions needed to build a `teal` app
contents:
- init
- module
- modules
- srv_teal_with_splash
- ui_teal_with_splash
- teal_slices
- title: Example module
desc: A simple example teal module
- title: Example Module
desc: A simple `teal` module
contents:
- example_module
- title: Creating reports
- title: Creating Reports
contents:
- reporter_previewer_module
- TealReportCard
- title: Functions for module developers
- title: Functions for Module Developers
contents:
- tdata
- get_code_tdata
- get_join_keys
- get_metadata
- tdata2env
- show_rcode_modal
# - title: Functions moved to other packages
# desc: These functions have been moved from teal and will be deprecated.
# - title: Functions Moved to Other Packages
# desc: These functions have been moved from teal and will be deprecated
# contents:
- title: Validation functions
- title: Validation Functions
contents:
- starts_with("validate_")
6 changes: 4 additions & 2 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
ADaM
Forkers
Hoffmann
MultiAssayExperiment
TLG
Theming
UI
UIs
UX
cloneable
funder
omics
pharmaverse
preselected
preprocessed
programmatically
repo
reproducibility
tabsetted
themer
theming
uncheck
9 changes: 9 additions & 0 deletions man/teal-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/teal_slices.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions vignettes/adding-support-for-reporting.Rmd
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
title: "Adding support for Reporting to custom modules"
title: "Adding Support for Reporting to Custom Modules"
author: "NEST CoreDev"
date: "2022-05-23"
output:
rmarkdown::html_vignette:
toc: true
vignette: >
%\VignetteIndexEntry{Adding support for Reporting to custom modules}
%\VignetteIndexEntry{Adding Support for Reporting to Custom Modules}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand All @@ -15,7 +14,7 @@ vignette: >

The `teal` package offers an integrated reporting feature utilizing the `teal.reporter` package. For a comprehensive explanation of the reporting functionality itself, please refer to the documentation therein.

This article is intended for module developers and aims to provide guidance on enriching a custom `teal` module with an automatic reporting feature. This enhancement enables users to incorporate snapshots of the module outputs into a report which can then be reviewed in another module automatically provided by `teal`. Thus the app user can interact with the report.
This article is intended for module developers and aims to provide guidance on enhancing a custom `teal` module with an automatic reporting feature. This enhancement enables users to incorporate snapshots of the module outputs into a report which can then be reviewed in another module automatically provided by `teal`. Thus the app user can interact with the report.

The responsibilities of a module developer include:

Expand Down
24 changes: 7 additions & 17 deletions vignettes/creating-custom-modules.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: "Creating Custom Modules"
author: "Nikolas Burkoff"
date: "2022-03-24"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Creating Custom Modules}
Expand All @@ -11,8 +10,7 @@ vignette: >

## Introduction

The `teal` framework provides a large number of analysis modules to be incorporated into `teal` applications.
However, it is also possible to create your own modules using the `module()` function.
The `teal` framework provides a large number of analysis modules to be incorporated into `teal` applications. However, it is also possible to create your own modules using the `module` function.

Here is an implementation of a simple module:

Expand Down Expand Up @@ -46,11 +44,9 @@ which can be added into `teal` apps using `example_module(label = "Label for tab

### UI function

This function contains the UI required for the module. It should be a function with at least the arguments `id`.
It can also contain the argument `data` for access to the application data. See the server section below for more details.
This function contains the UI required for the module. It should be a function with at least the arguments `id`. It can also contain the argument `data` for access to the application data. See the server section below for more details.

The UI function can contain standard UI components alongside additional widgets provided by the `teal.widgets` package.
In the example above we are using the `standard_layout` function of `teal.widgets` which generates a layout
The UI function can contain standard UI components alongside additional widgets provided by the `teal.widgets` package. In the example above we are using the `standard_layout` function of `teal.widgets` which generates a layout
including an encoding panel on the left and main output covering the rest of the module's UI.

### Server function
Expand All @@ -70,18 +66,14 @@ function(id,
```

When used inside a teal application called with `teal::init`, the `data` argument is a named list of reactive data.frames
containing the data after having been filtered through the filter panel. It is of the `tdata` type and can be created using
the `new_tdata` function.
When used inside a `teal` application called with `init`, the `data` argument is a named list of reactive `data.frame`s containing the data after having been filtered through the filter panel. It is of the `tdata` type and can be created using the `new_tdata` function.

## A More Complicated Example

The `teal` framework also provides:

- A way to create modules which then generate the R code needed to reproduce their outputs;
these modules use the [`teal.code`](https://insightsengineering.github.io/teal.code/) package.
- A way extract from and merge related datasets using the
[`teal.transform`](https://insightsengineering.github.io/teal.transform/) package.
- A way to create modules which then generate the R code needed to reproduce their outputs; these modules use the [`teal.code`](https://insightsengineering.github.io/teal.code/) package.
- A way extract from and merge related datasets using the [`teal.transform`](https://insightsengineering.github.io/teal.transform/) package.
- A way to allow app creators to customize your modules also using `teal.transform`.

The annotated example below demonstrates these features within a simple histogram module, allowing app developers to choose the data and columns that their app users can select for display in a histogram.
Expand Down Expand Up @@ -207,9 +199,7 @@ if (interactive()) {

## `shiny` input cycle

When teal modules are run inside the `teal::init` the initial shiny input cycle is empty for each of them.
In practice, this means that some inputs might be initialized with `NULL` value, unnecessary triggering some
observers. A developer has to be aware of this situation as often It will require `shiny::req` or `ignoreInit` argument in observers or `reactive` expressions. This side effect is caused by the `shiny::insertUI` function. We are aware of this inconvenience and have already started to look for a solution.
When `teal` modules are run inside the `init` the initial shiny input cycle is empty for each of them. In practice, this means that some inputs might be initialized with `NULL` value, unnecessary triggering some observers. A developer has to be aware of this situation as often it will require `shiny::req` or `ignoreInit` argument in observers or `reactive` expressions. This side effect is caused by the `shiny::insertUI` function. We are aware of this inconvenience and have already started to look for a solution.

## Adding reporting to a module
Refer to `vignette("adding_support_for_reporting")` to read about adding support for reporting in your `teal` module.
Loading

0 comments on commit 8d01b4e

Please sign in to comment.