Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbengler committed Apr 3, 2024
1 parent 1b850f3 commit 515caeb
Show file tree
Hide file tree
Showing 44 changed files with 1,523 additions and 1,036 deletions.
251 changes: 145 additions & 106 deletions R/add.R

Large diffs are not rendered by default.

29 changes: 13 additions & 16 deletions R/adjust.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,15 @@ ff_adjust_axis <- function(axis) {
}
}
#' Adjust axes
#' @param plot bla
#' @param title bla
#' @param breaks bla
#' @param labels bla
#' @param limits bla
#' @param padding bla
#' @param rotate_labels bla
#' @param transformation bla
#' @param cut_short_scale bla
#' @param force_continuous bla
#' @param ... bla
#' @param padding bla
#' @inherit common_arguments
#' @inheritParams ggplot2::scale_x_continuous
#' @export
adjust_x_axis <- ff_adjust_axis("x")
#' @rdname adjust_x_axis
Expand All @@ -131,10 +129,10 @@ adjust_y_axis <- ff_adjust_axis("y")


#' Adjust plot size
#' @param plot bla
#' @param width bla
#' @param height bla
#' @param unit bla
#' @inherit common_arguments
#' @export
adjust_plot_size <- function(plot, width = 50, height = 50, unit = "mm") {
check_tidyplot(plot)
Expand All @@ -146,9 +144,7 @@ adjust_plot_size <- function(plot, width = 50, height = 50, unit = "mm") {


#' Adjust font
#' @param plot bla
#' @param fontsize bla
#' @param color bla
#' @inherit common_arguments
#' @inheritParams ggplot2::element_text
#' @export
adjust_font <- function(plot, fontsize = 7, family = NULL, face = NULL, color = "black") {
Expand All @@ -169,9 +165,10 @@ adjust_font <- function(plot, fontsize = 7, family = NULL, face = NULL, color =


#' Adjust legend
#' @param plot bla
#' @param title bla
#' @param position bla
#' @param position The position of legends. Can be one of `"none"`, `"left"`, `"right"`,
#' `"bottom"`, `"top"`, or a two-element numeric vector.
#' @inherit common_arguments
#' @export
adjust_legend <- function(plot, title = ggplot2::waiver(), position = "right") {
check_tidyplot(plot)
Expand All @@ -184,12 +181,12 @@ adjust_legend <- function(plot, title = ggplot2::waiver(), position = "right") {


#' Adjust padding
#' @param plot bla
#' @param top bla
#' @param right bla
#' @param bottom bla
#' @param left bla
#' @param force_continuous bla
#' @inherit common_arguments
#' @export
adjust_padding <- function(plot, top = NA, right = NA, bottom = NA, left = NA, force_continuous = FALSE) {
check_tidyplot(plot)
Expand All @@ -200,22 +197,22 @@ adjust_padding <- function(plot, top = NA, right = NA, bottom = NA, left = NA, f


#' Rotate plot by 90 degrees
#' @param plot bla
#' @param ... bla
#' @param ... Arguments passed on to the `ggplot2::coord_flip()`.
#' @inherit common_arguments
#' @export
adjust_rotate_plot <- function(plot, ...) {
check_tidyplot(plot)
plot + ggplot2::coord_flip(...)
}

#' Adjust description
#' @param plot bla
#' @param title bla
#' @param x_axis_title bla
#' @param y_axis_title bla
#' @param legend_title bla
#' @param caption bla
#' @param ... bla
#' @param ... Arguments passed on to the `ggplot2::labs()`.
#' @inherit common_arguments
#' @export
adjust_description <- function(plot, title = ggplot2::waiver(), x_axis_title = ggplot2::waiver(),
y_axis_title = ggplot2::waiver(), legend_title = ggplot2::waiver(),
Expand Down
16 changes: 16 additions & 0 deletions R/themes.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,19 @@ style_white_bg <- function(plot) {
axis.ticks = ggplot2::element_line(colour = "black", linewidth = 0.25)
)
}

style_black_bg <- function(plot) {
plot +
ggplot2::theme(
plot.margin = ggplot2::unit(c(0.5, 0.5, 0.5, 0.5), "mm"),
plot.background = ggplot2::element_rect(fill = "black", colour = "black"),
legend.background = ggplot2::element_rect(fill = "black", colour = "black"),
legend.key = ggplot2::element_rect(fill = "black", colour = "black"),
strip.background = ggplot2::element_rect(fill = "black", colour = "black"),
panel.background = ggplot2::element_rect(fill = "black", colour = "black"),
panel.border = ggplot2::element_rect(fill = NA, colour = "grey", linewidth = 0.5),
panel.grid.major = ggplot2::element_blank(),
panel.grid.minor = ggplot2::element_blank(),
axis.ticks = ggplot2::element_line(colour = "grey", linewidth = 0.25)
)
}
13 changes: 8 additions & 5 deletions man/add_areastack_absolute.Rd

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

12 changes: 8 additions & 4 deletions man/add_barstack_absolute.Rd

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

16 changes: 10 additions & 6 deletions man/add_boxplot.Rd

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

33 changes: 22 additions & 11 deletions man/add_count_bar.Rd

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

31 changes: 25 additions & 6 deletions man/add_curve.Rd

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

51 changes: 36 additions & 15 deletions man/add_data_points.Rd

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

Loading

0 comments on commit 515caeb

Please sign in to comment.