From 87d12690a87b21692efdaa4a87873248f77938c4 Mon Sep 17 00:00:00 2001 From: Dony Unardi Date: Fri, 31 Jan 2025 10:54:53 -0800 Subject: [PATCH 1/4] [skip vbump] upversion v0.6.0 --- DESCRIPTION | 2 +- NEWS.md | 4 ++-- vignettes/teal-slice.Rmd | 28 ++++++++++++++-------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 157db5889..5abd23fee 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: teal.slice Title: Filter Module for 'teal' Applications -Version: 0.5.1.9027 +Version: 0.6.0 Date: 2025-01-31 Authors@R: c( person("Dawid", "Kaledkowski", , "dawid.kaledkowski@roche.com", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index e0c3fe482..b0d6001ff 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# teal.slice 0.5.1.9027 +# teal.slice 0.6.0 ### Enhancements @@ -15,7 +15,7 @@ ### Miscellaneous -* `print.teal_slice()` and `print.teal_slices()` now return object invisibly. +* `print.teal_slice()` and `print.teal_slices()` now return object invisibly. # teal.slice 0.5.1 diff --git a/vignettes/teal-slice.Rmd b/vignettes/teal-slice.Rmd index b38b2e38d..e7f13d85d 100644 --- a/vignettes/teal-slice.Rmd +++ b/vignettes/teal-slice.Rmd @@ -1,7 +1,7 @@ --- title: "Introduction to teal.slice" author: "NEST CoreDev" -output: +output: rmarkdown::html_vignette: toc: true vignette: > @@ -12,8 +12,8 @@ vignette: > ## Introduction -The `teal.slice` package provides a *filter panel* for `shiny` applications. -`teal.slice` creates a filter panel module that allows for interactive filtering of data stored in `data.frame` and `MultiAssayExperiment` objects. +The `teal.slice` package provides a *filter panel* for `shiny` applications. +`teal.slice` creates a filter panel module that allows for interactive filtering of data stored in `data.frame` and `MultiAssayExperiment` objects. It also displays filtered and unfiltered observation counts. ## Information for users of the filter panel in applications @@ -21,15 +21,15 @@ It also displays filtered and unfiltered observation counts. The filter panel contains three panels: 1) The top panel displays the number of records (observations) that remain after the filters have been applied. -For relational data (where `join_keys` is specified), the number of unique subjects remaining in the filtered data set is also shown. +For relational data (where `join_keys` is specified), the number of unique subjects remaining in the filtered data set is also shown. 2) The middle panel displays the current active filters and allows the user to change their state. 3) The bottom panel allows to add new filters on columns of the data sets in the app. Note that multiple filters for the same data set are combined with the `AND` operator and it is not possible to apply hierarchical filters. -An example of the filter panel in use is shown in the image below. -The `iris` data set has the 50 `versicolor` records removed, leaving 100 observations. -The `mtcars` data set has filtered out all records other than those with `(gear = 3 or gear = 5) and (disp in [205, 295])`. +An example of the filter panel in use is shown in the image below. +The `iris` data set has the 50 `versicolor` records removed, leaving 100 observations. +The `mtcars` data set has filtered out all records other than those with `(gear = 3 or gear = 5) and (disp in [205, 295])`. ```{r echo=FALSE, out.width='60%'} knitr::include_graphics("./images/teal-slice/filter-panel.png") @@ -37,7 +37,7 @@ knitr::include_graphics("./images/teal-slice/filter-panel.png") Depending on the data type of the selected variable, different filters are shown, for example date pickers, range sliders, checkbox inputs. -For relational data (when `join_keys` are specified), filters specified on a parent data set (i.e. `ADSL`) will apply to all child data sets, whereas filters for a child data set can only be specified on columns not found in that data set's parent. +For relational data (when `join_keys` are specified), filters specified on a parent data set (i.e. `ADSL`) will apply to all child data sets, whereas filters for a child data set can only be specified on columns not found in that data set's parent. For general relational data the filter panel treats each data set independently, irrespective of relationships between data sets. The filter panel also supports filtering `MultiAssayExperiment` objects, where filters can be applied to the subject data, which is stored in the `colData` slot and accessed with `colData(MAE)`, as well as to experiments, which are stored in the `ExperimentList` slot and accessed with `MAE[["experiment name"]]`. @@ -47,21 +47,21 @@ The filter panel also supports filtering `MultiAssayExperiment` objects, where f The example app below shows how to embed the filter panel inside a `shiny` application. -The filter panel is entirely contained within a `FilteredData` object. -`FilteredData` is an `R6` class that stores data sets, tracks filter states, constructs and applies filter calls, and can output filtered data. +The filter panel is entirely contained within a `FilteredData` object. +`FilteredData` is an `R6` class that stores data sets, tracks filter states, constructs and applies filter calls, and can output filtered data. It also contains `shiny` modules (both UI and server functions) that make up the panel itself. In a `teal` application the `FilteredData` object (`datasets`) is created automatically by `teal`'s `init` function and filter panel components are automatically placed on the right-hand side of the page. -Note that this example uses `shiny::dataTableOutput` and `shiny::renderDataTable`. +Note that this example uses `shiny::dataTableOutput` and `shiny::renderDataTable`. This can lead to issues with Bootstrap, especially version 4. We recommend using `DT::dataTableOutput` and `DT::renderDataTable` if possible. See the `shiny` and `DT` documentation for more information. -To facilitate communication with `FilteredData`, we provide the filter panel API. -The example below uses the `set_filter_state` function to set state and the state is specified with `teal_slices` and `teal_slice` functions. +To facilitate communication with `FilteredData`, we provide the filter panel API. +The example below uses the `set_filter_state` function to set state and the state is specified with `teal_slices` and `teal_slice` functions. For details please see the *Filter panel for developers* vignette. -```{r warning=FALSE, message=FALSE} +```{r warning=FALSE, message=FALSE, eval=requireNamespace("DT", quietly = TRUE)} library(shiny) library(DT) library(teal.slice) From b8562546ff0d7aeafc8948ce708880420f7129d9 Mon Sep 17 00:00:00 2001 From: Dony Unardi Date: Fri, 31 Jan 2025 11:15:02 -0800 Subject: [PATCH 2/4] remove duplicate iris call --- R/FilteredData.R | 1 - man/FilteredData.Rd | 1 - 2 files changed, 2 deletions(-) diff --git a/R/FilteredData.R b/R/FilteredData.R index 5f7f00255..03dda9e42 100644 --- a/R/FilteredData.R +++ b/R/FilteredData.R @@ -50,7 +50,6 @@ #' datasets$set_filter_state( #' teal_slices(teal_slice(dataname = "iris", varname = "Species", selected = "virginica")) #' ) -#' isolate(datasets$get_call("iris")) #' #' datasets$set_filter_state( #' teal_slices(teal_slice(dataname = "mtcars", varname = "mpg", selected = c(15, 20))) diff --git a/man/FilteredData.Rd b/man/FilteredData.Rd index fd641cf81..83ab5dc29 100644 --- a/man/FilteredData.Rd +++ b/man/FilteredData.Rd @@ -53,7 +53,6 @@ datasets$datanames() datasets$set_filter_state( teal_slices(teal_slice(dataname = "iris", varname = "Species", selected = "virginica")) ) -isolate(datasets$get_call("iris")) datasets$set_filter_state( teal_slices(teal_slice(dataname = "mtcars", varname = "mpg", selected = c(15, 20))) From bdaa16046f68ecc0e155926689344bc7b1b3e8ff Mon Sep 17 00:00:00 2001 From: Marcin <133694481+m7pr@users.noreply.github.com> Date: Mon, 3 Feb 2025 09:21:23 +0100 Subject: [PATCH 3/4] Update teal.widgets version in the DESCRIPTION Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com> --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5abd23fee..79b479b8f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -52,7 +52,7 @@ Imports: shinyWidgets (>= 0.6.2), teal.data (>= 0.7.0), teal.logger (>= 0.3.1), - teal.widgets (>= 0.4.2), + teal.widgets (>= 0.4.3), utils Suggests: DT (>= 0.3.0), From e76b0977cafe378a0b8fdf7cba8914cd5ea4481a Mon Sep 17 00:00:00 2001 From: vedhav Date: Mon, 3 Feb 2025 20:39:57 +0530 Subject: [PATCH 4/4] chore: use base table instead of DT --- DESCRIPTION | 1 - vignettes/teal-slice.Rmd | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 79b479b8f..64552c5ab 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -55,7 +55,6 @@ Imports: teal.widgets (>= 0.4.3), utils Suggests: - DT (>= 0.3.0), knitr (>= 1.42), MultiAssayExperiment, rmarkdown (>= 2.23), diff --git a/vignettes/teal-slice.Rmd b/vignettes/teal-slice.Rmd index e7f13d85d..d9992cc9f 100644 --- a/vignettes/teal-slice.Rmd +++ b/vignettes/teal-slice.Rmd @@ -53,17 +53,12 @@ It also contains `shiny` modules (both UI and server functions) that make up the In a `teal` application the `FilteredData` object (`datasets`) is created automatically by `teal`'s `init` function and filter panel components are automatically placed on the right-hand side of the page. -Note that this example uses `shiny::dataTableOutput` and `shiny::renderDataTable`. -This can lead to issues with Bootstrap, especially version 4. -We recommend using `DT::dataTableOutput` and `DT::renderDataTable` if possible. See the `shiny` and `DT` documentation for more information. - To facilitate communication with `FilteredData`, we provide the filter panel API. The example below uses the `set_filter_state` function to set state and the state is specified with `teal_slices` and `teal_slice` functions. For details please see the *Filter panel for developers* vignette. -```{r warning=FALSE, message=FALSE, eval=requireNamespace("DT", quietly = TRUE)} +```{r warning=FALSE, message=FALSE} library(shiny) -library(DT) library(teal.slice) # create a FilteredData object