Skip to content

Commit

Permalink
Merge pull request #30 from snlab-ch/develop
Browse files Browse the repository at this point in the history
v0.2.8
  • Loading branch information
jhollway authored Nov 2, 2023
2 parents 570c19a + ef0b499 commit a47c624
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 67 deletions.
22 changes: 9 additions & 13 deletions R/map_theme.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ palette_gen <- function(palette = "IHEID", direction = 1) {
}
}

#' IHEID color scales
#' @name scales
#' @rdname themes
#' @param palette Name of the palette. Current choices are:
#' \code{IHEID}, \code{Centres}, and \code{SDGs}.
#' @param direction Direction for using palette colors.
Expand All @@ -123,62 +122,59 @@ palette_gen <- function(palette = "IHEID", direction = 1) {
#' #mutate(core = migraph::node_is_core(ison_brandes)) %>%
#' #autographr(node_color = "core") +
#' #scale_color_iheid()
NULL

#' @rdname scales
#' @export
scale_fill_iheid <- function(palette = "IHEID", direction = 1, ...) {
ggplot2::discrete_scale("fill", "IHEID",
palette_gen(palette, direction), ...)
}

#' @rdname scales
#' @rdname themes
#' @export
scale_colour_iheid <- function(palette = "IHEID", direction = 1, ...) {
ggplot2::discrete_scale("colour", "IHEID",
palette_gen(palette, direction), ...)
}

#' @rdname scales
#' @rdname themes
#' @export
scale_color_iheid <- scale_colour_iheid

#' Centres color scales
#'
#' @rdname scales
#' @rdname themes
#' @export
scale_fill_centres <- function(palette = "Centres", direction = 1, ...) {
ggplot2::discrete_scale("fill", "Centres",
palette_gen(palette, direction), ...)
}

#' @rdname scales
#' @rdname themes
#' @export
scale_colour_centres <- function(palette = "Centres", direction = 1, ...) {
ggplot2::discrete_scale("colour", "Centres",
palette_gen(palette, direction), ...)
}

#' @rdname scales
#' @rdname themes
#' @export
scale_color_centres <- scale_colour_centres

#' SDGs color scales
#'
#' @rdname scales
#' @rdname themes
#' @export
scale_fill_sdgs <- function(palette = "SDGs", direction = 1, ...) {
ggplot2::discrete_scale("fill", "SDGs",
palette_gen(palette, direction), ...)
}

#' @rdname scales
#' @rdname themes
#' @export
scale_colour_sdgs <- function(palette = "SDGs", direction = 1, ...) {
ggplot2::discrete_scale("colour", "SDGs",
palette_gen(palette, direction), ...)
}

#' @rdname scales
#' @rdname themes
#' @export
scale_color_sdgs <- scale_colour_sdgs
54 changes: 0 additions & 54 deletions man/scales.Rd

This file was deleted.

38 changes: 38 additions & 0 deletions man/themes.Rd

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

1 change: 1 addition & 0 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ reference:
- starts_with("autograph")
- starts_with("layout")
- starts_with("theme")
- ends_with("palette")
- title: "Data"
desc: |
The package contains a variety of networks useful for pedagogical purposes
Expand Down

0 comments on commit a47c624

Please sign in to comment.