docs: regenerate roxygen documentation for paper_bg and force params (#19)
R-CMD-check / R CMD check (pull_request) Successful in 4m29s
R-CMD-check / R CMD check (pull_request) Successful in 4m29s
This commit is contained in:
@@ -4,17 +4,25 @@
|
|||||||
\alias{civilytics_load_fonts}
|
\alias{civilytics_load_fonts}
|
||||||
\title{Load Civilytics brand fonts}
|
\title{Load Civilytics brand fonts}
|
||||||
\usage{
|
\usage{
|
||||||
civilytics_load_fonts()
|
civilytics_load_fonts(force = FALSE)
|
||||||
|
}
|
||||||
|
\arguments{
|
||||||
|
\item{force}{Logical. If \code{TRUE}, reload fonts even if they were already
|
||||||
|
loaded in this session. Default \code{FALSE}.}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
Invisibly returns `NULL`.
|
Invisibly returns \code{TRUE} if fonts were loaded, \code{FALSE} if skipped
|
||||||
|
(already loaded and \code{force = FALSE}).
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Downloads Inter and Libre Franklin from Google Fonts via
|
Downloads Inter, Libre Franklin, Source Serif 4 and JetBrains Mono from
|
||||||
[sysfonts::font_add_google()], then calls [showtext::showtext_auto()] so
|
Google Fonts via \code{sysfonts::font_add_google()}, then calls
|
||||||
that all graphics devices render text with those fonts. This is called
|
\code{showtext::showtext_auto()} so that all graphics devices render text with
|
||||||
automatically when the package loads; use this function to retry if the
|
those fonts. This is called automatically when the package loads; use this
|
||||||
initial load failed (e.g., the machine was offline at load time).
|
function to retry if the initial load failed (e.g., the machine was offline
|
||||||
|
at load time).
|
||||||
|
|
||||||
|
Subsequent calls within the same session are no-ops unless \code{force = TRUE}.
|
||||||
}
|
}
|
||||||
\examples{
|
\examples{
|
||||||
\dontrun{
|
\dontrun{
|
||||||
|
|||||||
+10
-8
@@ -17,7 +17,7 @@ theme_civilytics(
|
|||||||
accent = unname(civilytics_colors["ember_600"]),
|
accent = unname(civilytics_colors["ember_600"]),
|
||||||
strip_color = unname(civilytics_colors["paper_2"]),
|
strip_color = unname(civilytics_colors["paper_2"]),
|
||||||
grid = c("y", "x", "both", "none"),
|
grid = c("y", "x", "both", "none"),
|
||||||
paper_bg = TRUE
|
paper_bg = FALSE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
@@ -56,10 +56,12 @@ to [civilytics_colors]`["paper_2"]` (`#F2EDE4`).}
|
|||||||
\item{grid}{Character. Which major gridlines to draw: `"y"` (default,
|
\item{grid}{Character. Which major gridlines to draw: `"y"` (default,
|
||||||
horizontal only), `"x"` (vertical only), `"both"`, or `"none"`.}
|
horizontal only), `"x"` (vertical only), `"both"`, or `"none"`.}
|
||||||
|
|
||||||
\item{paper_bg}{Logical. If `TRUE` (default), fill the plot and panel
|
\item{paper_bg}{Logical. If `TRUE`, fill the plot and panel backgrounds
|
||||||
backgrounds with the warm `paper` color. Set to `FALSE` for a
|
with the warm `paper` color (Civilytics cream). Default is `FALSE`
|
||||||
transparent background (useful for slides or overlay on colored
|
(transparent) so that figures composite cleanly onto any background.
|
||||||
surfaces).}
|
Set to `TRUE` for the branded cream canvas. Note: a transparent device
|
||||||
|
background (e.g., `dev = "ragg_png"`, `dev.args = list(background =
|
||||||
|
"transparent")`) is also needed for fully-transparent PNG exports.}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
A complete ggplot2 [ggplot2::theme()] object.
|
A complete ggplot2 [ggplot2::theme()] object.
|
||||||
@@ -105,7 +107,7 @@ shrinkage.
|
|||||||
\dontrun{
|
\dontrun{
|
||||||
library(ggplot2)
|
library(ggplot2)
|
||||||
|
|
||||||
# Default editorial theme
|
# Default — transparent background for embedding
|
||||||
ggplot(mpg, aes(displ, hwy)) +
|
ggplot(mpg, aes(displ, hwy)) +
|
||||||
geom_point() +
|
geom_point() +
|
||||||
theme_civilytics()
|
theme_civilytics()
|
||||||
@@ -116,10 +118,10 @@ ggplot(mpg, aes(displ, hwy, colour = class)) +
|
|||||||
scale_color_civilytics() +
|
scale_color_civilytics() +
|
||||||
theme_civilytics(grid = "both")
|
theme_civilytics(grid = "both")
|
||||||
|
|
||||||
# Transparent background for embedding
|
# Branded cream background (opt-in)
|
||||||
ggplot(mpg, aes(displ, hwy)) +
|
ggplot(mpg, aes(displ, hwy)) +
|
||||||
geom_point() +
|
geom_point() +
|
||||||
theme_civilytics(paper_bg = FALSE)
|
theme_civilytics(paper_bg = TRUE)
|
||||||
|
|
||||||
# Larger text for poster or display
|
# Larger text for poster or display
|
||||||
ggplot(mpg, aes(displ, hwy)) +
|
ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
|||||||
@@ -56,10 +56,10 @@ to [civilytics_colors]`["paper_2"]` (`#F2EDE4`).}
|
|||||||
\item{grid}{Character. Which major gridlines to draw: `"y"` (default,
|
\item{grid}{Character. Which major gridlines to draw: `"y"` (default,
|
||||||
horizontal only), `"x"` (vertical only), `"both"`, or `"none"`.}
|
horizontal only), `"x"` (vertical only), `"both"`, or `"none"`.}
|
||||||
|
|
||||||
\item{paper_bg}{Logical. If `TRUE` (default), fill the plot and panel
|
\item{paper_bg}{Logical. If `TRUE`, fill the plot and panel backgrounds
|
||||||
backgrounds with the warm `paper` color. Set to `FALSE` for a
|
with the warm `paper` color (Civilytics cream). Default is `FALSE`
|
||||||
transparent background (useful for slides or overlay on colored
|
(transparent) so that figures composite cleanly onto any background.
|
||||||
surfaces).}
|
Set to `TRUE` for the branded cream canvas.}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
A complete ggplot2 [ggplot2::theme()] object.
|
A complete ggplot2 [ggplot2::theme()] object.
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ design system.}
|
|||||||
\item{strip_color}{Character. Hex code for facet strip background. Defaults
|
\item{strip_color}{Character. Hex code for facet strip background. Defaults
|
||||||
to [civilytics_colors]`["paper_2"]` (`#F2EDE4`).}
|
to [civilytics_colors]`["paper_2"]` (`#F2EDE4`).}
|
||||||
|
|
||||||
\item{paper_bg}{Logical. If `TRUE` (default), fill the plot and panel
|
\item{paper_bg}{Logical. If `TRUE`, fill the plot and panel backgrounds
|
||||||
backgrounds with the warm `paper` color. Set to `FALSE` for a
|
with the warm `paper` color (Civilytics cream). Default is `FALSE`
|
||||||
transparent background (useful for slides or overlay on colored
|
(transparent) so that figures composite cleanly onto any background.
|
||||||
surfaces).}
|
Set to `TRUE` for the branded cream canvas.}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
A complete ggplot2 [ggplot2::theme()] object.
|
A complete ggplot2 [ggplot2::theme()] object.
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ design system.}
|
|||||||
\item{strip_color}{Character. Hex code for facet strip background. Defaults
|
\item{strip_color}{Character. Hex code for facet strip background. Defaults
|
||||||
to [civilytics_colors]`["paper_2"]` (`#F2EDE4`).}
|
to [civilytics_colors]`["paper_2"]` (`#F2EDE4`).}
|
||||||
|
|
||||||
\item{paper_bg}{Logical. If `TRUE` (default), fill the plot and panel
|
\item{paper_bg}{Logical. If `TRUE`, fill the plot and panel backgrounds
|
||||||
backgrounds with the warm `paper` color. Set to `FALSE` for a
|
with the warm `paper` color (Civilytics cream). Default is `FALSE`
|
||||||
transparent background (useful for slides or overlay on colored
|
(transparent) so that figures composite cleanly onto any background.
|
||||||
surfaces).}
|
Set to `TRUE` for the branded cream canvas.}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
A complete ggplot2 [ggplot2::theme()] object.
|
A complete ggplot2 [ggplot2::theme()] object.
|
||||||
|
|||||||
@@ -56,10 +56,10 @@ to [civilytics_colors]`["paper_2"]` (`#F2EDE4`).}
|
|||||||
\item{grid}{Character. Which major gridlines to draw: `"y"` (default,
|
\item{grid}{Character. Which major gridlines to draw: `"y"` (default,
|
||||||
horizontal only), `"x"` (vertical only), `"both"`, or `"none"`.}
|
horizontal only), `"x"` (vertical only), `"both"`, or `"none"`.}
|
||||||
|
|
||||||
\item{paper_bg}{Logical. If `TRUE` (default), fill the plot and panel
|
\item{paper_bg}{Logical. If `TRUE`, fill the plot and panel backgrounds
|
||||||
backgrounds with the warm `paper` color. Set to `FALSE` for a
|
with the warm `paper` color (Civilytics cream). Default is `FALSE`
|
||||||
transparent background (useful for slides or overlay on colored
|
(transparent) so that figures composite cleanly onto any background.
|
||||||
surfaces).}
|
Set to `TRUE` for the branded cream canvas.}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
A complete ggplot2 [ggplot2::theme()] object.
|
A complete ggplot2 [ggplot2::theme()] object.
|
||||||
|
|||||||
@@ -52,10 +52,10 @@ design system.}
|
|||||||
\item{strip_color}{Character. Hex code for facet strip background. Defaults
|
\item{strip_color}{Character. Hex code for facet strip background. Defaults
|
||||||
to [civilytics_colors]`["paper_2"]` (`#F2EDE4`).}
|
to [civilytics_colors]`["paper_2"]` (`#F2EDE4`).}
|
||||||
|
|
||||||
\item{paper_bg}{Logical. If `TRUE` (default), fill the plot and panel
|
\item{paper_bg}{Logical. If `TRUE`, fill the plot and panel backgrounds
|
||||||
backgrounds with the warm `paper` color. Set to `FALSE` for a
|
with the warm `paper` color (Civilytics cream). Default is `FALSE`
|
||||||
transparent background (useful for slides or overlay on colored
|
(transparent) so that figures composite cleanly onto any background.
|
||||||
surfaces).}
|
Set to `TRUE` for the branded cream canvas.}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
A complete ggplot2 [ggplot2::theme()] object.
|
A complete ggplot2 [ggplot2::theme()] object.
|
||||||
|
|||||||
Reference in New Issue
Block a user