Skip to content

Commit

Permalink
Merge pull request #162 from krassowski/more-examples
Browse files Browse the repository at this point in the history
Add new examples, ggplot2 3.4.0 compatibility, prepare release
  • Loading branch information
krassowski committed Nov 11, 2022
2 parents df78551 + 5d7b4e3 commit 21373e6
Show file tree
Hide file tree
Showing 107 changed files with 9,520 additions and 8,456 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ docs/
.virtual_documents/
cran_package/
data/
*.ipynb

# History files
.Rhistory
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ComplexUpset
Type: Package
Title: Create Complex UpSet Plots Using 'ggplot2' Components
Version: 1.3.3
Version: 1.3.4
Authors@R: person(
"Michał", "Krassowski", email = "krassowski.michal+r@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-9638-7785"))
Expand Down Expand Up @@ -29,5 +29,5 @@ Imports:
scales,
colorspace
VignetteBuilder: knitr
RoxygenNote: 7.1.2
RoxygenNote: 7.2.1
Roxygen: list(markdown = TRUE)
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Version 1.3.4

2022-11-11

Enhancements:
- Accept `tibble`s in `arrange_venn`, thanks @maximilian-heeg! #159

Maintenance:
- Pass `width=0.9` to workaround change of behaviour in ggplot2 3.4 overextending the width of bars highlighted with `upset_query`
- Fix deprecation warnings for ggplot 3.4 `size` to `linewidth` transition

# Version 1.3.3

2021-12-07
Expand Down
9 changes: 7 additions & 2 deletions R/upset.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ matrix_background_stripes = function(data, stripes, orient='horizontal') {
#' @param colors a vector of colors to repeat as many times as needed for the fill of stripes, or a named vector specifying colors for values of the variable mapped to the color aesthetics in the mapping argument
#' @param data the dataset describing the sets with a column named `set` and any other columns as needed for mapping
#' @export
upset_stripes = function(mapping=aes(), geom=geom_segment(size=7), colors=c('white', 'grey95'), data=NULL) {
upset_stripes = function(mapping=aes(), geom=geom_segment(linewidth=7), colors=c('white', 'grey95'), data=NULL) {
stripes = list(
mapping=mapping,
geom=geom,
Expand Down Expand Up @@ -265,6 +265,7 @@ upset_mode = function(mode) {
#' @param mapping additional aesthetics for `geom_bar()`
#' @param mode region selection mode, defines which intersection regions will be accounted for when computing the size. See `get_size_mode()` for accepted values.
#' @param position position passed to `geom_bar()`
#' @param width bar width, by default set to 90%
#' @inheritDotParams ggplot2::geom_bar
#' @export
intersection_size = function(
Expand All @@ -276,6 +277,7 @@ intersection_size = function(
text_mapping=aes(),
mode='distinct',
position=position_stack(),
width=0.9, # required to workaround an upstream bug in `resolution()` when `upset_query` is used.
...
) {
size = get_size_mode(mode)
Expand Down Expand Up @@ -334,6 +336,7 @@ intersection_size = function(
geom='bar',
position=position,
na.rm=TRUE,
width=width,
...
)
)
Expand Down Expand Up @@ -397,6 +400,7 @@ intersection_ratio = function(
text_mapping=aes(),
mode='distinct',
denominator_mode='union',
width=0.9, # required to workaround an upstream bug in `resolution()` when `upset_query` is used.
...
) {
size = get_size_mode(mode)
Expand Down Expand Up @@ -454,6 +458,7 @@ intersection_ratio = function(
# does not work, see
# https://github.com/tidyverse/ggplot2/issues/3532
na.rm=TRUE,
width=width,
...
))

Expand Down Expand Up @@ -868,7 +873,7 @@ scale_if_missing = function(annotation, axis, scale) {
list(scale)
}
}

#' Prepare layers for sets sizes plot
#'
#' @param geom a geom_point call, allowing to specify parameters (e.g. `geom=geom_point(shape='square')`)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Quick links: [Documentation](https://krassowski.github.io/complex-upset/) | [Ins

## Showcase

Get all the goodies of `UpSetR`, but with full extensibility of `ggplot2`.
Get all the goodies of `UpSetR`, but with full extensibility of `ggplot2`.

![Example UpSet plot](https://raw.githubusercontent.com/krassowski/complex-upset/master/movies.png)

Expand Down Expand Up @@ -109,13 +109,13 @@ The list is not meant to be exhaustive, but representative of applications to di

## Testing

The unit tests are run with testhat, and the visual "doppelganger" tests use vdiffr.
The unit tests are run with `testhat`, and the visual "doppelganger" tests use `vdiffr`.

The test cases for visual tests are auto-generated from the examples in the documentation; after changing or adding an example, please run:

- `scripts/prepare_for_tests.sh` to generate updated test cases, and
- `scripts/manage_visual_tests.sh` to validate the generated images.

## Acknowledgments
## Acknowledgements

Originally developed in course of a DPhil programme in Women's & Reproductive Health at [OxfordNuffieldWRH](https://github.com/OxfordNuffieldWRH).
10 changes: 7 additions & 3 deletions man/geom_venn_circle.Rd

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

9 changes: 4 additions & 5 deletions man/geom_venn_label_region.Rd

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

9 changes: 4 additions & 5 deletions man/geom_venn_label_set.Rd

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

10 changes: 7 additions & 3 deletions man/geom_venn_region.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/intersection_ratio.Rd

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

11 changes: 8 additions & 3 deletions man/intersection_size.Rd

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

2 changes: 1 addition & 1 deletion man/upset_stripes.Rd

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

0 comments on commit 21373e6

Please sign in to comment.