diff --git a/DESCRIPTION b/DESCRIPTION index 5cc9baa..c331ff0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -41,13 +41,12 @@ Suggests: Depends: R (>= 4.0.0) Imports: - ggplot2 (>= 3.4.0), + ggplot2 (>= 3.5.2), grDevices, grid, scales, - extrafont, tools, magrittr, - gdtools, utils RoxygenNote: 7.3.2 +Roxygen: list(markdown = TRUE) diff --git a/NAMESPACE b/NAMESPACE index 5522bef..fd555ce 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -82,12 +82,10 @@ export(theme_ipsum_pub) export(theme_ipsum_rc) export(theme_modern_rc) export(update_geom_font_defaults) -import(extrafont) import(ggplot2) import(grDevices) import(grid) import(scales) -importFrom(gdtools,set_dummy_conf) importFrom(ggplot2,scale_color_gradientn) importFrom(ggplot2,scale_color_manual) importFrom(ggplot2,scale_fill_gradientn) diff --git a/R/bit12.R b/R/bit12.R index e6ca432..e29c247 100644 --- a/R/bit12.R +++ b/R/bit12.R @@ -6,7 +6,7 @@ #' distinct colors that work well for categorical data while maintaining good contrast #' and accessibility. #' -#' @name bit12 +#' @name bit12_scale #' @details #' The package provides several types of scales: #' * Discrete scales for categorical data @@ -26,9 +26,10 @@ #' * Cobalt: Deep blue for stability and reliability #' * Violet: Purple for creative and distinctive elements #' -#' @param ... Additional arguments passed to scale_color_manual() or scale_fill_manual() +#' @param ... Additional arguments passed to scale_color_manual(), scale_fill_manual(), scale_color_gradientn(), or scale_fill_gradientn() #' @param palette For continuous scales, the name of the color palette to use #' (one of "plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet") +#' @param direction Sets the direction of the color scale (1 = default, -1 = reversed) #' #' @return A ggplot2 scale object #' @@ -69,30 +70,14 @@ bit12 <- c( violet = "#639" ) -#' Discrete Color Scale Using Bit12 Colors -#' -#' @param ... Additional arguments passed to scale_color_manual() -#' @return A discrete ggplot2 color scale +#' @name bit12_scale #' @export -#' @examples -#' library(ggplot2) -#' ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + -#' geom_point() + -#' scale_color_bit12() scale_color_bit12 <- function(...) { scale_color_manual(values = unname(bit12), ...) } -#' Discrete Fill Scale Using Bit12 Colors -#' -#' @param ... Additional arguments passed to scale_fill_manual() -#' @return A discrete ggplot2 fill scale +#' @name bit12_scale #' @export -#' @examples -#' library(ggplot2) -#' ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + -#' geom_bar() + -#' scale_fill_bit12() scale_fill_bit12 <- function(...) { scale_fill_manual(values = unname(bit12), ...) } @@ -153,17 +138,8 @@ create_continuous_scale <- function(colors) { colorRampPalette(colors) } -#' Continuous Color Scale Using Bit12 Colors -#' -#' @param palette Name of the color palette to use ("plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet") -#' @param ... Additional arguments passed to scale_color_gradientn() -#' @return A continuous ggplot2 color scale +#' @name bit12_scale #' @export -#' @examples -#' library(ggplot2) -#' ggplot(faithfuld, aes(waiting, eruptions, color = density)) + -#' geom_point() + -#' scale_color_bit12_continuous(palette = "azure") scale_color_bit12_continuous <- function(palette = "azure", ...) { scale_color_gradientn( colors = create_continuous_scale(bit12_extended[[palette]])(100), @@ -171,17 +147,8 @@ scale_color_bit12_continuous <- function(palette = "azure", ...) { ) } -#' Continuous Fill Scale Using Bit12 Colors -#' -#' @param palette Name of the color palette to use ("plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet") -#' @param ... Additional arguments passed to scale_fill_gradientn() -#' @return A continuous ggplot2 fill scale +#' @name bit12_scale #' @export -#' @examples -#' library(ggplot2) -#' ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + -#' geom_tile() + -#' scale_fill_bit12_continuous(palette = "azure") scale_fill_bit12_continuous <- function(palette = "azure", ...) { scale_fill_gradientn( colors = create_continuous_scale( @@ -191,20 +158,8 @@ scale_fill_bit12_continuous <- function(palette = "azure", ...) { ) } -#' Distiller Color Scale Using Bit12 Colors -#' -#' Creates a sequential color gradient based on a selected Bit12 color -#' -#' @param palette Name of the color palette to use ("plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet") -#' @param direction Sets the direction of the color scale (1 = default, -1 = reversed) -#' @param ... Additional arguments passed to scale_color_gradientn() -#' @return A sequential ggplot2 color scale +#' @name bit12_scale #' @export -#' @examples -#' library(ggplot2) -#' ggplot(faithfuld, aes(waiting, eruptions, color = density)) + -#' geom_point() + -#' scale_color_bit12_distiller(palette = "azure") scale_color_bit12_distiller <- function(palette = "azure", direction = 1, ...) { # Select colors from the palette for a light-to-dark gradient if (direction == 1) { @@ -219,20 +174,8 @@ scale_color_bit12_distiller <- function(palette = "azure", direction = 1, ...) { ) } -#' Distiller Fill Scale Using Bit12 Colors -#' -#' Creates a sequential fill gradient based on a selected Bit12 color -#' -#' @param palette Name of the color palette to use ("plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet") -#' @param direction Sets the direction of the color scale (1 = default, -1 = reversed) -#' @param ... Additional arguments passed to scale_fill_gradientn() -#' @return A sequential ggplot2 fill scale +#' @name bit12_scale #' @export -#' @examples -#' library(ggplot2) -#' ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + -#' geom_tile() + -#' scale_fill_bit12_distiller(palette = "azure") scale_fill_bit12_distiller <- function(palette = "azure", direction = 1, ...) { # Select colors from the palette for a light-to-dark gradient if (direction == 1) { @@ -247,19 +190,8 @@ scale_fill_bit12_distiller <- function(palette = "azure", direction = 1, ...) { ) } -#' Distiller Color Scale Across All Bit12 Colors -#' -#' Creates a sequential color gradient using all colors from the Bit12 palette -#' -#' @param direction Sets the direction of the color scale (1 = default, -1 = reversed) -#' @param ... Additional arguments passed to scale_color_gradientn() -#' @return A sequential ggplot2 color scale +#' @name bit12_scale #' @export -#' @examples -#' library(ggplot2) -#' ggplot(faithfuld, aes(waiting, eruptions, color = density)) + -#' geom_point() + -#' scale_color_bit12_spectrum() scale_color_bit12_spectrum <- function(direction = 1, ...) { # Use all colors from the palette colors <- unname(bit12) @@ -274,19 +206,8 @@ scale_color_bit12_spectrum <- function(direction = 1, ...) { ) } -#' Distiller Fill Scale Across All Bit12 Colors -#' -#' Creates a sequential fill gradient using all colors from the Bit12 palette -#' -#' @param direction Sets the direction of the color scale (1 = default, -1 = reversed) -#' @param ... Additional arguments passed to scale_fill_gradientn() -#' @return A sequential ggplot2 fill scale +#' @name bit12_scale #' @export -#' @examples -#' library(ggplot2) -#' ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + -#' geom_tile() + -#' scale_fill_bit12_spectrum() scale_fill_bit12_spectrum <- function(direction = 1, ...) { # Use all colors from the palette colors <- unname(bit12) @@ -299,4 +220,4 @@ scale_fill_bit12_spectrum <- function(direction = 1, ...) { colors = colors, ... ) -} \ No newline at end of file +} diff --git a/R/check.r b/R/check.r index d47355c..716d60b 100644 --- a/R/check.r +++ b/R/check.r @@ -38,10 +38,10 @@ gg_check <- function(gg, dict, ignore) { if (missing(dict)) dict <- hunspell::dictionary("en_US") if (missing(ignore)) ignore <- hunspell::en_stats - if (inherits(gg, "labels")) { + if (inherits(gg, "labels") || inherits(gg, "ggplot2::labels")) { lbl <- gg - } else if ("labels" %in% names(gg)) { - lbl <- gg$labels + } else if (is_ggplot(gg)) { + lbl <- get_labs(gg) } else { return(gg) } diff --git a/R/econ-sans.R b/R/econ-sans.R index 0ae0cdf..4268f71 100644 --- a/R/econ-sans.R +++ b/R/econ-sans.R @@ -1,4 +1,4 @@ -#' A precise & pristine [ggplot2] theme with opinionated defaults and an emphasis on typoghraphy +#' A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy #' #' You should [import_econ_sans()] first and install the fonts on your #' system before trying to use this theme. diff --git a/R/goldmansans.R b/R/goldmansans.R index 141a4c4..f14aa92 100644 --- a/R/goldmansans.R +++ b/R/goldmansans.R @@ -1,4 +1,4 @@ -#' A precise & pristine [ggplot2] theme with opinionated defaults and an emphasis on typoghraphy +#' A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy #' #' You should [import_goldman_sans()] first and install the fonts on your #' system before trying to use this theme. diff --git a/R/hrbrthemes-package.R b/R/hrbrthemes-package.R index 6d80d85..7c0aa5a 100644 --- a/R/hrbrthemes-package.R +++ b/R/hrbrthemes-package.R @@ -21,9 +21,8 @@ #' @docType package #' @author Bob Rudis (bob@@rud.is) #' @keywords internal -#' @import ggplot2 grid scales extrafont grDevices +#' @import ggplot2 grid scales grDevices #' @importFrom magrittr %>% -#' @importFrom gdtools set_dummy_conf #' @importFrom tools file_path_sans_ext #' @importFrom utils packageVersion compareVersion "_PACKAGE" diff --git a/R/inter.R b/R/inter.R index bb21660..adf8a6f 100644 --- a/R/inter.R +++ b/R/inter.R @@ -1,4 +1,4 @@ -#' A precise & pristine [ggplot2] theme with opinionated defaults and an emphasis on typoghraphy +#' A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy #' #' You should [import_inter()] first and install the fonts on your #' system before trying to use this theme. diff --git a/R/plexsans.R b/R/plexsans.R index eddc221..983bf82 100644 --- a/R/plexsans.R +++ b/R/plexsans.R @@ -1,4 +1,4 @@ -#' A precise & pristine [ggplot2] theme with opinionated defaults and an emphasis on typoghraphy +#' A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy #' #' You should [import_plex_sans()] first and install the fonts on your #' system before trying to use this theme. diff --git a/R/public-sans.R b/R/public-sans.R index 4eedff0..e367b99 100644 --- a/R/public-sans.R +++ b/R/public-sans.R @@ -1,4 +1,4 @@ -#' A precise & pristine [ggplot2] theme with opinionated defaults and an emphasis on typoghraphy +#' A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy #' #' You should [import_public_sans()] first and install the fonts on your #' system before trying to use this theme. diff --git a/R/roboto-condensed.r b/R/roboto-condensed.r index 0949529..0167f84 100644 --- a/R/roboto-condensed.r +++ b/R/roboto-condensed.r @@ -1,4 +1,4 @@ -#' A precise & pristine [ggplot2] theme with opinionated defaults and an emphasis on typoghraphy +#' A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy #' #' You should [import_roboto_condensed()] first and also install the fonts on your #' system before trying to use this theme. diff --git a/R/scales.r b/R/scales.r index 8618a8a..6e60e9e 100644 --- a/R/scales.r +++ b/R/scales.r @@ -27,7 +27,7 @@ is.formula <- function (x) { inherits(x, "formula") } #' each major break) #' - A numeric vector of positions #' - A function that given the limits returns a vector of minor breaks. -#' @param guide guide A function used to create a guide or its name. See [guides()] for more information. +#' @param guide guide A function used to create a guide or its name. See [ggplot2::guides()] for more information. #' @param n.breaks An integer guiding the number of major breaks. The algorithm may choose a #' slightly different number to ensure nice break labels. Will only have an effect if #' `breaks = waiver()`. Use NULL to use the default number of breaks given by the transformation. diff --git a/R/theme-ipsum.r b/R/theme-ipsum.r index e479f1c..f30e7bf 100644 --- a/R/theme-ipsum.r +++ b/R/theme-ipsum.r @@ -1,4 +1,4 @@ -#' A precise & pristine [ggplot2] theme with opinionated defaults and an emphasis on typography +#' A precise & pristine [ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typography #' #' Also has a "dark" / "modern" version for the new RStudio theme #' diff --git a/man/bit12.Rd b/man/bit12.Rd index 66d5251..09252ea 100644 --- a/man/bit12.Rd +++ b/man/bit12.Rd @@ -3,61 +3,14 @@ \docType{data} \name{bit12} \alias{bit12} -\title{Bit12 Color Palettes and Scales} +\title{Bit12 Color Palette} \format{ A named character vector of hex color codes } \usage{ bit12 } -\arguments{ -\item{...}{Additional arguments passed to scale_color_manual() or scale_fill_manual()} - -\item{palette}{For continuous scales, the name of the color palette to use -(one of "plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet")} -} -\value{ -A ggplot2 scale object -} \description{ -Color palettes and scales based on the Bit12 color scheme, a vibrant 12-color system -designed for clear data visualization. The palette offers a complete spectrum of -distinct colors that work well for categorical data while maintaining good contrast -and accessibility. - A vector of 12 colors in the Bit12 color scheme -} -\details{ -The package provides several types of scales: -* Discrete scales for categorical data -* Continuous scales with extended color ramps - -The color palette includes: -* Plum: Deep purple for emphasis -* Rose: Rich pink-red for highlighting important elements -* Coral: Soft reddish-orange for warm secondary elements -* Apricot: Muted orange for highlighting -* Lemon: Bright yellow for high visibility elements -* Lime: Fresh green for positive values and growth -* Mint: Cool green-blue for calm elements -* Teal: Balanced blue-green for neutral data -* Sky: Light blue for information elements -* Azure: Clear blue for primary interactions -* Cobalt: Deep blue for stability and reliability -* Violet: Purple for creative and distinctive elements -} -\examples{ -library(ggplot2) - -# Discrete color scale -ggplot(mpg, aes(class, fill = class)) + - geom_bar() + - scale_fill_bit12() - -# Continuous color scale -ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + - geom_tile() + - scale_fill_bit12_continuous(palette = "azure") - } \keyword{datasets} diff --git a/man/bit12_scale.Rd b/man/bit12_scale.Rd new file mode 100644 index 0000000..7980d1b --- /dev/null +++ b/man/bit12_scale.Rd @@ -0,0 +1,84 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bit12.R +\name{bit12_scale} +\alias{bit12_scale} +\alias{scale_color_bit12} +\alias{scale_fill_bit12} +\alias{scale_color_bit12_continuous} +\alias{scale_fill_bit12_continuous} +\alias{scale_color_bit12_distiller} +\alias{scale_fill_bit12_distiller} +\alias{scale_color_bit12_spectrum} +\alias{scale_fill_bit12_spectrum} +\title{Bit12 Color Palettes and Scales} +\usage{ +scale_color_bit12(...) + +scale_fill_bit12(...) + +scale_color_bit12_continuous(palette = "azure", ...) + +scale_fill_bit12_continuous(palette = "azure", ...) + +scale_color_bit12_distiller(palette = "azure", direction = 1, ...) + +scale_fill_bit12_distiller(palette = "azure", direction = 1, ...) + +scale_color_bit12_spectrum(direction = 1, ...) + +scale_fill_bit12_spectrum(direction = 1, ...) +} +\arguments{ +\item{...}{Additional arguments passed to scale_color_manual(), scale_fill_manual(), scale_color_gradientn(), or scale_fill_gradientn()} + +\item{palette}{For continuous scales, the name of the color palette to use +(one of "plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet")} + +\item{direction}{Sets the direction of the color scale (1 = default, -1 = reversed)} +} +\value{ +A ggplot2 scale object +} +\description{ +Color palettes and scales based on the Bit12 color scheme, a vibrant 12-color system +designed for clear data visualization. The palette offers a complete spectrum of +distinct colors that work well for categorical data while maintaining good contrast +and accessibility. +} +\details{ +The package provides several types of scales: +\itemize{ +\item Discrete scales for categorical data +\item Continuous scales with extended color ramps +} + +The color palette includes: +\itemize{ +\item Plum: Deep purple for emphasis +\item Rose: Rich pink-red for highlighting important elements +\item Coral: Soft reddish-orange for warm secondary elements +\item Apricot: Muted orange for highlighting +\item Lemon: Bright yellow for high visibility elements +\item Lime: Fresh green for positive values and growth +\item Mint: Cool green-blue for calm elements +\item Teal: Balanced blue-green for neutral data +\item Sky: Light blue for information elements +\item Azure: Clear blue for primary interactions +\item Cobalt: Deep blue for stability and reliability +\item Violet: Purple for creative and distinctive elements +} +} +\examples{ +library(ggplot2) + +# Discrete color scale +ggplot(mpg, aes(class, fill = class)) + + geom_bar() + + scale_fill_bit12() + +# Continuous color scale +ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + + geom_tile() + + scale_fill_bit12_continuous(palette = "azure") + +} diff --git a/man/flexoki.Rd b/man/flexoki.Rd index edb32e1..216be63 100644 --- a/man/flexoki.Rd +++ b/man/flexoki.Rd @@ -23,18 +23,22 @@ and harmonious color relationships. } \details{ The package provides several types of scales: -* Discrete scales for both light and dark variants -* Continuous scales with extended color ramps +\itemize{ +\item Discrete scales for both light and dark variants +\item Continuous scales with extended color ramps +} The color palette includes: -* Red: For emphasis and warnings -* Orange: For secondary emphasis -* Yellow: For highlighting -* Green: For success states and nature-related data -* Cyan: For information and water-related data -* Blue: For primary elements and cool tones -* Purple: For luxury and depth -* Magenta: For creative and feminine contexts +\itemize{ +\item Red: For emphasis and warnings +\item Orange: For secondary emphasis +\item Yellow: For highlighting +\item Green: For success states and nature-related data +\item Cyan: For information and water-related data +\item Blue: For primary elements and cool tones +\item Purple: For luxury and depth +\item Magenta: For creative and feminine contexts +} } \examples{ library(ggplot2) diff --git a/man/scale_color_bit12.Rd b/man/scale_color_bit12.Rd deleted file mode 100644 index e03b806..0000000 --- a/man/scale_color_bit12.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bit12.R -\name{scale_color_bit12} -\alias{scale_color_bit12} -\title{Discrete Color Scale Using Bit12 Colors} -\usage{ -scale_color_bit12(...) -} -\arguments{ -\item{...}{Additional arguments passed to scale_color_manual()} -} -\value{ -A discrete ggplot2 color scale -} -\description{ -Discrete Color Scale Using Bit12 Colors -} -\examples{ -library(ggplot2) -ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) + - geom_point() + - scale_color_bit12() -} diff --git a/man/scale_color_bit12_continuous.Rd b/man/scale_color_bit12_continuous.Rd deleted file mode 100644 index 8416818..0000000 --- a/man/scale_color_bit12_continuous.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bit12.R -\name{scale_color_bit12_continuous} -\alias{scale_color_bit12_continuous} -\title{Continuous Color Scale Using Bit12 Colors} -\usage{ -scale_color_bit12_continuous(palette = "azure", ...) -} -\arguments{ -\item{palette}{Name of the color palette to use ("plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet")} - -\item{...}{Additional arguments passed to scale_color_gradientn()} -} -\value{ -A continuous ggplot2 color scale -} -\description{ -Continuous Color Scale Using Bit12 Colors -} -\examples{ -library(ggplot2) -ggplot(faithfuld, aes(waiting, eruptions, color = density)) + - geom_point() + - scale_color_bit12_continuous(palette = "azure") -} diff --git a/man/scale_color_bit12_distiller.Rd b/man/scale_color_bit12_distiller.Rd deleted file mode 100644 index 10b6218..0000000 --- a/man/scale_color_bit12_distiller.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bit12.R -\name{scale_color_bit12_distiller} -\alias{scale_color_bit12_distiller} -\title{Distiller Color Scale Using Bit12 Colors} -\usage{ -scale_color_bit12_distiller(palette = "azure", direction = 1, ...) -} -\arguments{ -\item{palette}{Name of the color palette to use ("plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet")} - -\item{direction}{Sets the direction of the color scale (1 = default, -1 = reversed)} - -\item{...}{Additional arguments passed to scale_color_gradientn()} -} -\value{ -A sequential ggplot2 color scale -} -\description{ -Creates a sequential color gradient based on a selected Bit12 color -} -\examples{ -library(ggplot2) -ggplot(faithfuld, aes(waiting, eruptions, color = density)) + - geom_point() + - scale_color_bit12_distiller(palette = "azure") -} diff --git a/man/scale_color_bit12_spectrum.Rd b/man/scale_color_bit12_spectrum.Rd deleted file mode 100644 index 2baa61c..0000000 --- a/man/scale_color_bit12_spectrum.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bit12.R -\name{scale_color_bit12_spectrum} -\alias{scale_color_bit12_spectrum} -\title{Distiller Color Scale Across All Bit12 Colors} -\usage{ -scale_color_bit12_spectrum(direction = 1, ...) -} -\arguments{ -\item{direction}{Sets the direction of the color scale (1 = default, -1 = reversed)} - -\item{...}{Additional arguments passed to scale_color_gradientn()} -} -\value{ -A sequential ggplot2 color scale -} -\description{ -Creates a sequential color gradient using all colors from the Bit12 palette -} -\examples{ -library(ggplot2) -ggplot(faithfuld, aes(waiting, eruptions, color = density)) + - geom_point() + - scale_color_bit12_spectrum() -} diff --git a/man/scale_fill_bit12.Rd b/man/scale_fill_bit12.Rd deleted file mode 100644 index 8629296..0000000 --- a/man/scale_fill_bit12.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bit12.R -\name{scale_fill_bit12} -\alias{scale_fill_bit12} -\title{Discrete Fill Scale Using Bit12 Colors} -\usage{ -scale_fill_bit12(...) -} -\arguments{ -\item{...}{Additional arguments passed to scale_fill_manual()} -} -\value{ -A discrete ggplot2 fill scale -} -\description{ -Discrete Fill Scale Using Bit12 Colors -} -\examples{ -library(ggplot2) -ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) + - geom_bar() + - scale_fill_bit12() -} diff --git a/man/scale_fill_bit12_continuous.Rd b/man/scale_fill_bit12_continuous.Rd deleted file mode 100644 index 7a92a15..0000000 --- a/man/scale_fill_bit12_continuous.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bit12.R -\name{scale_fill_bit12_continuous} -\alias{scale_fill_bit12_continuous} -\title{Continuous Fill Scale Using Bit12 Colors} -\usage{ -scale_fill_bit12_continuous(palette = "azure", ...) -} -\arguments{ -\item{palette}{Name of the color palette to use ("plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet")} - -\item{...}{Additional arguments passed to scale_fill_gradientn()} -} -\value{ -A continuous ggplot2 fill scale -} -\description{ -Continuous Fill Scale Using Bit12 Colors -} -\examples{ -library(ggplot2) -ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + - geom_tile() + - scale_fill_bit12_continuous(palette = "azure") -} diff --git a/man/scale_fill_bit12_distiller.Rd b/man/scale_fill_bit12_distiller.Rd deleted file mode 100644 index 5fc7978..0000000 --- a/man/scale_fill_bit12_distiller.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bit12.R -\name{scale_fill_bit12_distiller} -\alias{scale_fill_bit12_distiller} -\title{Distiller Fill Scale Using Bit12 Colors} -\usage{ -scale_fill_bit12_distiller(palette = "azure", direction = 1, ...) -} -\arguments{ -\item{palette}{Name of the color palette to use ("plum", "rose", "coral", "apricot", "lemon", "lime", "mint", "teal", "sky", "azure", "cobalt", "violet")} - -\item{direction}{Sets the direction of the color scale (1 = default, -1 = reversed)} - -\item{...}{Additional arguments passed to scale_fill_gradientn()} -} -\value{ -A sequential ggplot2 fill scale -} -\description{ -Creates a sequential fill gradient based on a selected Bit12 color -} -\examples{ -library(ggplot2) -ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + - geom_tile() + - scale_fill_bit12_distiller(palette = "azure") -} diff --git a/man/scale_fill_bit12_spectrum.Rd b/man/scale_fill_bit12_spectrum.Rd deleted file mode 100644 index b2c2794..0000000 --- a/man/scale_fill_bit12_spectrum.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bit12.R -\name{scale_fill_bit12_spectrum} -\alias{scale_fill_bit12_spectrum} -\title{Distiller Fill Scale Across All Bit12 Colors} -\usage{ -scale_fill_bit12_spectrum(direction = 1, ...) -} -\arguments{ -\item{direction}{Sets the direction of the color scale (1 = default, -1 = reversed)} - -\item{...}{Additional arguments passed to scale_fill_gradientn()} -} -\value{ -A sequential ggplot2 fill scale -} -\description{ -Creates a sequential fill gradient using all colors from the Bit12 palette -} -\examples{ -library(ggplot2) -ggplot(faithfuld, aes(waiting, eruptions, fill = density)) + - geom_tile() + - scale_fill_bit12_spectrum() -} diff --git a/man/scale_ft.Rd b/man/scale_ft.Rd index 8066747..0ed6d88 100644 --- a/man/scale_ft.Rd +++ b/man/scale_ft.Rd @@ -35,7 +35,20 @@ omitted.} as output. Also accepts rlang \link[rlang:as_function]{lambda} function notation. }} - \item{\code{labels}}{One of: + \item{\code{minor_breaks}}{One of: +\itemize{ +\item \code{NULL} for no minor breaks +\item \code{waiver()} for the default breaks (none for discrete, one minor break +between each major break for continuous) +\item A numeric vector of positions +\item A function that given the limits returns a vector of minor breaks. Also +accepts rlang \link[rlang:as_function]{lambda} function notation. When +the function has two arguments, it will be given the limits and major +break positions. +}} + \item{\code{labels}}{One of the options below. Please note that when \code{labels} is a +vector, it is highly recommended to also set the \code{breaks} argument as a +vector to protect against unintended mismatches. \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the diff --git a/man/scale_ipsum.Rd b/man/scale_ipsum.Rd index 6b238e2..57d7029 100644 --- a/man/scale_ipsum.Rd +++ b/man/scale_ipsum.Rd @@ -35,7 +35,20 @@ omitted.} as output. Also accepts rlang \link[rlang:as_function]{lambda} function notation. }} - \item{\code{labels}}{One of: + \item{\code{minor_breaks}}{One of: +\itemize{ +\item \code{NULL} for no minor breaks +\item \code{waiver()} for the default breaks (none for discrete, one minor break +between each major break for continuous) +\item A numeric vector of positions +\item A function that given the limits returns a vector of minor breaks. Also +accepts rlang \link[rlang:as_function]{lambda} function notation. When +the function has two arguments, it will be given the limits and major +break positions. +}} + \item{\code{labels}}{One of the options below. Please note that when \code{labels} is a +vector, it is highly recommended to also set the \code{breaks} argument as a +vector to protect against unintended mismatches. \itemize{ \item \code{NULL} for no labels \item \code{waiver()} for the default labels computed by the diff --git a/man/scale_x_percent.Rd b/man/scale_x_percent.Rd index 40d7955..d236be2 100644 --- a/man/scale_x_percent.Rd +++ b/man/scale_x_percent.Rd @@ -132,7 +132,7 @@ each major break) \item A function that given the limits returns a vector of minor breaks. }} -\item{guide}{guide A function used to create a guide or its name. See \code{\link[=guides]{guides()}} for more information.} +\item{guide}{guide A function used to create a guide or its name. See \code{\link[ggplot2:guides]{ggplot2::guides()}} for more information.} \item{n.breaks}{An integer guiding the number of major breaks. The algorithm may choose a slightly different number to ensure nice break labels. Will only have an effect if @@ -169,9 +169,9 @@ scales, "top" or "bottom" for horizontal scales} \item{sec.axis}{specify a secondary axis} \item{accuracy, scale, prefix, suffix, big.mark, decimal.mark, trim}{See -[scales::comma_format()] or [scales::percent_format()]} +\code{\link[scales:comma]{scales::comma_format()}} or \code{\link[scales:percent_format]{scales::percent_format()}}} -\item{...}{passed on to [scales::comma_format()] or [scales::percent_format()]} +\item{...}{passed on to \code{\link[scales:comma]{scales::comma_format()}} or \code{\link[scales:percent_format]{scales::percent_format()}}} } \description{ The \verb{_comma} ones set comma format for axis text and \code{expand=c(0,0)} (you need to set limits). diff --git a/man/theme_ipsum.Rd b/man/theme_ipsum.Rd index 26697b2..0fe6116 100644 --- a/man/theme_ipsum.Rd +++ b/man/theme_ipsum.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/theme-ipsum.r \name{theme_ipsum} \alias{theme_ipsum} -\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typography} +\title{A precise & pristine \link[ggplot2:ggplot2-package]{ggplot2} theme with opinionated defaults and an emphasis on typography} \usage{ theme_ipsum( base_family = "Arial Narrow", diff --git a/man/theme_ipsum_es.Rd b/man/theme_ipsum_es.Rd index 36c04e9..865da5e 100644 --- a/man/theme_ipsum_es.Rd +++ b/man/theme_ipsum_es.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/econ-sans.R \name{theme_ipsum_es} \alias{theme_ipsum_es} -\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy} +\title{A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy} \usage{ theme_ipsum_es( base_family = "EconSansCndReg", diff --git a/man/theme_ipsum_gs.Rd b/man/theme_ipsum_gs.Rd index 47af897..9367de6 100644 --- a/man/theme_ipsum_gs.Rd +++ b/man/theme_ipsum_gs.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/goldmansans.R \name{theme_ipsum_gs} \alias{theme_ipsum_gs} -\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy} +\title{A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy} \usage{ theme_ipsum_gs( base_family = "Goldman Sans Condensed", diff --git a/man/theme_ipsum_inter.Rd b/man/theme_ipsum_inter.Rd index 8aab2d6..c23c909 100644 --- a/man/theme_ipsum_inter.Rd +++ b/man/theme_ipsum_inter.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/inter.R \name{theme_ipsum_inter} \alias{theme_ipsum_inter} -\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy} +\title{A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy} \usage{ theme_ipsum_inter( base_family = "Inter-Medium", diff --git a/man/theme_ipsum_ps.Rd b/man/theme_ipsum_ps.Rd index 022a81e..ff06c91 100644 --- a/man/theme_ipsum_ps.Rd +++ b/man/theme_ipsum_ps.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/plexsans.R \name{theme_ipsum_ps} \alias{theme_ipsum_ps} -\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy} +\title{A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy} \usage{ theme_ipsum_ps( base_family = "IBMPlexSans", diff --git a/man/theme_ipsum_pub.Rd b/man/theme_ipsum_pub.Rd index 70952e8..4eab7d4 100644 --- a/man/theme_ipsum_pub.Rd +++ b/man/theme_ipsum_pub.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/public-sans.R \name{theme_ipsum_pub} \alias{theme_ipsum_pub} -\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy} +\title{A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy} \usage{ theme_ipsum_pub( base_family = "Public Sans", diff --git a/man/theme_ipsum_rc.Rd b/man/theme_ipsum_rc.Rd index 99c793a..12faa3b 100644 --- a/man/theme_ipsum_rc.Rd +++ b/man/theme_ipsum_rc.Rd @@ -4,7 +4,7 @@ \alias{theme_ft_rc} \alias{theme_modern_rc} \alias{theme_ipsum_rc} -\title{A precise & pristine \link{ggplot2} theme with opinionated defaults and an emphasis on typoghraphy} +\title{A precise & pristine [ggplot2][ggplot2][ggplot2::ggplot2] theme with opinionated defaults and an emphasis on typoghraphy} \usage{ theme_ft_rc( base_family = "Roboto Condensed", diff --git a/man/update_geom_font_defaults.Rd b/man/update_geom_font_defaults.Rd index 31d2f41..e0ad31c 100644 --- a/man/update_geom_font_defaults.Rd +++ b/man/update_geom_font_defaults.Rd @@ -15,5 +15,5 @@ update_geom_font_defaults( \item{family, face, size, color}{font family name, face, size and color} } \description{ -Updates [ggplot2::geom_label] and [ggplot2::geom_text] font defaults +Updates \link[ggplot2:geom_text]{ggplot2::geom_label} and \link[ggplot2:geom_text]{ggplot2::geom_text} font defaults } diff --git a/tests/testthat/_snaps/themes/theme-ipsum-rc.svg b/tests/testthat/_snaps/themes/theme-ipsum-rc.svg new file mode 100644 index 0000000..aaa50a7 --- /dev/null +++ b/tests/testthat/_snaps/themes/theme-ipsum-rc.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1 + + +1.0 +1.5 +2.0 +2.5 +3.0 +1.0 +1.5 +2.0 +2.5 +3.0 +x +y +z + + +a +b +theme_ipsum_rc + + diff --git a/tests/testthat/_snaps/themes/theme-ipsum.svg b/tests/testthat/_snaps/themes/theme-ipsum.svg new file mode 100644 index 0000000..169e436 --- /dev/null +++ b/tests/testthat/_snaps/themes/theme-ipsum.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1 + + +1.0 +1.5 +2.0 +2.5 +3.0 +1.0 +1.5 +2.0 +2.5 +3.0 +x +y +z + + +a +b +theme_ipsum + + diff --git a/tests/testthat/fontconfig-helper.R b/tests/testthat/fontconfig-helper.R index e37c317..c73c435 100644 --- a/tests/testthat/fontconfig-helper.R +++ b/tests/testthat/fontconfig-helper.R @@ -5,8 +5,3 @@ on_appveyor <- function() { on_cran <- function() { !identical(Sys.getenv("NOT_CRAN"), "true") } - -# Use minimal fonts.conf to speed up fc-cache -if (on_appveyor() || on_cran()) { - gdtools::set_dummy_conf() -} \ No newline at end of file