From d6d06d67f7d6546769f166100798971f08517cac Mon Sep 17 00:00:00 2001 From: gnoblet Date: Sun, 17 Jul 2022 19:20:30 -0400 Subject: [PATCH] Update pal arg name --- R/hbar.R | 26 +++++++++++++------------- docs/LICENSE.html | 1 + docs/index.html | 22 +++++++++++++++------- docs/news/index.html | 12 ++++++++---- docs/pkgdown.yml | 4 ++-- docs/reference/hbar.html | 4 ++-- docs/reference/hbar_percent.html | 4 ++-- docs/search.json | 2 +- docs/sitemap.xml | 6 +++--- man/hbar.Rd | 4 ++-- man/hbar_percent.Rd | 4 ++-- 11 files changed, 51 insertions(+), 38 deletions(-) diff --git a/R/hbar.R b/R/hbar.R index b6e63ac..bab767d 100644 --- a/R/hbar.R +++ b/R/hbar.R @@ -5,7 +5,7 @@ #' @param y Some column on the y scale #' @param group Some grouping categorical column, e.g. administrative areas #' @param initiative Either "reach" or "agora" or "impact" for the color palette -#' @param pal The color palette from the initiative +#' @param palette The color palette from the initiative #' @param width Width #' @param x_title The x scale title. Default to empty string #' @param y_title The y scale title. Default to empty string @@ -21,29 +21,29 @@ #' @return A horizontal bar chart #' #' @export -hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", theme = NULL, ...){ +hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", palette = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", theme = NULL, ...){ if (!(initiative %in% c("reach", "agora", "impact"))) rlang::abort(c("Wrong `initiative` arg", "*" = paste0("Arg `initiative` cannot be: ", initiative), "i" = "It must be one of 'reach' or 'agora' or 'impact'")) if (initiative == "reach") { - palette <- pal_reach(pal, reverse = reverse) + palette <- pal_reach(palette, reverse = reverse) main_col <- cols_reach("main_grey") if(is.null(palette)) rlang::warn( - c(paste0("There is no palette '", pal, "' for initiative 'reach'. Fallback to ggblanket's default color palette."), + c(paste0("There is no palette '", palette, "' for initiative 'reach'. Fallback to ggblanket's default color palette."), "i" = paste0("Use `pal_reach(show_palettes = T)` to see the list of availabale palettes.") ) ) } if (initiative == "agora") { - palette <- pal_agora(pal, reverse = reverse) + palette <- pal_agora(palette, reverse = reverse) main_col <- cols_agora("main_bordeaux") if(is.null(palette)) rlang::warn( - c(paste0("There is no palette '", pal, "' for initiative 'agora'. Fallback to ggblanket's default color palette."), + c(paste0("There is no palette '", palette, "' for initiative 'agora'. Fallback to ggblanket's default color palette."), "i" = paste0("Use `pal_agora(show_palettes = T)` to see the list of availabale palettes.") ) ) @@ -81,7 +81,7 @@ hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary" #' @param y Some column on the y scale #' @param group Some grouping categorical column, e.g. administrative areas #' @param initiative Either "reach" or "agora" or "impact" for the color palette -#' @param pal The color palette from the initiative +#' @param palette The color palette from the initiative #' @param width Width #' @param x_title The x scale title. Default to empty string #' @param y_title The y scale title. Default to empty string @@ -97,29 +97,29 @@ hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary" #' @return A horizontal bar chart #' #' @export -hbar_percent <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", theme = NULL, ...){ +hbar_percent <- function(.tbl, x, y, group = NULL, initiative = "reach", palette = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", theme = NULL, ...){ if (!(initiative %in% c("reach", "agora", "impact"))) rlang::abort(c("Wrong `initiative` arg", "*" = paste0("Arg `initiative` cannot be: ", initiative), "i" = "It must be one of 'reach' or 'agora' or 'impact'")) if (initiative == "reach") { - palette <- pal_reach(pal, reverse = reverse) + palette <- pal_reach(palette, reverse = reverse) main_col <- cols_reach("main_grey") if(is.null(palette)) rlang::warn( - c(paste0("There is no palette '", pal, "' for initiative 'reach'. Fallback to ggblanket's default color palette."), + c(paste0("There is no palette '", palette, "' for initiative 'reach'. Fallback to ggblanket's default color palette."), "i" = paste0("Use `pal_reach(show_palettes = T)` to see the list of availabale palettes.") ) ) } if (initiative == "agora") { - palette <- pal_agora(pal, reverse = reverse) + palette <- pal_agora(palette, reverse = reverse) main_col <- cols_agora("main_bordeaux") if(is.null(palette)) rlang::warn( - c(paste0("There is no palette '", pal, "' for initiative 'agora'. Fallback to ggblanket's default color palette."), + c(paste0("There is no palette '", palette, "' for initiative 'agora'. Fallback to ggblanket's default color palette."), "i" = paste0("Use `pal_agora(show_palettes = T)` to see the list of availabale palettes.") ) ) @@ -139,7 +139,7 @@ hbar_percent <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = " width = width, x_labels = scales::percent, position = position, - stat = "identity", + stat = "identity",pkg title = "", subtitle = "", theme = theme, diff --git a/docs/LICENSE.html b/docs/LICENSE.html index c656a48..29cbc03 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -45,6 +45,7 @@
+

Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

diff --git a/docs/index.html b/docs/index.html index 87980e7..d4dec1e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -72,7 +72,9 @@

visualizeR

-

What a color! What a viz!

+
+

What a color! What a viz!

+

visualizeR proposes some utils to get REACH and AGORA colors, ready-to-go color palettes, and a few visualization functions (horizontal hist graph for instance).

Installation @@ -88,17 +90,23 @@

Roadmap is as follows:

  • -Add IMPACT’s colors
  • + +Add IMPACT’s colors
  • -Add all color palettes from the internal documentation
  • + +Add all color palettes from the internal documentation
  • -Add new types of visualization (e.g. dumbbell plot)
  • + +Add new types of visualization (e.g. dumbbell plot)
  • -Use examples
  • + +Use examples
  • -Add some ease-map functions
  • + +Add some ease-map functions
  • -Add some interactive functions (maps and graphs)
  • + +Add some interactive functions (maps and graphs)

diff --git a/docs/news/index.html b/docs/news/index.html index b83a430..637efff 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -46,18 +46,22 @@

visualizeR 0.1.5.9000

-
  • Move from simplevis to successor ggblanket.

+
  • Move from simplevis to successor ggblanket.
  • +

visualizeR 0.1.4.9000

  • -hbar() gains a new boolean argument reverse to pass to pal_reach() or pal_agora(), indicating if the color palette should be reversed or not.

+hbar() gains a new boolean argument reverse to pass to pal_reach() or pal_agora(), indicating if the color palette should be reversed or not. +

visualizeR 0.1.3.9000

-
+

visualizeR 0.1.2.9000


+ +

visualizeR 0.1.1.9000