Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhodge931 committed Jul 4, 2024
1 parent bfc40df commit ad63055
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 13 deletions.
6 changes: 6 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ export(purple)
export(red)
export(set_blanket)
export(teal)
export(weave_col_palette_c)
export(weave_col_palette_d)
export(weave_col_palette_o)
export(weave_geom_defaults)
export(weave_mode)
export(weave_theme)
importFrom(magrittr,"%>%")
importFrom(rlang,"!!!")
importFrom(rlang,"!!")
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
* Breaking: removed `greyness` helper.
* Breaking: removed `*_orientation` arguments from `*_mode_*` functions.
* Breaking: In `set_blanket`, renamed `annotate_*` arguments to `annotation_*`.
* Added `*_symmetric` arguments.
* Added `mode_orientation` argument.
* Added `*_breaks_n` and `*_sec_axis` arguments.
* Added `*_symmetric` arguments.
* Added `weave_*` setup functions.
* Added `mode_orientation_to_x` and `mode_orientation_to_y` functions.
* In `set_blanket`, changed `theme` argument default to `theme_grey()`.

Expand Down
12 changes: 6 additions & 6 deletions R/weave.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ggblanket_global$theme <- NULL
#'
#' @param mode A ggplot2 theme (e.g. [light_mode_t()] or [dark_mode_r()]) that anticipates `gg_*` side-effects of removing relevant axis line/ticks and gridlines per the `mode_orientation`.
#'
#' @noRd
#' @export
weave_mode <- function(mode = light_mode_r()) {
old <- ggblanket_global$mode
ggblanket_global$mode <- mode
Expand All @@ -29,7 +29,7 @@ weave_mode <- function(mode = light_mode_r()) {
#'
#' @param theme A ggplot2 theme that the `gg_*` function will add without side-effects. Note, `mode` takes precedence, unless `mode = NULL`.
#'
#' @noRd
#' @export
weave_theme <- function(theme = light_mode_r() + mode_orientation_to_x()) {
old <- ggblanket_global$theme
ggblanket_global$theme <- theme
Expand All @@ -48,7 +48,7 @@ weave_theme <- function(theme = light_mode_r() + mode_orientation_to_x()) {
#' @param annotation_family A annotation_family for `*_text` and `*_label`. Defaults to ""
#' @param annotation_size A annotation_size for `*_text` and `*_label`. Defaults to 3.88.
#'
#' @noRd
#' @export
weave_geom_defaults <- function(colour = "#357BA2FF",
annotation_colour = "#121B24FF",
annotation_linewidth = 0.33,
Expand Down Expand Up @@ -101,7 +101,7 @@ weave_geom_defaults <- function(colour = "#357BA2FF",
#' @param col_palette_d For a discrete scale, a character vector of hex codes (or col_palette_d_names) for the `col_palette_d`.
#' @param col_palette_d_na For a discrete scale, a hex code (or col_palette_d_name) for the `col_palette_d_col_palette_d_na`.
#'
#' @noRd
#' @export
weave_col_palette_d <- function(col_palette_d = jumble, col_palette_d_na = "#CDC5BFFF") {

if (rlang::is_null(col_palette_d_na)) col_palette_d_na <- "grey50"
Expand Down Expand Up @@ -149,7 +149,7 @@ weave_col_palette_d <- function(col_palette_d = jumble, col_palette_d_na = "#CDC
#' @param col_palette_c For a continuous scale, a character vector of hex codes (or col_palette_c_names)
#' @param col_palette_c_na For a continuous scale, a hex code (or col_palette_c_name) for the `col_palette_col_palette_c_na`.
#'
#' @noRd
#' @export
weave_col_palette_c <- function(col_palette_c = viridisLite::mako(n = 9, direction = -1),
col_palette_c_na = "#988F88FF") { # i.e. colorspace::darken(grey, 0.25)

Expand Down Expand Up @@ -188,7 +188,7 @@ weave_col_palette_c <- function(col_palette_c = viridisLite::mako(n = 9, directi
#' @param col_palette_o For an ordicol_palette_o_nal scale, a `scales::pal_*()` function for the `col_palette_o`.
#' @param col_palette_o_na For an ordicol_palette_o_nal scale, a hex code (or col_palette_o_name) for the `col_palette_o_col_palette_o_na`.
#'
#' @noRd
#' @export
weave_col_palette_o <- function(col_palette_o = scales::pal_viridis(option = "G", direction = -1),
col_palette_o_na = "#988F88FF") {

Expand Down
16 changes: 10 additions & 6 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,17 @@ reference:
- dark_mode_r
- dark_mode_t
- dark_mode_b
- title: Colour
- title: Other
- contents:
- aes_contrast
- weave_mode
- weave_theme
- weave_geom_defaults
- weave_col_palette_d
- weave_col_palette_c
- weave_col_palette_o
- mode_orientation_to_x
- mode_orientation_to_y
- blue
- jumble
- teal
Expand All @@ -34,8 +43,3 @@ reference:
- lightness
- darkness
- linewidthness
- title: Other
- contents:
- aes_contrast
- mode_orientation_to_x
- mode_orientation_to_y
19 changes: 19 additions & 0 deletions man/weave_col_palette_c.Rd

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

16 changes: 16 additions & 0 deletions man/weave_col_palette_d.Rd

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

19 changes: 19 additions & 0 deletions man/weave_col_palette_o.Rd

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

28 changes: 28 additions & 0 deletions man/weave_geom_defaults.Rd

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

14 changes: 14 additions & 0 deletions man/weave_mode.Rd

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

14 changes: 14 additions & 0 deletions man/weave_theme.Rd

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

0 comments on commit ad63055

Please sign in to comment.