Skip to content

Commit

Permalink
update readmes and description (#464)
Browse files Browse the repository at this point in the history
Related to
insightsengineering/coredev-tasks#462

---------

Signed-off-by: Marcin <[email protected]>
Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Dony Unardi
  • Loading branch information
m7pr and dependabot-preview[bot] authored Sep 19, 2023
1 parent d968458 commit 3dfcb18
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 88 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
LICENSE
^assets$
^renv$
^renv\.lock$
CODE_OF_CONDUCT.md
Expand Down
12 changes: 6 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ This repository follows the standard [`tidyverse` style guide](https://style.tid

### Dependency management

Lightweight is the right weight. This repository follows [tinyverse](https://www.tinyverse.org/) recommedations of limiting dependencies to minimum.
Lightweight is the right weight. This repository follows [tinyverse](https://www.tinyverse.org/) recommendations of limiting dependencies to minimum.

### Dependency version management

If the code is not compatible with all (!) historical versions of a given dependenct package, it is required to specify minimal version in the `DESCRIPTION` file. In particular: if the development version requires (imports) the development version of another package - it is required to put `abc (>= 1.2.3.9000)`.
If the code is not compatible with all (!) historical versions of a given dependency package, it is required to specify minimal version in the `DESCRIPTION` file. In particular: if the development version requires (imports) the development version of another package - it is required to put `abc (>= 1.2.3.9000)`.

### Recommended development environment & tools

#### R & package versions

We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the `R CMD check` GitHub Action execution log - there is a step that prints out the R `sessionInfo()`.
We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and `BioConductor`. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the `R CMD check` GitHub Action execution log - there is a step that prints out the R `sessionInfo()`.

If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

Expand All @@ -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.slice/index.html
[articles]: https://insightsengineering.github.io/teal.slice/main/articles/index.html
[license]: https://insightsengineering.github.io/teal.slice/main/LICENSE-text.html
[docs]: https://insightsengineering.github.io/teal.slice/latest-tag/index.html
[articles]: https://insightsengineering.github.io/teal.slice/latest-tag/articles/index.html
[license]: https://insightsengineering.github.io/teal.slice/latest-tag/LICENSE-text.html
[insights]: https://github.com/insightsengineering/teal.slice/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.slice/CODE_OF_CONDUCT.html)
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal.slice/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.slice/CONTRIBUTING.html)
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal.slice/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.slice/CODE_OF_CONDUCT.html)
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal.slice/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.slice/CONTRIBUTING.html)
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal.slice/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.slice/CODE_OF_CONDUCT.html)
description: By submitting this issue, you agree to follow our [Code of Conduct.](https://insightsengineering.github.io/teal.slice/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.slice/CONTRIBUTING.html)
description: By submitting this issue, you agree to follow our [Contribution Guidelines.](https://insightsengineering.github.io/teal.slice/latest-tag/CONTRIBUTING.html)
options:
- label: I agree to follow this project's Contribution Guidelines.
required: true
Expand Down
11 changes: 8 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Type: Package
Package: teal.slice
Title: Filter Module for `teal` Applications
Title: Filter Module for 'teal' Applications
Version: 0.4.0.9012
Date: 2023-09-08
Authors@R: c(
Expand All @@ -19,8 +19,13 @@ Authors@R: c(
person("Junlue", "Zhao", role = "aut"),
person("F. Hoffmann-La Roche AG", role = c("cph", "fnd"))
)
Description: Filter module for teal applications.
License: Apache License 2.0 | file LICENSE
Description:
Module containing filter panel for 'teal' applications. Allows for interactive filtering of data stored in
'data.frame' and 'MultiAssayExperiment' objects. Also displays filtered and unfiltered observation counts.
License: Apache License 2.0
URL: https://insightsengineering.github.io/teal.slice/,
https://github.com/insightsengineering/teal.slice/
BugReports: https://github.com/insightsengineering/teal.slice/issues
Depends:
R (>= 4.0),
shiny
Expand Down
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,33 @@

## Installation

From July 2023 `insightsengineering` packages are available on [r-universe](https://r-universe.dev/).

```r
# stable versions
install.packages('teal.slice', repos = c('https://insightsengineering.r-universe.dev', 'https://cloud.r-project.org'))
install.packages('teal.slice', repos = c('https://insightsengineering.r-universe.dev', getOption('repos')))

# install.packages("pak")
pak::pak("insightsengineering/teal.slice@*release")
```

Alternatively, you might want to use the development version available on [r-universe](https://r-universe.dev/).

```r
# beta versions
install.packages('teal.slice', repos = c('https://pharmaverse.r-universe.dev', 'https://cloud.r-project.org'))
install.packages('teal.slice', repos = c('https://pharmaverse.r-universe.dev', getOption('repos')))

# install.packages("pak")
pak::pak("insightsengineering/teal.slice")
```

See package vignettes `browseVignettes(package = "teal.slice")` for usage of this package.
## Usage

To understand how to use this package, please refer to the [Introduction to teal.slice](https://insightsengineering.github.io/teal.slice/latest-tag/articles/teal-slice.html) article, which provides multiple examples of code implementation.

![Showcase](https://github.com/insightsengineering/teal.slice/blob/main/assets/img/showcase.gif)

## Getting help

If you encounter a bug or you have a feature request - please file an issue. For questions, discussions and staying up to date, please use the "teal" channel in the [`pharmaverse` slack workspace](https://pharmaverse.slack.com).

## Stargazers and Forkers

Expand Down
Binary file added assets/img/showcase.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 14 additions & 3 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
Forkers
Hoffmann
UI
cloneable
Forkers
funder
github
Hoffmann
https
insightsengineering
io
Pre
programmatically
repo
reproducibility
sessionInfo
subclasses
subtype
textarea
tinyverse
UI
upvote
sessionInfo
MultiAssayExperiment
9 changes: 9 additions & 0 deletions man/teal.slice-package.Rd

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

33 changes: 16 additions & 17 deletions vignettes/filter-panel-for-developers.Rmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
title: "Filter panel for developers"
author: "NEST Core Dev Team"
date: "10/07/2023"
title: "Filter Panel for Developers"
author: "NEST CoreDev"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Filter panel for developers}
%\VignetteIndexEntry{Filter Panel for Developers}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand All @@ -21,13 +20,13 @@ These methods include:
- `remove_filter_state` - removes particular filter states based on `teal_slices` object
- `clear_filter_states` - removes all filter states

Setting and getting filter states are done through `teal_slices` object which is a collection of `teal_slice` objects.
Setting and getting filter states are done through `teal_slices` object which is a collection of `teal_slice` objects.
Think of a `teal_slice` as a quantum of information that fully describes the filter state of one variable.

In order to tell `FilteredData` to set a filter for a specific variable,
one must call the `set_filter_state` method with a `teal_slices` object containing a `teal_slice`
In order to tell `FilteredData` to set a filter for a specific variable,
one must call the `set_filter_state` method with a `teal_slices` object containing a `teal_slice`
that refers to the variable of interest.
To remove a particular `FilterState` object, one must call the `remove_filter_state` method
To remove a particular `FilterState` object, one must call the `remove_filter_state` method
using a `teal_slices` containing a `teal_slice` that refers to the respective variable.

Each `teal_slice` object contains all the information necessary to:
Expand All @@ -37,7 +36,7 @@ Each `teal_slice` object contains all the information necessary to:
- `dataname` - name of the data set
- `varname` - name of the column
- `experiment` (only for `MultiAssayExperiment` objects) - name of the experiment
- `arg` (only for `SummarizedExperiment` objects, e.g within a `MultiAssayExperiment`) -
- `arg` (only for `SummarizedExperiment` objects, e.g within a `MultiAssayExperiment`) -
name of the argument in the call to `subset` (`subset` of `select`)

2. Express or store the current selection state:
Expand All @@ -50,16 +49,16 @@ Each `teal_slice` object contains all the information necessary to:
3. Control the behavior and appearance of the `FilterState` object:

- `choices` - determines the set of values or the range that can be selected from
- `multiple` (only for `ChoiceFilterState`) - allows multiple values to be selected
- `multiple` (only for `ChoiceFilterState`) - allows multiple values to be selected
- `fixed` - forbids changing state of the `FilterState`
- `anchored` - forbids removal of the `FilterState`
- `title` - displayed title of the filter card

In addition, every `teal_slice` object has an `id`.
In addition, every `teal_slice` object has an `id`.

It is impossible to create `FilteredData` with slices with duplicated `id`s.
This is because filter states are both created and modified with the `set_filter_state` method
so if two consecutive calls to `set_filter_state` are passed a `teal_slice` with the same id,
so if two consecutive calls to `set_filter_state` are passed a `teal_slice` with the same id,
the first call will instantiate a `FilterState`, and the second call will modify it.

Creating `teal_slices` with slices with duplicated `id`s is forbidden and will raise an error.
Expand Down Expand Up @@ -120,12 +119,12 @@ clear_filter_states(datasets)

### Controlling settings of the filter panel

In addition to controlling individual filter states through `set_filter_state`,
one can also manage some general behaviors of the whole filter panel.
In addition to controlling individual filter states through `set_filter_state`,
one can also manage some general behaviors of the whole filter panel.
This can be done with arguments of the `teal_slices` function:

1. `include_varnames` defines which columns in the used data sets are allowed to be filtered on.
In the following example only two columns of `iris` and two columns of `mtcars` will be able to have filters set.
1. `include_varnames` defines which columns in the used data sets are allowed to be filtered on.
In the following example only two columns of `iris` and two columns of `mtcars` will be able to have filters set.
```{r}
set_filter_state(
datasets,
Expand Down Expand Up @@ -159,7 +158,7 @@ set_filter_state(
| Distribution in unfiltered data | Filtered vs. unfiltered distribution |
| ![](./images/filter_panel/count_type_none.jpeg){width=300} | ![](./images/filter_panel/count_type_all.jpeg){width=300} |

4. `allow_add` determines whether the "Add Filter Variables" module will be displayed
4. `allow_add` determines whether the "Add Filter Variables" module will be displayed
to allow the user to add new filters.


Expand Down
Loading

0 comments on commit 3dfcb18

Please sign in to comment.