feat: rebrand logos with wordmark/mark variants and pipe-friendly API
R-CMD-check / R CMD check (push) Successful in 2m39s
R-CMD-check / R CMD check (push) Successful in 2m39s
- Replace old civilytics_logo.png/white.png/jpg/pdf with new rebrand
assets: civilytics-wordmark.png, civilytics-wordmark-reverse.png,
civilytics-mark.png, civilytics-mark-reverse.png (all transparent bg)
- make_logo_grob() now accepts type = c("wordmark", "mark") alongside
variant = c("light", "dark") for 4 combinations
- New civilytics_logo() pipe-friendly convenience function:
ggplot(df, aes(x, y)) + geom_point() + theme_civilytics() |>
civilytics_logo()
R's |> has lower precedence than +, so the full ggplot chain pipes
through without parentheses
- Remove old icon/favicon assets no longer used
- Wrap showtext-dependent examples in \dontrun{} to prevent R CMD check
failures in headless PostScript environments
This commit is contained in:
+11
-7
@@ -4,22 +4,26 @@
|
||||
\alias{make_logo_grob}
|
||||
\title{Get a Civilytics Logo grob}
|
||||
\usage{
|
||||
make_logo_grob(variant = c("light", "dark"))
|
||||
make_logo_grob(type = c("wordmark", "mark"), variant = c("light", "dark"))
|
||||
}
|
||||
\arguments{
|
||||
\item{variant}{Character. `"light"` (default) uses the standard dark logo
|
||||
suitable for light backgrounds. `"dark"` uses the white logo suitable for
|
||||
dark backgrounds (pairs with [theme_civilytics_dark()]).}
|
||||
\item{type}{Character. `"wordmark"` (default) uses the full wordmark.
|
||||
`"mark"` uses the compact C-pulse icon only.}
|
||||
|
||||
\item{variant}{Character. `"light"` (default) uses the dark logo for light
|
||||
backgrounds. `"dark"` uses the reverse (light) logo for dark backgrounds
|
||||
(pairs with [theme_civilytics_dark()]).}
|
||||
}
|
||||
\value{
|
||||
A ggplot object (class `"gg"`) containing the logo grob.
|
||||
}
|
||||
\description{
|
||||
Returns a ggplot object containing the Civilytics logo as a rasterGrob,
|
||||
ready to compose with plots via [add_logo()] or [add_logo_ga()].
|
||||
ready to compose with plots via [add_logo()], [add_logo_ga()], or the
|
||||
pipe-friendly [civilytics_logo()].
|
||||
}
|
||||
\examples{
|
||||
logo <- make_logo_grob() # light background
|
||||
logo_dark <- make_logo_grob("dark") # dark background
|
||||
logo <- make_logo_grob() # wordmark, light
|
||||
logo <- make_logo_grob("mark", "dark") # mark, dark
|
||||
class(logo) # "gg" "ggplot"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user