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

v0.2.8 #30

Merged
merged 1 commit into from
Nov 2, 2023
Merged
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
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
Loading