Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transparent backgrounds #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ggupset
Package: ggupsetJAK
Type: Package
Title: Combination Matrix Axis for 'ggplot2' to Create 'UpSet' Plots
Version: 0.3.0
Version: 0.3.4
URL: https://github.com/const-ae/ggupset
BugReports: https://github.com/const-ae/ggupset/issues
Authors@R: person("Constantin", "Ahlmann-Eltze", email = "artjom31415@googlemail.com",
Expand All @@ -15,7 +15,7 @@ Description: Replace the standard x-axis in 'ggplots' with a combination matrix
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.0.2
RoxygenNote: 7.1.1
Depends:
R (>= 2.10)
Suggests:
Expand Down
11 changes: 9 additions & 2 deletions R/axis_combmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,21 @@ make_combination_matrix_plot <- function(labels, labels_split, label_set, range,

plt <- ggplot(df2, aes(x= .data$at, y= .data$single_label))
if(isTRUE(theme$combmatrix.panel.striped_background)){
plt <- plt + geom_rect(aes(fill= .data$index %% 2 == 0), ymin=df2$index-0.5, ymax=df2$index+0.5, xmin=0, xmax=1)
plt <- plt +
geom_rect(aes(fill= .data$index %% 2 == 0), ymin=df2$index-0.5, ymax=df2$index+0.5, xmin=0, xmax=1)
}

plt <- plt +
geom_point(aes(color= .data$observed), size=theme$combmatrix.panel.point.size)

if (!isTRUE(theme$combmatrix.panel.line.size == 0)) {
# If combmatrix.panel.line.size is not a single number equal to 0, add the
# lines. (ifFALSE is available starting in v3.5)
plt <- plt + geom_line(
data=function(dat) dat[dat$observed, ,drop=FALSE],
aes(group = .data$labels),
size=theme$combmatrix.panel.line.size
size=theme$combmatrix.panel.line.size,
color=theme$combmatrix.panel.line.color
)
}
plt +
Expand All @@ -276,7 +279,11 @@ make_combination_matrix_plot <- function(labels, labels_split, label_set, range,
`FALSE` = theme$combmatrix.panel.point.color.empty)) +
guides(color="none", fill="none") +
theme(
rect = element_rect(fill = 'transparent', color = 'transparent'),
plot.background = element_rect(fill = 'transparent', color = 'transparent'),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.text.y = theme$combmatrix.label.text %||% theme$axis.text.y,
axis.text.x = element_blank(),
axis.ticks.y = element_blank(),
Expand Down
4 changes: 4 additions & 0 deletions R/theme_combmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#' in the combination matrix. Default: 3
#' @param combmatrix.panel.line.size Number to specify the size of the lines
#' connecting the points. Default: 1.2
#' @param combmatrix.panel.line.color Color of the lines connecting the points.
#' Default: "black"
#' @param combmatrix.panel.point.color.fill Color of the filled points.
#' Default: "black"
#' @param combmatrix.panel.point.color.empty Color of the empty points.
Expand Down Expand Up @@ -72,6 +74,7 @@ theme_combmatrix <- function(
combmatrix.panel.striped_background.color.two = "#F7F7F7",
combmatrix.panel.point.size = 3,
combmatrix.panel.line.size = 1.2,
combmatrix.panel.line.color = "black",
combmatrix.panel.point.color.fill = "black",
combmatrix.panel.point.color.empty = "#E0E0E0",
...
Expand All @@ -89,6 +92,7 @@ theme_combmatrix <- function(
combmatrix.panel.striped_background.color.two = combmatrix.panel.striped_background.color.two,
combmatrix.panel.point.size = combmatrix.panel.point.size,
combmatrix.panel.line.size = combmatrix.panel.line.size,
combmatrix.panel.line.color = combmatrix.panel.line.color,
combmatrix.panel.point.color.fill = combmatrix.panel.point.color.fill,
combmatrix.panel.point.color.empty = combmatrix.panel.point.color.empty,
...,
Expand Down
6 changes: 4 additions & 2 deletions man/df_complex_conditions.Rd

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

6 changes: 4 additions & 2 deletions man/gene_pathway_membership.Rd

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

4 changes: 4 additions & 0 deletions man/theme_combmatrix.Rd

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

6 changes: 4 additions & 2 deletions man/tidy_movies.Rd

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