Skip to content

Commit

Permalink
[skip vbump] upversion v0.6.0 (#643)
Browse files Browse the repository at this point in the history
Fixes #633
  • Loading branch information
donyunardi authored Feb 4, 2025
1 parent 976851a commit 6b8b80c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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", , "[email protected]", role = c("aut", "cre"),
Expand Down Expand Up @@ -52,10 +52,9 @@ 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),
knitr (>= 1.42),
MultiAssayExperiment,
rmarkdown (>= 2.23),
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# teal.slice 0.5.1.9027
# teal.slice 0.6.0

### Enhancements

Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion R/FilteredData.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
1 change: 0 additions & 1 deletion man/FilteredData.Rd

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

29 changes: 12 additions & 17 deletions vignettes/teal-slice.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Introduction to teal.slice"
author: "NEST CoreDev"
output:
output:
rmarkdown::html_vignette:
toc: true
vignette: >
Expand All @@ -12,32 +12,32 @@ 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

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")
```

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"]]`.
Expand All @@ -47,23 +47,18 @@ 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`.
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}
library(shiny)
library(DT)
library(teal.slice)
# create a FilteredData object
Expand Down

0 comments on commit 6b8b80c

Please sign in to comment.