Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
967e7e1111 | ||
|
|
f32093c662 | ||
|
|
e257180f15 | ||
|
|
0ef0f310e2 | ||
|
|
4fb5c488f8
|
||
|
|
96dc1c4c6b | ||
|
|
6ea9265236 | ||
|
|
b9d427eb76
|
||
|
|
a904d2313a
|
||
|
|
761a72da18 | ||
|
|
4f51a49903
|
||
|
|
5fc8155965
|
||
|
|
41162597cf | ||
|
|
2a74ec2bd3 | ||
|
|
366ac39fac | ||
|
|
fc8bf1866b | ||
|
|
75b9a73165 | ||
|
|
2f1cdcde52 | ||
|
|
136c53643c
|
||
|
|
41fe2b6170
|
||
|
|
ac8e3eb60e
|
||
|
|
98e0949d27
|
||
|
|
328d9d2fd6
|
||
|
|
95b8ba1da4
|
||
|
|
f134621df5
|
||
|
|
31d3e2886d
|
||
|
|
34622ccf88
|
||
|
|
f9b51cc558
|
||
|
|
875251068a
|
||
|
|
515bae8685
|
||
|
|
099fff1d1d
|
||
|
|
7371069379
|
||
|
|
3a6f20b723
|
||
|
|
c93c469267
|
||
|
|
2d70d9aecf
|
||
|
|
bf6f7cc480
|
||
|
|
b84fc2f7d0
|
||
|
|
d17a4fbc7c
|
||
|
|
53299c7e88
|
||
|
|
38cdaa8ea7
|
||
|
|
01c9d1c796 | ||
|
|
b59cbeb9b6 |
No files matched your search
@@ -1,8 +1,12 @@
|
|||||||
^.*\.Rproj$
|
^.*\.Rproj$
|
||||||
^\.Rproj\.user$
|
^\.Rproj\.user$
|
||||||
^\.github$
|
^\.github$
|
||||||
|
^\.gitea$
|
||||||
^README\.Rmd$
|
^README\.Rmd$
|
||||||
^Makefile$
|
^Makefile$
|
||||||
^Jenkinsfile$
|
|
||||||
^Dockerfile$
|
^Dockerfile$
|
||||||
^LICENSE\.md$
|
^LICENSE\.md$
|
||||||
|
^\.claude$
|
||||||
|
^\.playwright-mcp$
|
||||||
|
^civilytics-site\.png$
|
||||||
|
^Rplots\.pdf$
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
name: R-CMD-check
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
pull_request:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
name: R CMD check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: rocker/r-ver:4.6
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Plain git checkout — no Node.js required, works in any container.
|
||||||
|
# gitea.token is automatically injected by the runner for auth.
|
||||||
|
- name: Check out code
|
||||||
|
env:
|
||||||
|
REPO_TOKEN: ${{ gitea.token }}
|
||||||
|
run: |
|
||||||
|
apt-get update -qq && apt-get install -y --no-install-recommends git
|
||||||
|
git config --global --add safe.directory "$PWD"
|
||||||
|
git init
|
||||||
|
git remote add origin \
|
||||||
|
"https://oauth2:${REPO_TOKEN}@gitea.civilytics.org/${{ gitea.repository }}.git"
|
||||||
|
git fetch --depth=1 origin "${{ gitea.sha }}"
|
||||||
|
git checkout FETCH_HEAD
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: |
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libcurl4-openssl-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libcairo2-dev \
|
||||||
|
libjpeg-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libfontconfig1-dev \
|
||||||
|
libharfbuzz-dev \
|
||||||
|
libfribidi-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libtiff5-dev
|
||||||
|
|
||||||
|
- name: Install R dependencies
|
||||||
|
run: |
|
||||||
|
install.packages(c("remotes", "rcmdcheck"))
|
||||||
|
remotes::install_deps(dependencies = TRUE)
|
||||||
|
shell: Rscript {0}
|
||||||
|
|
||||||
|
- name: Run R CMD check
|
||||||
|
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning")
|
||||||
|
shell: Rscript {0}
|
||||||
@@ -1,26 +1,40 @@
|
|||||||
Package: civilytics
|
Package: civilytics
|
||||||
Type: Package
|
Type: Package
|
||||||
Title: Utilities Functions for Civilytics
|
Title: Brand Themes, Color Palettes, and Utility Functions for Civilytics
|
||||||
Version: 0.2.0
|
Version: 0.3.1
|
||||||
Author: Jared E. Knowles <jared@civilytics.com>
|
Authors@R:
|
||||||
Maintainer: Jared E. Knowles <jared@civilytics.com>
|
person("Jared", "E. Knowles", email = "jared@civilytics.com",
|
||||||
Description: House R functions for Civilytics Consulting LLC
|
role = c("aut", "cre"))
|
||||||
This package implements a variety of useful functions for creating and
|
Description: Provides a complete ggplot2 brand theme system for Civilytics
|
||||||
branding analyses produced by Civilytics Consulting LLC.
|
Consulting LLC, including editorial light, dark, and slide-optimized themes;
|
||||||
License: LGPL (>= 3)
|
10 curated color palettes for qualitative, sequential, and diverging data;
|
||||||
Depends:
|
logo composition utilities; Quarto themes for HTML reports, PDF, Typst, and
|
||||||
R (>= 2.15.1)
|
Reveal.js presentations; and data-wrangling helpers for public-sector
|
||||||
Imports:
|
analysis.
|
||||||
ggplot2,
|
License: LGPL (>= 3)
|
||||||
jpeg,
|
URL: https://gitea.civilytics.org/Civilytics/civilyticsR
|
||||||
png,
|
BugReports: https://gitea.civilytics.org/Civilytics/civilyticsR/issues
|
||||||
stringr,
|
Depends:
|
||||||
gridExtra,
|
R (>= 4.1.0)
|
||||||
tidycensus,
|
Imports:
|
||||||
grid,
|
ggplot2 (>= 4.0.0),
|
||||||
stringdist
|
jpeg,
|
||||||
Encoding: UTF-8
|
jsonlite,
|
||||||
LazyData: true
|
png,
|
||||||
Suggests:
|
stringr,
|
||||||
testthat
|
gridExtra,
|
||||||
RoxygenNote: 7.3.2
|
grid,
|
||||||
|
stringdist,
|
||||||
|
showtext,
|
||||||
|
sysfonts
|
||||||
|
Encoding: UTF-8
|
||||||
|
Suggests:
|
||||||
|
testthat (>= 3.0.0),
|
||||||
|
tidycensus,
|
||||||
|
quarto,
|
||||||
|
flextable,
|
||||||
|
officer,
|
||||||
|
ragg
|
||||||
|
Config/testthat/edition: 3
|
||||||
|
Config/roxygen2/version: 8.0.0
|
||||||
|
RoxygenNote: 7.3.3
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
pipeline {
|
|
||||||
agent {
|
|
||||||
dockerfile true
|
|
||||||
}
|
|
||||||
stages {
|
|
||||||
stage('Docker setup') {
|
|
||||||
steps {
|
|
||||||
sh '''
|
|
||||||
R --version
|
|
||||||
java --version
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
stage('Build and test') {
|
|
||||||
stages {
|
|
||||||
stage("Build package") {
|
|
||||||
steps {
|
|
||||||
sh '''
|
|
||||||
R CMD build .
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Check') {
|
|
||||||
steps {
|
|
||||||
sh '''
|
|
||||||
R CMD check --no-manual civilytics_0.2.0.tar.gz
|
|
||||||
'''
|
|
||||||
|
|
||||||
sh '''
|
|
||||||
R CMD INSTALL civilytics_0.2.0.tar.gz
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('testthat'){
|
|
||||||
steps {
|
|
||||||
sh '''
|
|
||||||
R -e 'testthat::test_local(".")'
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('test coverage') {
|
|
||||||
steps {
|
|
||||||
sh '''
|
|
||||||
R -e 'covr::package_coverage(".")'
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Clean') {
|
|
||||||
steps {
|
|
||||||
|
|
||||||
sh '''
|
|
||||||
rm -rf civilytics_0.2.0.tar.gz civilytics.Rcheck
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,15 @@
|
|||||||
# Generated by roxygen2: do not edit by hand
|
# Generated by roxygen2: do not edit by hand
|
||||||
|
|
||||||
|
export(beep)
|
||||||
export(add_logo)
|
export(add_logo)
|
||||||
export(add_logo_ga)
|
export(add_logo_ga)
|
||||||
|
export(agresti_coull_interval)
|
||||||
|
export(civilytics_colors)
|
||||||
|
export(civilytics_load_fonts)
|
||||||
|
export(civilytics_logo)
|
||||||
|
export(civilytics_pal)
|
||||||
|
export(civilytics_palette)
|
||||||
|
export(civilytics_palettes)
|
||||||
export(clopper_pearson)
|
export(clopper_pearson)
|
||||||
export(countCleanr)
|
export(countCleanr)
|
||||||
export(countDots)
|
export(countDots)
|
||||||
@@ -31,19 +39,37 @@ export(rnh)
|
|||||||
export(round_to_nearest_half)
|
export(round_to_nearest_half)
|
||||||
export(safe_max)
|
export(safe_max)
|
||||||
export(safe_ratio)
|
export(safe_ratio)
|
||||||
|
export(save_branded_flextable_png)
|
||||||
|
export(scale_color_civilytics)
|
||||||
|
export(scale_fill_civilytics)
|
||||||
export(simpleCap)
|
export(simpleCap)
|
||||||
|
export(stamp_logo_png)
|
||||||
export(star_subs)
|
export(star_subs)
|
||||||
|
export(style_flextable_civilytics)
|
||||||
export(theme_civilytics)
|
export(theme_civilytics)
|
||||||
|
export(theme_civilytics_dark)
|
||||||
|
export(theme_civilytics_dark_map)
|
||||||
|
export(theme_civilytics_map)
|
||||||
|
export(theme_civilytics_slide)
|
||||||
|
export(theme_civilytics_slide_map)
|
||||||
export(trim_max)
|
export(trim_max)
|
||||||
|
export(use_civilytics_brand)
|
||||||
|
export(use_civilytics_revealjs)
|
||||||
|
export(use_civilytics_theme)
|
||||||
export(waldInterval)
|
export(waldInterval)
|
||||||
export(z_gap_test)
|
export(z_gap_test)
|
||||||
export(z_univariate)
|
export(z_univariate)
|
||||||
import(ggplot2)
|
import(ggplot2)
|
||||||
import(tidycensus)
|
importFrom(ggplot2,annotation_custom)
|
||||||
|
importFrom(ggplot2,ggplot)
|
||||||
importFrom(ggplot2,theme)
|
importFrom(ggplot2,theme)
|
||||||
importFrom(graphics,plot)
|
importFrom(ggplot2,theme_void)
|
||||||
|
importFrom(grDevices,dev.off)
|
||||||
|
importFrom(grDevices,png)
|
||||||
importFrom(graphics,rasterImage)
|
importFrom(graphics,rasterImage)
|
||||||
importFrom(grid,grid.draw)
|
importFrom(grid,grid.draw)
|
||||||
|
importFrom(grid,grid.newpage)
|
||||||
|
importFrom(grid,grid.raster)
|
||||||
importFrom(grid,rasterGrob)
|
importFrom(grid,rasterGrob)
|
||||||
importFrom(gridExtra,arrangeGrob)
|
importFrom(gridExtra,arrangeGrob)
|
||||||
importFrom(jpeg,readJPEG)
|
importFrom(jpeg,readJPEG)
|
||||||
@@ -53,3 +79,4 @@ importFrom(stats,qnorm)
|
|||||||
importFrom(stats,runif)
|
importFrom(stats,runif)
|
||||||
importFrom(stringdist,stringsim)
|
importFrom(stringdist,stringsim)
|
||||||
importFrom(stringr,str_count)
|
importFrom(stringr,str_count)
|
||||||
|
importFrom(utils,flush.console)
|
||||||
@@ -1,10 +1,40 @@
|
|||||||
#' @keywords internal
|
#' @description
|
||||||
#' @importFrom stats qbeta
|
#' Provides a complete ggplot2 brand theme system for Civilytics Consulting,
|
||||||
#' @importFrom stats qnorm
|
#' including editorial light, dark, and slide-optimized themes; 10 curated
|
||||||
"_PACKAGE"
|
#' color palettes; logo composition; and data-wrangling helpers for
|
||||||
|
#' public-sector analysis.
|
||||||
## usethis namespace: start
|
#'
|
||||||
## usethis namespace: end
|
#' @section Themes:
|
||||||
NULL
|
#' \itemize{
|
||||||
|
#' \item [theme_civilytics()] -- editorial theme with warm paper background
|
||||||
|
#' \item [theme_civilytics_dark()] -- navy background variant
|
||||||
|
#' \item [theme_civilytics_slide()] -- transparent background, larger text
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' @section Color palettes:
|
||||||
|
#' \itemize{
|
||||||
|
#' \item [civilytics_colors] -- 53 named brand colors
|
||||||
|
#' \item [civilytics_palettes] -- 10 visualization palettes
|
||||||
|
#' \item [civilytics_palette()] -- extract colors by palette name
|
||||||
|
#' \item [scale_color_civilytics()] / [scale_fill_civilytics()] -- ggplot2 scales
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' @section Quarto templates:
|
||||||
|
#' \itemize{
|
||||||
|
#' \item [use_civilytics_revealjs()] -- install Reveal.js slide extension
|
||||||
|
#' \item [use_civilytics_theme()] -- install HTML/PDF/Typst document theme
|
||||||
|
#' \item [use_civilytics_brand()] -- install brand.yml only (Quarto 1.5+)
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' @keywords internal
|
||||||
|
#' @importFrom stats qbeta
|
||||||
|
#' @importFrom stats qnorm
|
||||||
|
"_PACKAGE"
|
||||||
|
|
||||||
|
## usethis namespace: start
|
||||||
|
## usethis namespace: end
|
||||||
|
NULL
|
||||||
|
|
||||||
|
# state.abb and state.name are lazy data from the datasets package (base R).
|
||||||
|
# They cannot be imported via @importFrom -- suppress the R CMD check NOTE here.
|
||||||
|
utils::globalVariables(c("state.abb", "state.name"))
|
||||||
@@ -0,0 +1,295 @@
|
|||||||
|
#' Civilytics brand colors
|
||||||
|
#'
|
||||||
|
#' A named character vector of all Civilytics brand colors, matching the CSS
|
||||||
|
#' custom properties in the Civilytics design system (`--cv-*` variables).
|
||||||
|
#' Includes full ramps for navy, ember, and violet, plus supporting hues
|
||||||
|
#' (teal, plum, moss, brass) and semantic status colors.
|
||||||
|
#'
|
||||||
|
#' @format A named character vector of hex color codes.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' civilytics_colors["ink"]
|
||||||
|
#' civilytics_colors[c("navy_600", "ember_600", "teal_600")]
|
||||||
|
civilytics_colors <- c(
|
||||||
|
# Neutrals — warm paper -> civic ink
|
||||||
|
paper = "#FAF7F2",
|
||||||
|
paper_2 = "#F2EDE4",
|
||||||
|
paper_3 = "#E6DFD1",
|
||||||
|
rule = "#D6CEBD",
|
||||||
|
rule_strong = "#B8AE97",
|
||||||
|
ink = "#0E1A2B",
|
||||||
|
ink_2 = "#2B3A52",
|
||||||
|
ink_3 = "#5A6A82",
|
||||||
|
ink_4 = "#8C97AB",
|
||||||
|
|
||||||
|
# Navy — civic authority (primary brand blue)
|
||||||
|
navy_900 = "#0E1A2B", navy_800 = "#132339", navy_700 = "#1A2E4A",
|
||||||
|
navy_600 = "#22406A", navy_500 = "#2E5590", navy_400 = "#4A74B0",
|
||||||
|
navy_300 = "#7A9BCA", navy_200 = "#B3C6E0", navy_100 = "#DDE6F2",
|
||||||
|
navy_50 = "#EEF3FA",
|
||||||
|
|
||||||
|
# Ember — warm orange accent
|
||||||
|
ember_900 = "#451A00", ember_800 = "#6B2B00", ember_700 = "#923D00",
|
||||||
|
ember_600 = "#C25311", ember_500 = "#DB6C25", ember_400 = "#EA8A49",
|
||||||
|
ember_300 = "#F2A976", ember_200 = "#F8C8A3", ember_100 = "#FBE0C6",
|
||||||
|
ember_50 = "#FDF1E4",
|
||||||
|
|
||||||
|
# Violet — extended supporting
|
||||||
|
|
||||||
|
violet_900 = "#19102E", violet_800 = "#2A1B4D", violet_700 = "#3D2A6B",
|
||||||
|
violet_600 = "#5C3A8A", violet_500 = "#7556A8", violet_400 = "#9A7EC2",
|
||||||
|
violet_300 = "#BDA8DA", violet_200 = "#DCD0EC", violet_100 = "#F1ECF8",
|
||||||
|
|
||||||
|
# Supporting — muted editorial hues for data viz
|
||||||
|
teal_600 = "#1F6F70", teal_300 = "#7CB3B3", teal_100 = "#D3E6E6",
|
||||||
|
plum_600 = "#6B3A5E", plum_300 = "#B392A7", plum_100 = "#E7DAE1",
|
||||||
|
moss_600 = "#4A6B2F", moss_300 = "#9CB47D", moss_100 = "#DEE8CF",
|
||||||
|
brass_600 = "#B8751C", brass_100 = "#F9E6C8",
|
||||||
|
|
||||||
|
# Semantic status colors
|
||||||
|
success = "#4A6B2F",
|
||||||
|
warning = "#9A5F18",
|
||||||
|
|
||||||
|
danger = "#A6271D",
|
||||||
|
info = "#2E5590"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#' Civilytics visualization palettes
|
||||||
|
#'
|
||||||
|
#' Named list of curated color palettes for data visualization. Qualitative
|
||||||
|
#' palettes use distinct hues for categorical data; sequential palettes ramp
|
||||||
|
#' through a single hue for ordered data; diverging palettes fan out from a
|
||||||
|
#' neutral midpoint.
|
||||||
|
#'
|
||||||
|
#' @format A named list of character vectors of hex color codes.
|
||||||
|
#'
|
||||||
|
#' @section Qualitative (categorical data):
|
||||||
|
#' \describe{
|
||||||
|
#' \item{`qual`}{7 distinct hues: navy, ember, plum, violet, red, teal, ink-3}
|
||||||
|
#' \item{`qual_warm`}{Warm-leaning: ember, red, magenta, plum, violet}
|
||||||
|
#' \item{`qual_cool`}{Cool-leaning: navy, violet, plum, teal}
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' @section Sequential (ordered/continuous data):
|
||||||
|
#' \describe{
|
||||||
|
#' \item{`seq_ember`}{Light to dark ember (9 stops)}
|
||||||
|
#' \item{`seq_navy`}{Light to dark navy (9 stops)}
|
||||||
|
#' \item{`seq_violet`}{Light to dark violet (9 stops)}
|
||||||
|
#' \item{`seq_paper_ink`}{Paper through ember/plum to ink (8 stops, good for heatmaps)}
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' @section Diverging (data with a meaningful midpoint):
|
||||||
|
#' \describe{
|
||||||
|
#' \item{`div_navy_ember`}{Navy <-> paper <-> ember (9 stops)}
|
||||||
|
#' \item{`div_violet_ember`}{Violet <-> paper <-> ember (9 stops)}
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' names(civilytics_palettes)
|
||||||
|
#' civilytics_palettes[["qual"]]
|
||||||
|
civilytics_palettes <- list(
|
||||||
|
# -- Qualitative --
|
||||||
|
qual = c(
|
||||||
|
"#22406A",
|
||||||
|
"#C25311",
|
||||||
|
"#6B3A5E",
|
||||||
|
"#3D2A6B",
|
||||||
|
"#A6271D",
|
||||||
|
"#1F6F70",
|
||||||
|
"#5A6A82"
|
||||||
|
),
|
||||||
|
qual_warm = c(
|
||||||
|
"#C25311",
|
||||||
|
"#A6271D",
|
||||||
|
"#923D00",
|
||||||
|
"#B8366B",
|
||||||
|
"#6B3A5E",
|
||||||
|
"#DB6C25",
|
||||||
|
"#3D2A6B"
|
||||||
|
),
|
||||||
|
qual_cool = c(
|
||||||
|
"#22406A",
|
||||||
|
"#3D2A6B",
|
||||||
|
"#6B3A5E",
|
||||||
|
"#1F6F70",
|
||||||
|
"#2E5590",
|
||||||
|
"#7556A8",
|
||||||
|
"#5A6A82"
|
||||||
|
),
|
||||||
|
# -- Sequential --
|
||||||
|
seq_ember = c(
|
||||||
|
"#FDF1E4", "#FBE0C6", "#F8C8A3", "#F2A976",
|
||||||
|
"#EA8A49", "#DB6C25", "#C25311", "#923D00", "#451A00"
|
||||||
|
),
|
||||||
|
seq_navy = c(
|
||||||
|
"#EEF3FA", "#DDE6F2", "#B3C6E0", "#7A9BCA",
|
||||||
|
"#4A74B0", "#2E5590", "#22406A", "#1A2E4A", "#0E1A2B"
|
||||||
|
),
|
||||||
|
seq_violet = c(
|
||||||
|
"#F1ECF8", "#DCD0EC", "#BDA8DA", "#9A7EC2",
|
||||||
|
"#7556A8", "#5C3A8A", "#3D2A6B", "#2A1B4D", "#19102E"
|
||||||
|
),
|
||||||
|
seq_paper_ink = c(
|
||||||
|
"#FAF7F2", "#F8C8A3", "#EA8A49", "#C25311",
|
||||||
|
"#A6271D", "#6B3A5E", "#3D2A6B", "#0E1A2B"
|
||||||
|
),
|
||||||
|
# -- Diverging --
|
||||||
|
div_navy_ember = c(
|
||||||
|
"#0E1A2B", "#22406A", "#4A74B0", "#B3C6E0",
|
||||||
|
"#FAF7F2",
|
||||||
|
"#F8C8A3", "#EA8A49", "#C25311", "#6B2B00"
|
||||||
|
),
|
||||||
|
div_violet_ember = c(
|
||||||
|
"#19102E", "#3D2A6B", "#7556A8", "#BDA8DA",
|
||||||
|
"#FAF7F2",
|
||||||
|
"#F8C8A3", "#EA8A49", "#C25311", "#6B2B00"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#' Get colors from a Civilytics palette
|
||||||
|
#'
|
||||||
|
#' Returns a character vector of hex codes from a named Civilytics palette.
|
||||||
|
#' For qualitative palettes, colors beyond the palette length recycle with a
|
||||||
|
#' warning. For sequential and diverging palettes, colors are interpolated
|
||||||
|
#' via [grDevices::colorRampPalette()].
|
||||||
|
#'
|
||||||
|
#' @param name Character. Palette name. See `names(civilytics_palettes)`.
|
||||||
|
#' @param n Integer or `NULL`. Number of colors to return. If `NULL`, returns
|
||||||
|
#' all defined stops.
|
||||||
|
#' @param reverse Logical. Reverse the palette order. Default `FALSE`.
|
||||||
|
#'
|
||||||
|
#' @return A character vector of hex color codes.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' civilytics_palette() # all 7 qualitative colors
|
||||||
|
#' civilytics_palette("seq_navy", n = 5) # 5-stop navy ramp
|
||||||
|
#' civilytics_palette("div_navy_ember", n = 11, reverse = TRUE)
|
||||||
|
civilytics_palette <- function(name = "qual", n = NULL, reverse = FALSE) {
|
||||||
|
pal <- civilytics_palettes[[name]]
|
||||||
|
if (is.null(pal)) {
|
||||||
|
stop(
|
||||||
|
"'", name, "' is not a valid palette. Choose from: ",
|
||||||
|
paste(names(civilytics_palettes), collapse = ", "),
|
||||||
|
call. = FALSE
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (reverse) pal <- rev(pal)
|
||||||
|
if (is.null(n)) return(pal)
|
||||||
|
if (startsWith(name, "qual")) {
|
||||||
|
if (n > length(pal)) {
|
||||||
|
warning(
|
||||||
|
"Requested ", n, " colors from '", name, "' palette (max ",
|
||||||
|
length(pal), "); recycling.",
|
||||||
|
call. = FALSE
|
||||||
|
)
|
||||||
|
pal <- rep_len(pal, n)
|
||||||
|
}
|
||||||
|
return(pal[seq_len(n)])
|
||||||
|
}
|
||||||
|
grDevices::colorRampPalette(pal)(n)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Civilytics palette function (closure)
|
||||||
|
#'
|
||||||
|
#' Returns a closure `function(n)` suitable for passing to
|
||||||
|
#' [ggplot2::discrete_scale()] or similar scale constructors.
|
||||||
|
#'
|
||||||
|
#' @param name Character. Palette name. See `names(civilytics_palettes)`.
|
||||||
|
#' @param reverse Logical. Reverse the palette order. Default `FALSE`.
|
||||||
|
#'
|
||||||
|
#' @return A function that takes integer `n` and returns `n` hex color codes.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' pal_fn <- civilytics_pal("qual")
|
||||||
|
#' pal_fn(4)
|
||||||
|
civilytics_pal <- function(name = "qual", reverse = FALSE) {
|
||||||
|
function(n) civilytics_palette(name, n = n, reverse = reverse)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Civilytics color scale for ggplot2
|
||||||
|
#'
|
||||||
|
#' Applies a Civilytics brand palette to the `colour` aesthetic.
|
||||||
|
#'
|
||||||
|
#' @param palette Character. Palette name. Defaults to `"qual"`.
|
||||||
|
#' @param discrete Logical. `TRUE` (default) for categorical data; `FALSE`
|
||||||
|
#' for a continuous gradient via [ggplot2::scale_color_gradientn()].
|
||||||
|
#' @param reverse Logical. Reverse the palette order. Default `FALSE`.
|
||||||
|
#' @param ... Additional arguments passed to the ggplot2 scale function.
|
||||||
|
#'
|
||||||
|
#' @return A ggplot2 scale object.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' library(ggplot2)
|
||||||
|
#' ggplot(mpg, aes(displ, hwy, colour = class)) +
|
||||||
|
#' geom_point() +
|
||||||
|
#' scale_color_civilytics()
|
||||||
|
#'
|
||||||
|
#' ggplot(mpg, aes(displ, hwy, colour = cty)) +
|
||||||
|
#' geom_point() +
|
||||||
|
#' scale_color_civilytics("seq_navy", discrete = FALSE)
|
||||||
|
scale_color_civilytics <- function(palette = "qual", discrete = TRUE,
|
||||||
|
reverse = FALSE, ...) {
|
||||||
|
if (discrete) {
|
||||||
|
ggplot2::discrete_scale(
|
||||||
|
"colour",
|
||||||
|
palette = civilytics_pal(palette, reverse = reverse),
|
||||||
|
...
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
pal <- civilytics_palette(palette, reverse = reverse)
|
||||||
|
ggplot2::scale_color_gradientn(
|
||||||
|
colours = grDevices::colorRampPalette(pal)(256),
|
||||||
|
...
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Civilytics fill scale for ggplot2
|
||||||
|
#'
|
||||||
|
#' Applies a Civilytics brand palette to the `fill` aesthetic.
|
||||||
|
#'
|
||||||
|
#' @param palette Character. Palette name. Defaults to `"qual"`.
|
||||||
|
#' @param discrete Logical. `TRUE` (default) for categorical data; `FALSE`
|
||||||
|
#' for a continuous gradient via [ggplot2::scale_fill_gradientn()].
|
||||||
|
#' @param reverse Logical. Reverse the palette order. Default `FALSE`.
|
||||||
|
#' @param ... Additional arguments passed to the ggplot2 scale function.
|
||||||
|
#'
|
||||||
|
#' @return A ggplot2 scale object.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' library(ggplot2)
|
||||||
|
#' ggplot(mpg, aes(class, fill = class)) +
|
||||||
|
#' geom_bar() +
|
||||||
|
#' scale_fill_civilytics()
|
||||||
|
#'
|
||||||
|
#' ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
|
||||||
|
#' geom_tile() +
|
||||||
|
#' scale_fill_civilytics("seq_ember", discrete = FALSE)
|
||||||
|
scale_fill_civilytics <- function(palette = "qual", discrete = TRUE,
|
||||||
|
reverse = FALSE, ...) {
|
||||||
|
if (discrete) {
|
||||||
|
ggplot2::discrete_scale(
|
||||||
|
"fill",
|
||||||
|
palette = civilytics_pal(palette, reverse = reverse),
|
||||||
|
...
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
pal <- civilytics_palette(palette, reverse = reverse)
|
||||||
|
ggplot2::scale_fill_gradientn(
|
||||||
|
colours = grDevices::colorRampPalette(pal)(256),
|
||||||
|
...
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
#' Apply the Civilytics brand styling to a flextable
|
||||||
|
#'
|
||||||
|
#' Applies *only* the visual Civilytics brand to an already-structured
|
||||||
|
#' [flextable::flextable()] — header fill and color, body font and size,
|
||||||
|
#' zebra striping, borders, footer styling, and a fixed table layout. The
|
||||||
|
#' caller remains responsible for table *structure*: labels
|
||||||
|
#' ([flextable::set_header_labels()]), header/title lines
|
||||||
|
#' ([flextable::add_header_lines()]), column widths ([flextable::width()]),
|
||||||
|
#' alignment ([flextable::align()]), and footer text
|
||||||
|
#' ([flextable::add_footer_lines()]). This separation keeps styling reusable
|
||||||
|
#' across projects while leaving content decisions where they belong.
|
||||||
|
#'
|
||||||
|
#' `flextable`, `officer`, and `ragg` are Suggested (not Imported) to keep the
|
||||||
|
#' base install light, so this function errors with an install hint if
|
||||||
|
#' `flextable` is unavailable.
|
||||||
|
#'
|
||||||
|
#' @param ft A [flextable::flextable()] object.
|
||||||
|
#' @param header_bg Character. Header background fill. Default `"#2c3e50"`.
|
||||||
|
#' @param header_color Character. Header text color. Default `"white"`.
|
||||||
|
#' @param title_fontsize Numeric. Font size for the first header line (the
|
||||||
|
#' title row, `i = 1`). Default `14`.
|
||||||
|
#' @param body_fontsize Numeric. Body font size. Default `11`.
|
||||||
|
#' @param font_name Character. Font family applied to all parts. Default
|
||||||
|
#' `"Arial"`.
|
||||||
|
#' @param zebra Logical. Apply alternating-row striping to even body rows.
|
||||||
|
#' Default `TRUE`. Safely skipped for tables with fewer than two body rows.
|
||||||
|
#' @param zebra_bg Character. Fill color for striped (even) body rows.
|
||||||
|
#' Default `"#f0f0eb"`.
|
||||||
|
#' @param outer_border_color Character. Outer border color. Default
|
||||||
|
#' `"#888888"`.
|
||||||
|
#' @param outer_border_width Numeric. Outer border width. Default `1`.
|
||||||
|
#' @param inner_border_color Character. Inner horizontal border color (body).
|
||||||
|
#' Default `"#cccccc"`.
|
||||||
|
#' @param inner_border_width Numeric. Inner horizontal border width. Default
|
||||||
|
#' `0.5`.
|
||||||
|
#' @param footer_fontsize Numeric. Footer font size (applied only if a footer
|
||||||
|
#' part exists). Default `9`.
|
||||||
|
#' @param footer_color Character. Footer text color. Default `"#555555"`.
|
||||||
|
#'
|
||||||
|
#' @return The styled [flextable::flextable()] object.
|
||||||
|
#' @export
|
||||||
|
#' @seealso [save_branded_flextable_png()] to export the styled table to a
|
||||||
|
#' logo-stamped PNG.
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' library(flextable)
|
||||||
|
#' ft <- flextable(head(mtcars)) |>
|
||||||
|
#' add_header_lines("Motor Trend Cars") |>
|
||||||
|
#' add_footer_lines("Source: mtcars") |>
|
||||||
|
#' style_flextable_civilytics()
|
||||||
|
#' }
|
||||||
|
style_flextable_civilytics <- function(ft,
|
||||||
|
header_bg = "#2c3e50",
|
||||||
|
header_color = "white",
|
||||||
|
title_fontsize = 14,
|
||||||
|
body_fontsize = 11,
|
||||||
|
font_name = "Arial",
|
||||||
|
zebra = TRUE,
|
||||||
|
zebra_bg = "#f0f0eb",
|
||||||
|
outer_border_color = "#888888",
|
||||||
|
outer_border_width = 1,
|
||||||
|
inner_border_color = "#cccccc",
|
||||||
|
inner_border_width = 0.5,
|
||||||
|
footer_fontsize = 9,
|
||||||
|
footer_color = "#555555") {
|
||||||
|
if (!requireNamespace("flextable", quietly = TRUE)) {
|
||||||
|
stop("Install 'flextable' to use this function.", call. = FALSE)
|
||||||
|
}
|
||||||
|
if (!requireNamespace("officer", quietly = TRUE)) {
|
||||||
|
stop("Install 'officer' to use this function.", call. = FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Header: navy fill, white bold text, larger title line.
|
||||||
|
ft <- flextable::bg(ft, bg = header_bg, part = "header")
|
||||||
|
ft <- flextable::color(ft, color = header_color, part = "header")
|
||||||
|
ft <- flextable::bold(ft, part = "header")
|
||||||
|
ft <- flextable::fontsize(ft, i = 1, size = title_fontsize, part = "header")
|
||||||
|
|
||||||
|
# Body: readable size, brand font across all parts.
|
||||||
|
ft <- flextable::fontsize(ft, size = body_fontsize, part = "body")
|
||||||
|
ft <- flextable::font(ft, fontname = font_name, part = "all")
|
||||||
|
|
||||||
|
# Zebra striping on even body rows, guarded for tables with < 2 rows.
|
||||||
|
nrow_body <- flextable::nrow_part(ft, part = "body")
|
||||||
|
if (zebra && nrow_body >= 2) {
|
||||||
|
ft <- flextable::bg(ft, i = seq(2, nrow_body, 2), bg = zebra_bg,
|
||||||
|
part = "body")
|
||||||
|
}
|
||||||
|
|
||||||
|
# Borders: outer frame on all parts, light horizontal rules in the body.
|
||||||
|
ft <- flextable::border_outer(
|
||||||
|
ft,
|
||||||
|
border = officer::fp_border(color = outer_border_color,
|
||||||
|
width = outer_border_width),
|
||||||
|
part = "all"
|
||||||
|
)
|
||||||
|
ft <- flextable::border_inner_h(
|
||||||
|
ft,
|
||||||
|
border = officer::fp_border(color = inner_border_color,
|
||||||
|
width = inner_border_width),
|
||||||
|
part = "body"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Footer styling — only if the table actually has a footer part.
|
||||||
|
if (flextable::nrow_part(ft, part = "footer") > 0) {
|
||||||
|
ft <- flextable::fontsize(ft, size = footer_fontsize, part = "footer")
|
||||||
|
ft <- flextable::color(ft, color = footer_color, part = "footer")
|
||||||
|
}
|
||||||
|
|
||||||
|
flextable::set_table_properties(ft, layout = "fixed")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Save a branded flextable to a logo-stamped PNG
|
||||||
|
#'
|
||||||
|
#' Exports a styled [flextable::flextable()] to a PNG via
|
||||||
|
#' [ragg::agg_png()] (sized to the table's own dimensions plus a little
|
||||||
|
#' headroom for the logo), then optionally stamps the Civilytics logo onto the
|
||||||
|
#' file with [stamp_logo_png()] so file-based tables stay visually consistent
|
||||||
|
#' with [civilytics_logo()]-branded plots.
|
||||||
|
#'
|
||||||
|
#' `ragg` and `flextable` are Suggested (not Imported); this function errors
|
||||||
|
#' with an install hint if either is unavailable.
|
||||||
|
#'
|
||||||
|
#' @param ft A [flextable::flextable()] object, typically already styled with
|
||||||
|
#' [style_flextable_civilytics()].
|
||||||
|
#' @param path Character. Output PNG path. Returned invisibly.
|
||||||
|
#' @param logo Logical. Stamp the Civilytics logo onto the saved PNG via
|
||||||
|
#' [stamp_logo_png()]. Default `TRUE`.
|
||||||
|
#' @param res Numeric. Output resolution in PPI passed to [ragg::agg_png()].
|
||||||
|
#' Default `300`.
|
||||||
|
#' @param extra_height Numeric. Additional height in inches added to the
|
||||||
|
#' table's natural height to leave room for the stamped logo. Default `0.4`.
|
||||||
|
#' @param ... Additional arguments forwarded to [stamp_logo_png()] (e.g.
|
||||||
|
#' `type`, `variant`, `position`, `width_frac`, `margin_frac`).
|
||||||
|
#'
|
||||||
|
#' @return `path`, invisibly.
|
||||||
|
#' @export
|
||||||
|
#' @seealso [style_flextable_civilytics()] to apply the brand styling, and
|
||||||
|
#' [stamp_logo_png()] for the underlying logo compositing.
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' library(flextable)
|
||||||
|
#' ft <- flextable(head(mtcars)) |>
|
||||||
|
#' add_footer_lines("Source: mtcars") |>
|
||||||
|
#' style_flextable_civilytics()
|
||||||
|
#' save_branded_flextable_png(ft, "table.png")
|
||||||
|
#' save_branded_flextable_png(ft, "table.png", position = "bottom-left")
|
||||||
|
#' knitr::include_graphics("table.png")
|
||||||
|
#' }
|
||||||
|
save_branded_flextable_png <- function(ft, path, logo = TRUE, res = 300,
|
||||||
|
extra_height = 0.4, ...) {
|
||||||
|
if (!requireNamespace("flextable", quietly = TRUE)) {
|
||||||
|
stop("Install 'flextable' to use this function.", call. = FALSE)
|
||||||
|
}
|
||||||
|
if (!requireNamespace("ragg", quietly = TRUE)) {
|
||||||
|
stop("Install 'ragg' to use this function.", call. = FALSE)
|
||||||
|
}
|
||||||
|
|
||||||
|
d <- flextable::flextable_dim(ft)
|
||||||
|
ragg::agg_png(path, width = d$width, height = d$height + extra_height,
|
||||||
|
units = "in", res = res)
|
||||||
|
on.exit(grDevices::dev.off(), add = TRUE)
|
||||||
|
plot(ft)
|
||||||
|
|
||||||
|
if (logo) {
|
||||||
|
# dev.off() must run before stamp_logo_png() re-reads the file. Flush the
|
||||||
|
# device now and clear the on.exit handler so it does not fire twice.
|
||||||
|
grDevices::dev.off()
|
||||||
|
on.exit()
|
||||||
|
stamp_logo_png(path, ...)
|
||||||
|
}
|
||||||
|
|
||||||
|
invisible(path)
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# Font family name constants used as defaults in theme functions.
|
||||||
|
# These match the --cv-font-* CSS custom properties on www.civilytics.com.
|
||||||
|
CV_FONT_DISPLAY <- "Libre Franklin" # headings / display text
|
||||||
|
CV_FONT_SANS <- "Inter" # axis text, legends, UI elements
|
||||||
|
CV_FONT_SERIF <- "Source Serif 4" # body prose / editorial long-form
|
||||||
|
CV_FONT_MONO <- "JetBrains Mono" # code, data tables, numeric callouts
|
||||||
|
|
||||||
|
# Mutable package state held in an environment so the binding itself stays
|
||||||
|
# locked (R locks all namespace bindings at load time) while the contents
|
||||||
|
# remain writable. See https://adv-r.hadley.nz/environments.html#environments-as-containers
|
||||||
|
.cv_state <- new.env(parent = emptyenv())
|
||||||
|
.cv_state$fonts_loaded <- FALSE
|
||||||
|
|
||||||
|
#' Load Civilytics brand fonts
|
||||||
|
#'
|
||||||
|
#' Downloads Inter, Libre Franklin, Source Serif 4 and JetBrains Mono from
|
||||||
|
#' Google Fonts via [sysfonts::font_add_google()], then calls
|
||||||
|
#' [showtext::showtext_auto()] so that all graphics devices render text with
|
||||||
|
#' those fonts. This is called automatically when the package loads; use this
|
||||||
|
#' 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 `force = TRUE`.
|
||||||
|
#'
|
||||||
|
#' @param force Logical. If `TRUE`, reload fonts even if they were already
|
||||||
|
#' loaded in this session. Default `FALSE`.
|
||||||
|
#'
|
||||||
|
#' @return Invisibly returns `TRUE` if fonts were loaded, `FALSE` if skipped
|
||||||
|
#' (already loaded and `force = FALSE`).
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' civilytics_load_fonts()
|
||||||
|
#' }
|
||||||
|
civilytics_load_fonts <- function(force = FALSE) {
|
||||||
|
if (.cv_state$fonts_loaded && !force) return(invisible(FALSE))
|
||||||
|
|
||||||
|
sysfonts::font_add_google("Inter", family = "Inter")
|
||||||
|
sysfonts::font_add_google("Libre Franklin", family = "Libre Franklin")
|
||||||
|
sysfonts::font_add_google("Source Serif 4", family = "Source Serif 4")
|
||||||
|
sysfonts::font_add_google("JetBrains Mono", family = "JetBrains Mono")
|
||||||
|
showtext::showtext_auto()
|
||||||
|
|
||||||
|
.cv_state$fonts_loaded <- TRUE
|
||||||
|
invisible(TRUE)
|
||||||
|
}
|
||||||
|
|
||||||
|
.onLoad <- function(libname, pkgname) {
|
||||||
|
tryCatch(
|
||||||
|
civilytics_load_fonts(),
|
||||||
|
error = function(e) {
|
||||||
|
# Store the failure so .onAttach can surface a message to the user.
|
||||||
|
options(.civilytics_fonts_failed = TRUE)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
.onAttach <- function(libname, pkgname) {
|
||||||
|
if (isTRUE(getOption(".civilytics_fonts_failed"))) {
|
||||||
|
packageStartupMessage(
|
||||||
|
"[civilytics] Brand fonts (Inter, Libre Franklin, Source Serif 4, ",
|
||||||
|
"JetBrains Mono) could not be loaded from Google Fonts. ",
|
||||||
|
"Charts will fall back to system fonts. ",
|
||||||
|
"Call civilytics_load_fonts() once you have an internet connection."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,11 +9,13 @@
|
|||||||
#' @importFrom jpeg readJPEG
|
#' @importFrom jpeg readJPEG
|
||||||
#' @importFrom graphics rasterImage
|
#' @importFrom graphics rasterImage
|
||||||
#' @examples
|
#' @examples
|
||||||
#' img <- system.file("img","civilytics_logo.jpg",package="civilytics")
|
#' \dontrun{
|
||||||
|
#' img <- system.file("img","Knowles_Headshot_2019_good.jpg",package="civilytics")
|
||||||
#' plot_jpeg(img)
|
#' plot_jpeg(img)
|
||||||
|
#' }
|
||||||
plot_jpeg <- function(path, add=FALSE, upscale = TRUE)
|
plot_jpeg <- function(path, add=FALSE, upscale = TRUE)
|
||||||
{
|
{
|
||||||
jpg = readJPEG(path, native = T) # read the file
|
jpg = readJPEG(path, native = TRUE) # read the file
|
||||||
res = dim(jpg)[2:1] # get the resolution, [x, y]
|
res = dim(jpg)[2:1] # get the resolution, [x, y]
|
||||||
if (upscale){
|
if (upscale){
|
||||||
res <- res * 3
|
res <- res * 3
|
||||||
@@ -44,29 +46,73 @@ get_png <- function(filename) {
|
|||||||
#' @param plot a ggplot2 grob
|
#' @param plot a ggplot2 grob
|
||||||
#' @param logo a logo grob created by make_logo_grob()
|
#' @param logo a logo grob created by make_logo_grob()
|
||||||
#' @param margin_param a numeric specifying what margin to add or subtract to align the logo
|
#' @param margin_param a numeric specifying what margin to add or subtract to align the logo
|
||||||
|
#' @param font_scale Numeric. Multiplicative scaling factor applied to text
|
||||||
|
#' sizes before composing the plot with the logo. Default `1.1` inflates
|
||||||
|
#' text by ~10 \% to compensate for the viewport shrinkage caused by
|
||||||
|
#' [gridExtra::arrangeGrob()]. Set to `1` to disable.
|
||||||
|
#' @param position Character. Corner placement for the logo: `"bottom-right"`
|
||||||
|
#' (default), `"bottom-left"`, `"top-right"`, or `"top-left"`. Controls
|
||||||
|
#' whether the logo is placed above or below the plot.
|
||||||
#'
|
#'
|
||||||
#' @return a grob with a logo attached to it ready to plot
|
#' @return a grob with a logo attached to it ready to plot
|
||||||
#' @importFrom ggplot2 theme
|
#' @importFrom ggplot2 theme
|
||||||
#' @importFrom gridExtra arrangeGrob
|
#' @importFrom gridExtra arrangeGrob
|
||||||
#' @export
|
#' @export
|
||||||
add_logo <- function(plot, logo, margin_param = NULL) {
|
add_logo <- function(plot, logo, margin_param = NULL, font_scale = 1.1,
|
||||||
if(has_caption(plot)) {
|
position = c("bottom-right", "bottom-left",
|
||||||
# convert the caption size to a negative number and on the "pt" scale
|
"top-right", "top-left")) {
|
||||||
# p1$theme$plot.caption$size * 1.1
|
position <- match.arg(position)
|
||||||
# Count the number of lines, which is this + 1
|
at_top <- grepl("top", position)
|
||||||
# For each line, we can add a certain negative space to align the logo
|
|
||||||
cap_lines <- measure_caption(plot)
|
# Capture the plot's background color so we can fill the entire composed
|
||||||
if (!is.null(margin_param)) {
|
# grob with it. The logo grob must stay transparent (theme_void) so that
|
||||||
plot <- plot + theme(plot.margin = unit(c(7, 7, margin_param, 7), "pt"))
|
# caption/axis text overlapping via negative margins remains visible.
|
||||||
} else {
|
bg_fill <- plot$theme$plot.background$fill
|
||||||
plot <- plot + theme(plot.margin = unit(c(7, 7, cap_lines * -52, 7), "pt"))
|
|
||||||
}
|
# Inflate text sizes to compensate for arrangeGrob viewport shrinkage.
|
||||||
} else {
|
# All theme text elements use rel() sizing, so scaling the root 'text'
|
||||||
plot <- plot + theme(plot.margin = unit(c(7, 7, -14, 7), "pt"))
|
# element cascades to titles, axis labels, legends, captions, and strips.
|
||||||
|
if (!is.null(font_scale) && font_scale != 1) {
|
||||||
|
base_size <- plot$theme$text$size %||% 14
|
||||||
|
plot <- plot + ggplot2::theme(
|
||||||
|
text = ggplot2::element_text(size = base_size * font_scale)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
arrangeGrob(plot, logo, heights = c(0.93, 0.1),
|
if (at_top) {
|
||||||
padding = unit(0.1, "line"))
|
# For top placement, tighten the top margin of the plot
|
||||||
|
if (!is.null(margin_param)) {
|
||||||
|
plot <- plot + theme(plot.margin = unit(c(margin_param, 7, 7, 7), "pt"))
|
||||||
|
} else {
|
||||||
|
plot <- plot + theme(plot.margin = unit(c(-14, 7, 7, 7), "pt"))
|
||||||
|
}
|
||||||
|
composed <- arrangeGrob(logo, plot, heights = c(0.1, 0.93),
|
||||||
|
padding = unit(0.1, "line"))
|
||||||
|
} else {
|
||||||
|
# Bottom placement (original behaviour)
|
||||||
|
if(has_caption(plot)) {
|
||||||
|
cap_lines <- measure_caption(plot)
|
||||||
|
if (!is.null(margin_param)) {
|
||||||
|
plot <- plot + theme(plot.margin = unit(c(7, 7, margin_param, 7), "pt"))
|
||||||
|
} else {
|
||||||
|
plot <- plot + theme(plot.margin = unit(c(7, 7, cap_lines * -52, 7), "pt"))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
plot <- plot + theme(plot.margin = unit(c(7, 7, -14, 7), "pt"))
|
||||||
|
}
|
||||||
|
composed <- arrangeGrob(plot, logo, heights = c(0.93, 0.1),
|
||||||
|
padding = unit(0.1, "line"))
|
||||||
|
}
|
||||||
|
|
||||||
|
# Wrap with a full-bleed background rect so any transparent areas (the
|
||||||
|
# logo strip, padding gaps) pick up the plot's background color instead
|
||||||
|
# of the device default (white).
|
||||||
|
if (!is.null(bg_fill) && !is.na(bg_fill)) {
|
||||||
|
bg_rect <- grid::rectGrob(gp = grid::gpar(fill = bg_fill, col = NA))
|
||||||
|
grid::grobTree(bg_rect, composed)
|
||||||
|
} else {
|
||||||
|
composed
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#' Measure a ggplot2 object caption
|
#' Measure a ggplot2 object caption
|
||||||
@@ -79,8 +125,8 @@ add_logo <- function(plot, logo, margin_param = NULL) {
|
|||||||
#' @export
|
#' @export
|
||||||
#'
|
#'
|
||||||
#' @examples
|
#' @examples
|
||||||
#' p1 <- ggplot2::qplot(mpg, wt, data = mtcars)
|
#' p1 <- ggplot2::ggplot(mtcars, ggplot2::aes(mpg, wt)) + ggplot2::geom_point()
|
||||||
#' measure_caption(p1) # Should equal 1 since no caption is required
|
#' measure_caption(p1) # Should equal 1 since no caption is present
|
||||||
measure_caption <- function(gg) {
|
measure_caption <- function(gg) {
|
||||||
if (has_caption(gg)) {
|
if (has_caption(gg)) {
|
||||||
stringr::str_count(gg$labels$caption, pattern = "\n") + 1
|
stringr::str_count(gg$labels$caption, pattern = "\n") + 1
|
||||||
@@ -99,19 +145,21 @@ measure_caption <- function(gg) {
|
|||||||
#' @export
|
#' @export
|
||||||
#'
|
#'
|
||||||
#' @examples
|
#' @examples
|
||||||
#' p1 <- ggplot2::qplot(mpg, wt, data = mtcars)
|
#' p1 <- ggplot2::ggplot(mtcars, ggplot2::aes(mpg, wt)) + ggplot2::geom_point()
|
||||||
#' has_caption(p1) # FALSE
|
#' has_caption(p1) # FALSE
|
||||||
has_caption <- function(gg) {
|
has_caption <- function(gg) {
|
||||||
any(names(gg$labels) == "caption")
|
any(names(gg$labels) == "caption")
|
||||||
}
|
}
|
||||||
|
|
||||||
#' Add a logo to a ggplot2 object
|
#' Add a logo to multiple ggplot2 objects
|
||||||
#'
|
#'
|
||||||
#' @param plot_list a list containing ggplot2 objects
|
#' @param plot_list a list containing ggplot2 objects
|
||||||
#' @param logo a grob containing the logo created with `make_logo_grob`
|
#' @param logo a grob containing the logo created with `make_logo_grob`
|
||||||
#' @param nrow an integer, default = 1, for the number of rows to align the plots in
|
#' @param nrow an integer, default = 1, for the number of rows to align the plots in
|
||||||
#' @param widths an optional vector the same length as plot_list with the widths for each plot
|
#' @param widths an optional vector the same length as plot_list with the widths for each plot
|
||||||
#' @param margin_param a number giving the adjustment up or down to help manually align logo and captions
|
#' @param margin_param a number giving the adjustment up or down to help manually align logo and captions
|
||||||
|
#' @param font_scale Numeric. Multiplicative scaling factor applied to text
|
||||||
|
#' sizes before composing. Default `1.1`. See [add_logo()] for details.
|
||||||
#'
|
#'
|
||||||
#' @return a grid object
|
#' @return a grid object
|
||||||
#' @note The resulting object needs to be drawn to the screen using grid.draw()
|
#' @note The resulting object needs to be drawn to the screen using grid.draw()
|
||||||
@@ -121,18 +169,34 @@ has_caption <- function(gg) {
|
|||||||
#' @export
|
#' @export
|
||||||
#'
|
#'
|
||||||
#' @examples
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
#' library(ggplot2); library(grid)
|
#' library(ggplot2); library(grid)
|
||||||
#' tmp_plot <- ggplot(mtcars) + aes(x = hp, y = disp) + geom_point() + theme_civilytics()
|
#' tmp_plot <- ggplot(mtcars) + aes(x = hp, y = disp) + geom_point() + theme_civilytics()
|
||||||
#' tmp_logo <- make_logo_grob()
|
#' tmp_logo <- make_logo_grob()
|
||||||
#' plot_and_logo <- add_logo(tmp_plot, tmp_logo)
|
#' plot_and_logo <- add_logo(tmp_plot, tmp_logo)
|
||||||
#' grid.draw(plot_and_logo)
|
#' grid.draw(plot_and_logo)
|
||||||
#' dev.off()
|
#' dev.off()
|
||||||
add_logo_ga <- function(plot_list, logo, nrow = 1, widths = NULL, margin_param = NULL) {
|
#' }
|
||||||
|
add_logo_ga <- function(plot_list, logo, nrow = 1, widths = NULL,
|
||||||
|
margin_param = NULL, font_scale = 1.1) {
|
||||||
|
# Capture the background color from the first plot
|
||||||
|
bg_fill <- plot_list[[1]]$theme$plot.background$fill
|
||||||
|
|
||||||
|
# Inflate text sizes to compensate for viewport shrinkage
|
||||||
|
if (!is.null(font_scale) && font_scale != 1) {
|
||||||
|
plot_list <- lapply(plot_list, function(p) {
|
||||||
|
base_size <- p$theme$text$size %||% 14
|
||||||
|
p + ggplot2::theme(
|
||||||
|
text = ggplot2::element_text(size = base_size * font_scale)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
# Change position of logo depending on if plot has a caption
|
# Change position of logo depending on if plot has a caption
|
||||||
if (!is.null(margin_param)) {
|
if (!is.null(margin_param)) {
|
||||||
margin <- theme(plot.margin = unit(c(7, 7, margin_param, 7), "pt"))
|
margin <- theme(plot.margin = unit(c(7, 7, margin_param, 7), "pt"))
|
||||||
} else if (any(unlist(lapply(plot_list, has_caption)))) {
|
} else if (any(unlist(lapply(plot_list, has_caption)))) {
|
||||||
cap_lines <- measure_caption(plot_list[[1]]) # measure caption in first plot
|
cap_lines <- max(sapply(plot_list, measure_caption))
|
||||||
margin <- theme(plot.margin = unit(c(7, 7, -7 * sqrt(cap_lines), 7), "pt"))
|
margin <- theme(plot.margin = unit(c(7, 7, -7 * sqrt(cap_lines), 7), "pt"))
|
||||||
} else {
|
} else {
|
||||||
margin <- theme(plot.margin = unit(c(7, 7, 7, 7), "pt"))
|
margin <- theme(plot.margin = unit(c(7, 7, 7, 7), "pt"))
|
||||||
@@ -145,29 +209,244 @@ add_logo_ga <- function(plot_list, logo, nrow = 1, widths = NULL, margin_param =
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nrow != 1) {
|
if (nrow != 1) {
|
||||||
hold <- arrangeGrob(grobs = plot_list, nrow = nrow, ncol = 1, widths = widths)
|
if (!is.null(widths)) warning("`widths` is ignored when `nrow > 1`")
|
||||||
|
hold <- arrangeGrob(grobs = plot_list, nrow = nrow, ncol = 1)
|
||||||
} else {
|
} else {
|
||||||
hold <- arrangeGrob(grobs = plot_list, nrow = 1, ncol = 2, widths = widths)
|
hold <- arrangeGrob(grobs = plot_list, nrow = 1, ncol = length(plot_list), widths = widths)
|
||||||
}
|
}
|
||||||
|
|
||||||
arrangeGrob(hold, logo, heights = c(0.93, .07))
|
composed <- arrangeGrob(hold, logo, heights = c(0.93, .07))
|
||||||
|
|
||||||
|
if (!is.null(bg_fill) && !is.na(bg_fill)) {
|
||||||
|
bg_rect <- grid::rectGrob(gp = grid::gpar(fill = bg_fill, col = NA))
|
||||||
|
grid::grobTree(bg_rect, composed)
|
||||||
|
} else {
|
||||||
|
composed
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#' Get a Civilytics Logo grob
|
#' Get a Civilytics Logo grob
|
||||||
#'
|
#'
|
||||||
#' @return a gg object which contains the logo file stored as a Grob suitable for manipulating in
|
#' Returns a ggplot object containing the Civilytics logo as a rasterGrob,
|
||||||
#' grid
|
#' ready to compose with plots via [add_logo()], [add_logo_ga()], or the
|
||||||
|
#' pipe-friendly [civilytics_logo()].
|
||||||
|
#'
|
||||||
|
#' @param type Character. `"wordmark"` (default) uses the full wordmark.
|
||||||
|
#' `"mark"` uses the compact C-pulse icon only.
|
||||||
|
#' @param 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()]).
|
||||||
|
#' @param position Character. Corner placement for the logo: `"bottom-right"`
|
||||||
|
#' (default), `"bottom-left"`, `"top-right"`, or `"top-left"`. Controls
|
||||||
|
#' horizontal alignment of the logo grob.
|
||||||
|
#'
|
||||||
|
#' @return A ggplot object (class `"gg"`) containing the logo grob.
|
||||||
#' @export
|
#' @export
|
||||||
#' @import ggplot2
|
#' @importFrom ggplot2 ggplot theme_void annotation_custom
|
||||||
#' @examples
|
#' @examples
|
||||||
#' logo <- make_logo_grob()
|
#' logo <- make_logo_grob() # wordmark, light
|
||||||
#' class(logo) # gg
|
#' logo <- make_logo_grob("mark", "dark") # mark, dark
|
||||||
make_logo_grob <- function() {
|
#' logo <- make_logo_grob(position = "bottom-left") # left-aligned
|
||||||
logo_grob <- ggplot(mapping = aes(x = 0:1, y = 1)) +
|
#' class(logo) # "gg" "ggplot"
|
||||||
theme_void() +
|
make_logo_grob <- function(type = c("wordmark", "mark"),
|
||||||
annotation_custom(get_png(system.file("img", "civilytics_logo.png",
|
variant = c("light", "dark"),
|
||||||
package="civilytics")), xmin= 0.7, xmax = 1)
|
position = c("bottom-right", "bottom-left",
|
||||||
logo_grob
|
"top-right", "top-left")) {
|
||||||
|
type <- match.arg(type)
|
||||||
|
variant <- match.arg(variant)
|
||||||
|
position <- match.arg(position)
|
||||||
|
|
||||||
|
img_file <- switch(
|
||||||
|
paste(type, variant, sep = "_"),
|
||||||
|
wordmark_light = "civilytics-wordmark.png",
|
||||||
|
wordmark_dark = "civilytics-wordmark-reverse.png",
|
||||||
|
mark_light = "civilytics-mark.png",
|
||||||
|
mark_dark = "civilytics-mark-reverse.png"
|
||||||
|
)
|
||||||
|
|
||||||
|
align_left <- grepl("left", position)
|
||||||
|
|
||||||
|
if (align_left) {
|
||||||
|
xmin <- 0
|
||||||
|
xmax <- if (type == "mark") 0.07 else 0.35
|
||||||
|
} else {
|
||||||
|
xmin <- if (type == "mark") 0.93 else 0.65
|
||||||
|
xmax <- 1
|
||||||
|
}
|
||||||
|
|
||||||
|
ggplot2::ggplot() +
|
||||||
|
ggplot2::theme_void() +
|
||||||
|
ggplot2::annotation_custom(
|
||||||
|
get_png(system.file("img", img_file, package = "civilytics")),
|
||||||
|
xmin = xmin, xmax = xmax
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#' Add a Civilytics logo to a ggplot (pipe-friendly)
|
||||||
|
#'
|
||||||
|
#' A convenience wrapper that creates the logo grob and attaches it to a
|
||||||
|
#' corner of the plot in one call. Designed for use with the base pipe `|>`.
|
||||||
|
#'
|
||||||
|
#' **Important:** R's `|>` has *higher* precedence than `+`, so you must
|
||||||
|
#' wrap the ggplot chain in parentheses before piping:
|
||||||
|
#'
|
||||||
|
#' ```
|
||||||
|
#' (ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
#' geom_point() +
|
||||||
|
#' theme_civilytics()) |>
|
||||||
|
#' civilytics_logo()
|
||||||
|
#' ```
|
||||||
|
#'
|
||||||
|
#' @param plot A ggplot object.
|
||||||
|
#' @param type Character. `"wordmark"` (default) or `"mark"`. Passed to
|
||||||
|
#' [make_logo_grob()].
|
||||||
|
#' @param variant Character. `"light"` (default) or `"dark"`. Passed to
|
||||||
|
#' [make_logo_grob()].
|
||||||
|
#' @param position Character. Corner placement for the logo: `"bottom-right"`
|
||||||
|
#' (default), `"bottom-left"`, `"top-right"`, or `"top-left"`.
|
||||||
|
#' @param margin_param Numeric or `NULL`. Manual margin adjustment passed to
|
||||||
|
#' [add_logo()].
|
||||||
|
#' @param font_scale Numeric. Inflate text sizes by this factor to compensate
|
||||||
|
#' for viewport shrinkage when composing with [gridExtra::arrangeGrob()].
|
||||||
|
#' Default `1.1` (~10 \% inflation). Set to `1` to disable.
|
||||||
|
#'
|
||||||
|
#' @return A grob (from [gridExtra::arrangeGrob()]) ready to draw with
|
||||||
|
#' [grid::grid.draw()].
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' library(ggplot2); library(grid)
|
||||||
|
#'
|
||||||
|
#' # Pipe usage — parentheses required around the ggplot chain
|
||||||
|
#' (ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
#' geom_point() +
|
||||||
|
#' theme_civilytics()) |>
|
||||||
|
#' civilytics_logo() |>
|
||||||
|
#' grid.draw()
|
||||||
|
#'
|
||||||
|
#' # Top-right placement
|
||||||
|
#' (ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
#' geom_point() +
|
||||||
|
#' theme_civilytics()) |>
|
||||||
|
#' civilytics_logo(position = "top-right") |>
|
||||||
|
#' grid.draw()
|
||||||
|
#'
|
||||||
|
#' # Bottom-left with mark
|
||||||
|
#' (ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
#' geom_point() +
|
||||||
|
#' theme_civilytics()) |>
|
||||||
|
#' civilytics_logo(type = "mark", position = "bottom-left") |>
|
||||||
|
#' grid.draw()
|
||||||
|
#'
|
||||||
|
#' # Dark theme with mark in top-left
|
||||||
|
#' (ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
#' geom_point() +
|
||||||
|
#' theme_civilytics_dark()) |>
|
||||||
|
#' civilytics_logo(variant = "dark", type = "mark",
|
||||||
|
#' position = "top-left") |>
|
||||||
|
#' grid.draw()
|
||||||
|
#' }
|
||||||
|
civilytics_logo <- function(plot,
|
||||||
|
type = c("wordmark", "mark"),
|
||||||
|
variant = c("light", "dark"),
|
||||||
|
position = c("bottom-right", "bottom-left",
|
||||||
|
"top-right", "top-left"),
|
||||||
|
margin_param = NULL,
|
||||||
|
font_scale = 1.1) {
|
||||||
|
position <- match.arg(position)
|
||||||
|
logo <- make_logo_grob(type = type, variant = variant, position = position)
|
||||||
|
add_logo(plot, logo, margin_param = margin_param, font_scale = font_scale,
|
||||||
|
position = position)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Stamp the Civilytics logo onto a saved raster (PNG) image
|
||||||
|
#'
|
||||||
|
#' The raster analogue of [civilytics_logo()] for outputs that are already
|
||||||
|
#' rendered to a file rather than held as a ggplot/grob — e.g. a `flextable`
|
||||||
|
#' exported to PNG, or any `grDevices::png()` / `ragg::agg_png()` output.
|
||||||
|
#' Resolves the *same* brand asset that [make_logo_grob()] uses, so file-based
|
||||||
|
#' tables stay visually consistent with logo-branded plots, and composites it
|
||||||
|
#' into a corner of the image. Pure base-graphics + grid + png — no new
|
||||||
|
#' package dependencies.
|
||||||
|
#'
|
||||||
|
#' @param path Character. Path to the PNG to stamp. The file is overwritten
|
||||||
|
#' in place at its original pixel dimensions.
|
||||||
|
#' @param type Character. `"wordmark"` (default) or `"mark"`. As in
|
||||||
|
#' [make_logo_grob()].
|
||||||
|
#' @param variant Character. `"light"` (default, dark logo for light
|
||||||
|
#' backgrounds) or `"dark"` (reverse logo for dark backgrounds).
|
||||||
|
#' @param position Character. Corner placement: `"bottom-right"` (default),
|
||||||
|
#' `"bottom-left"`, `"top-right"`, or `"top-left"`.
|
||||||
|
#' @param width_frac Numeric. Logo width as a fraction of the image width
|
||||||
|
#' (default `0.15`). Height follows from the logo's aspect ratio.
|
||||||
|
#' @param margin_frac Numeric. Padding from the edges as a fraction of the
|
||||||
|
#' image width (default `0.02`).
|
||||||
|
#'
|
||||||
|
#' @return `path`, invisibly.
|
||||||
|
#' @export
|
||||||
|
#' @importFrom png readPNG
|
||||||
|
#' @importFrom grid grid.newpage grid.raster
|
||||||
|
#' @importFrom grDevices png dev.off
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' # Brand a table exported to PNG so it matches civilytics_logo()-branded plots
|
||||||
|
#' ragg::agg_png("table.png", width = 8, height = 4, units = "in", res = 200)
|
||||||
|
#' plot(flextable::flextable(head(mtcars)))
|
||||||
|
#' dev.off()
|
||||||
|
#' stamp_logo_png("table.png") # wordmark, bottom-right
|
||||||
|
#' stamp_logo_png("table.png", type = "mark", position = "bottom-left")
|
||||||
|
#' }
|
||||||
|
stamp_logo_png <- function(path,
|
||||||
|
type = c("wordmark", "mark"),
|
||||||
|
variant = c("light", "dark"),
|
||||||
|
position = c("bottom-right", "bottom-left",
|
||||||
|
"top-right", "top-left"),
|
||||||
|
width_frac = 0.15,
|
||||||
|
margin_frac = 0.02) {
|
||||||
|
type <- match.arg(type)
|
||||||
|
variant <- match.arg(variant)
|
||||||
|
position <- match.arg(position)
|
||||||
|
stopifnot(file.exists(path))
|
||||||
|
|
||||||
|
# Same asset selection as make_logo_grob() so files match branded plots.
|
||||||
|
img_file <- switch(
|
||||||
|
paste(type, variant, sep = "_"),
|
||||||
|
wordmark_light = "civilytics-wordmark.png",
|
||||||
|
wordmark_dark = "civilytics-wordmark-reverse.png",
|
||||||
|
mark_light = "civilytics-mark.png",
|
||||||
|
mark_dark = "civilytics-mark-reverse.png"
|
||||||
|
)
|
||||||
|
logo_path <- system.file("img", img_file, package = "civilytics")
|
||||||
|
if (!nzchar(logo_path)) {
|
||||||
|
stop("Civilytics logo asset not found in the 'civilytics' package: ", img_file)
|
||||||
|
}
|
||||||
|
|
||||||
|
base_img <- png::readPNG(path) # height x width x channels, values in [0, 1]
|
||||||
|
logo_img <- png::readPNG(logo_path)
|
||||||
|
h <- dim(base_img)[1]
|
||||||
|
w <- dim(base_img)[2]
|
||||||
|
aspect <- dim(logo_img)[1] / dim(logo_img)[2] # logo height / width
|
||||||
|
|
||||||
|
# Sizes/margins are expressed relative to image WIDTH, then converted to the
|
||||||
|
# device's npc units (which scale with the viewport's own width and height).
|
||||||
|
lw <- width_frac
|
||||||
|
lh <- width_frac * aspect * (w / h)
|
||||||
|
mx <- margin_frac
|
||||||
|
my <- margin_frac * (w / h)
|
||||||
|
|
||||||
|
x <- if (grepl("right", position)) 1 - mx else mx
|
||||||
|
y <- if (grepl("top", position)) 1 - my else my
|
||||||
|
just <- c(if (grepl("right", position)) "right" else "left",
|
||||||
|
if (grepl("top", position)) "top" else "bottom")
|
||||||
|
|
||||||
|
grDevices::png(path, width = w, height = h, units = "px")
|
||||||
|
on.exit(grDevices::dev.off(), add = TRUE)
|
||||||
|
grid::grid.newpage()
|
||||||
|
grid::grid.raster(base_img, width = 1, height = 1, interpolate = FALSE)
|
||||||
|
grid::grid.raster(logo_img, x = x, y = y, width = lw, height = lh,
|
||||||
|
just = just, interpolate = TRUE)
|
||||||
|
invisible(path)
|
||||||
|
}
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
#' Send a CLI beep / desktop notification
|
||||||
|
#'
|
||||||
|
#' Plays an audible beep in the terminal and/or sends a desktop notification
|
||||||
|
#' when a long-running R script completes or reaches a milestone.
|
||||||
|
#'
|
||||||
|
#' @param msg Character. Optional message to include in the notification.
|
||||||
|
#' When `type = "notify"`, this becomes the notification body.
|
||||||
|
#' @param type Character. Notification method:
|
||||||
|
#' - `"beep"` (default): emit a terminal bell character (`\007`).
|
||||||
|
#' Works in any terminal that supports the bell.
|
||||||
|
#' - `"notify"`: send a desktop notification via `notify-send` (Linux) or
|
||||||
|
#' `osascript` (macOS). Falls back to `"beep"` if neither tool is found.
|
||||||
|
#' - `"webhook"`: POST a JSON payload to a URL. Requires `url` argument.
|
||||||
|
#' - `"all"`: play beep + send desktop notification (webhook only if `url`
|
||||||
|
#' is provided).
|
||||||
|
#' @param url Character. Webhook URL for `type = "webhook"` or `"all"`.
|
||||||
|
#' A JSON payload is POSTed with keys `message`, `status`, and `timestamp`.
|
||||||
|
#' @param status Character. Status label for the notification (default `"done"`).
|
||||||
|
#' Used in the notification title and webhook payload.
|
||||||
|
#' @param timeout Numeric. Seconds to wait for the webhook POST to complete
|
||||||
|
#' (default `5`). Ignored for non-webhook types.
|
||||||
|
#' @param quiet Logical. If `TRUE`, suppress the terminal beep even when
|
||||||
|
#' `type` includes `"beep"`. Useful for silent background runs.
|
||||||
|
#'
|
||||||
|
#' @return Invisible `NULL`.
|
||||||
|
#'
|
||||||
|
#' @section Requirements:
|
||||||
|
#' - `type = "notify"` requires `notify-send` (Linux) or `osascript` (macOS).
|
||||||
|
#' - `type = "webhook"` requires network access to the provided URL.
|
||||||
|
#'
|
||||||
|
#' @section Examples:
|
||||||
|
#' \preformatted{
|
||||||
|
#' # Simple terminal beep
|
||||||
|
#' beep()
|
||||||
|
#'
|
||||||
|
#' # Desktop notification with message
|
||||||
|
#' beep("Analysis complete!", type = "notify")
|
||||||
|
#'
|
||||||
|
#' # Send to a webhook (e.g., Slack, Discord, custom endpoint)
|
||||||
|
#' beep("Job finished", type = "webhook",
|
||||||
|
#' url = "https://hooks.slack.com/services/...")
|
||||||
|
#'
|
||||||
|
#' # Beep + desktop notification
|
||||||
|
#' beep("Processing done", type = "all")
|
||||||
|
#' }
|
||||||
|
#'
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
beep <- function(msg = "done",
|
||||||
|
type = c("beep", "notify", "webhook", "all"),
|
||||||
|
url = NULL,
|
||||||
|
status = "done",
|
||||||
|
timeout = 5,
|
||||||
|
quiet = FALSE) {
|
||||||
|
type <- match.arg(type)
|
||||||
|
|
||||||
|
# -- Terminal beep ----------------------------------------------------------
|
||||||
|
if (!quiet && grepl("beep", type)) {
|
||||||
|
cat("\007")
|
||||||
|
flush.console()
|
||||||
|
}
|
||||||
|
|
||||||
|
# -- Desktop notification ---------------------------------------------------
|
||||||
|
if (grepl("notify", type)) {
|
||||||
|
.send_desktop_notify(msg, status)
|
||||||
|
}
|
||||||
|
|
||||||
|
# -- Webhook ----------------------------------------------------------------
|
||||||
|
if (grepl("webhook", type) && !is.null(url)) {
|
||||||
|
.send_webhook(url, msg, status, timeout)
|
||||||
|
}
|
||||||
|
|
||||||
|
invisible(NULL)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# -- Internal helpers ---------------------------------------------------------
|
||||||
|
|
||||||
|
#' Send a desktop notification via notify-send or osascript
|
||||||
|
#'
|
||||||
|
#' @param msg Message body
|
||||||
|
#' @param status Status label for the title
|
||||||
|
#' @keywords internal
|
||||||
|
.send_desktop_notify <- function(msg, status) {
|
||||||
|
# Linux: notify-send
|
||||||
|
if (.has_command("notify-send")) {
|
||||||
|
system2("notify-send", args = c(status, msg),
|
||||||
|
stdout = TRUE, stderr = TRUE)
|
||||||
|
return(invisible(NULL))
|
||||||
|
}
|
||||||
|
|
||||||
|
# macOS: osascript
|
||||||
|
if (.has_command("osascript")) {
|
||||||
|
system2("osascript",
|
||||||
|
args = c("-e",
|
||||||
|
paste0("display notification \"", msg,
|
||||||
|
"\" with title \"", status, "\"")),
|
||||||
|
stdout = TRUE, stderr = TRUE)
|
||||||
|
return(invisible(NULL))
|
||||||
|
}
|
||||||
|
|
||||||
|
# Neither tool available — silently skip
|
||||||
|
invisible(NULL)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' POST a JSON payload to a webhook URL
|
||||||
|
#'
|
||||||
|
#' @param url Webhook URL
|
||||||
|
#' @param msg Message body
|
||||||
|
#' @param status Status label
|
||||||
|
#' @param timeout Seconds to wait for the request
|
||||||
|
#' @keywords internal
|
||||||
|
.send_webhook <- function(url, msg, status, timeout) {
|
||||||
|
payload <- jsonlite::toJSON(list(
|
||||||
|
message = msg,
|
||||||
|
status = status,
|
||||||
|
timestamp = format(Sys.time(), "%Y-%m-%dT%H:%M:%S%z")
|
||||||
|
), auto_unbox = TRUE)
|
||||||
|
|
||||||
|
# Use curl via system2() for maximum compatibility (no extra R deps).
|
||||||
|
# system2() passes arguments directly to the executable without shell
|
||||||
|
# interpolation, avoiding command injection.
|
||||||
|
if (.has_command("curl")) {
|
||||||
|
system2("curl",
|
||||||
|
args = c("-s", "-X", "POST",
|
||||||
|
"-H", "Content-Type: application/json",
|
||||||
|
"-d", payload,
|
||||||
|
url,
|
||||||
|
"--max-time", as.character(timeout)),
|
||||||
|
stdout = TRUE, stderr = TRUE)
|
||||||
|
} else if (.has_command("wget")) {
|
||||||
|
system2("wget",
|
||||||
|
args = c("-q", "-O", "/dev/null",
|
||||||
|
paste0("--post-data=", payload),
|
||||||
|
paste0("--header=Content-Type: application/json"),
|
||||||
|
paste0("--timeout=", timeout),
|
||||||
|
url),
|
||||||
|
stdout = TRUE, stderr = TRUE)
|
||||||
|
}
|
||||||
|
|
||||||
|
invisible(NULL)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Check if a command exists on the system PATH
|
||||||
|
#'
|
||||||
|
#' @param cmd Command name
|
||||||
|
#' @return Logical
|
||||||
|
#' @keywords internal
|
||||||
|
.has_command <- function(cmd) {
|
||||||
|
Sys.which(cmd) != ""
|
||||||
|
}
|
||||||
@@ -72,14 +72,21 @@ waldInterval <- function(x, n, conf.level = 0.95){
|
|||||||
|
|
||||||
#' Calculate the Agresti-Coull interval
|
#' Calculate the Agresti-Coull interval
|
||||||
#'
|
#'
|
||||||
#' @param num a number of successes
|
#' @param num number of successes
|
||||||
#' @param den a number of trials
|
#' @param den number of trials
|
||||||
#' @param conf.level default 0.95, set the confidence interval to return
|
#' @param conf.level default 0.95, confidence level for the interval
|
||||||
#'
|
#'
|
||||||
#' @return an interval
|
#' @return three values forming the lower bound, observed proportion, and upper bound
|
||||||
agresti_coull_interval <- function(num, den, conf.level) {
|
#' @export
|
||||||
num <- num + 2
|
#'
|
||||||
den <- den + 4
|
#' @examples
|
||||||
return(num/den)
|
#' agresti_coull_interval(20, 40)
|
||||||
|
#' agresti_coull_interval(2, 100, conf.level = 0.99)
|
||||||
|
agresti_coull_interval <- function(num, den, conf.level = 0.95) {
|
||||||
|
z <- qnorm(1 - (1 - conf.level) / 2)
|
||||||
|
n_tilde <- den + z^2
|
||||||
|
p_tilde <- (num + z^2 / 2) / n_tilde
|
||||||
|
margin <- z * sqrt(p_tilde * (1 - p_tilde) / n_tilde)
|
||||||
|
obs <- num / den
|
||||||
|
return(c("low" = p_tilde - margin, "observed" = obs, "high" = p_tilde + margin))
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
#' Install Civilytics Quarto Themes and Templates
|
||||||
|
#'
|
||||||
|
#' Helper functions that copy Civilytics Quarto assets from the installed
|
||||||
|
#' package into your Quarto project directory. Logos are stored in a single
|
||||||
|
#' canonical location (`inst/img/`) and copied to the paths expected by each
|
||||||
|
#' template at install time.
|
||||||
|
#'
|
||||||
|
#' @name quarto-helpers
|
||||||
|
NULL
|
||||||
|
|
||||||
|
|
||||||
|
# -- internal utilities -------------------------------------------------------
|
||||||
|
|
||||||
|
#' Copy a package file to a project directory
|
||||||
|
#'
|
||||||
|
#' @param src Relative path within the installed package (under `inst/`).
|
||||||
|
#' @param dst Destination path relative to `path`.
|
||||||
|
#' @param path Project root.
|
||||||
|
#' @param force Overwrite existing files?
|
||||||
|
#' @return Invisible logical indicating success.
|
||||||
|
#' @keywords internal
|
||||||
|
.copy_pkg_file <- function(src, dst, path, force) {
|
||||||
|
from <- system.file(src, package = "civilytics", mustWork = TRUE)
|
||||||
|
to <- file.path(path, dst)
|
||||||
|
dir.create(dirname(to), recursive = TRUE, showWarnings = FALSE)
|
||||||
|
|
||||||
|
if (file.exists(to) && !force) {
|
||||||
|
message(" skip: ", dst, " (already exists; use force = TRUE to overwrite)")
|
||||||
|
return(invisible(FALSE))
|
||||||
|
}
|
||||||
|
|
||||||
|
file.copy(from, to, overwrite = force)
|
||||||
|
message(" copy: ", dst)
|
||||||
|
invisible(TRUE)
|
||||||
|
}
|
||||||
|
|
||||||
|
#' Copy logo SVGs from inst/img/ to a target directory
|
||||||
|
#'
|
||||||
|
#' @param dest_dir Destination directory relative to `path`.
|
||||||
|
#' @param path Project root.
|
||||||
|
#' @param force Overwrite existing files?
|
||||||
|
#' @param files Character vector of logo filenames to copy.
|
||||||
|
#' @keywords internal
|
||||||
|
.copy_logos <- function(dest_dir, path, force,
|
||||||
|
files = c("civilytics-mark.svg",
|
||||||
|
"civilytics-mark-reverse.svg",
|
||||||
|
"civilytics-wordmark.svg",
|
||||||
|
"civilytics-wordmark-reverse.svg",
|
||||||
|
"civilytics-pulse.svg")) {
|
||||||
|
for (f in files) {
|
||||||
|
.copy_pkg_file(file.path("img", f), file.path(dest_dir, f), path, force)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# -- public API ----------------------------------------------------------------
|
||||||
|
|
||||||
|
#' Install the Civilytics Reveal.js extension
|
||||||
|
#'
|
||||||
|
#' Copies the Civilytics Reveal.js Quarto extension into
|
||||||
|
#' `_extensions/civilytics-reveal/` under `path`, including brand logos
|
||||||
|
#' from the package. After running this function, add
|
||||||
|
#' `format: civilytics-reveal-revealjs` to your `.qmd` YAML front-matter.
|
||||||
|
#'
|
||||||
|
#' @param path Character. Project directory to install into. Default `"."`.
|
||||||
|
#' @param force Logical. Overwrite existing files? Default `FALSE`.
|
||||||
|
#'
|
||||||
|
#' @return Invisible `NULL`.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' use_civilytics_revealjs()
|
||||||
|
#' }
|
||||||
|
use_civilytics_revealjs <- function(path = ".", force = FALSE) {
|
||||||
|
path <- normalizePath(path, mustWork = TRUE)
|
||||||
|
message("Installing Civilytics Reveal.js extension into: ", path)
|
||||||
|
|
||||||
|
ext_src <- "quarto/extensions/civilytics-reveal"
|
||||||
|
ext_dst <- "_extensions/civilytics-reveal"
|
||||||
|
|
||||||
|
ext_files <- c(
|
||||||
|
"_extension.yml",
|
||||||
|
"civilytics.scss",
|
||||||
|
"civilytics.css",
|
||||||
|
"civilytics-head.html",
|
||||||
|
"civilytics-after.html"
|
||||||
|
)
|
||||||
|
for (f in ext_files) {
|
||||||
|
.copy_pkg_file(file.path(ext_src, f), file.path(ext_dst, f), path, force)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Logos — single source from inst/img/
|
||||||
|
.copy_logos(file.path(ext_dst, "assets"), path, force)
|
||||||
|
|
||||||
|
message("\nDone! Add this to your .qmd front-matter:\n")
|
||||||
|
message("---")
|
||||||
|
message("format: civilytics-reveal-revealjs")
|
||||||
|
message("---")
|
||||||
|
invisible(NULL)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Install the Civilytics document theme
|
||||||
|
#'
|
||||||
|
#' Copies Civilytics HTML, PDF (LaTeX), and Typst theme files into
|
||||||
|
#' your Quarto project. Also installs `_brand.yml` and the logo
|
||||||
|
#' assets it references.
|
||||||
|
#'
|
||||||
|
#' @inheritParams use_civilytics_revealjs
|
||||||
|
#'
|
||||||
|
#' @return Invisible `NULL`.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' use_civilytics_theme()
|
||||||
|
#' }
|
||||||
|
use_civilytics_theme <- function(path = ".", force = FALSE) {
|
||||||
|
path <- normalizePath(path, mustWork = TRUE)
|
||||||
|
message("Installing Civilytics document theme into: ", path)
|
||||||
|
|
||||||
|
# Brand file
|
||||||
|
.copy_pkg_file("quarto/_brand.yml", "_brand.yml", path, force)
|
||||||
|
|
||||||
|
# HTML theme
|
||||||
|
theme_files <- c("civilytics.scss", "_tokens.scss", "extras.css")
|
||||||
|
for (f in theme_files) {
|
||||||
|
.copy_pkg_file(file.path("quarto/theme", f), file.path("theme", f), path, force)
|
||||||
|
}
|
||||||
|
|
||||||
|
# LaTeX
|
||||||
|
latex_files <- c("civilytics.tex", "civilytics-title.tex")
|
||||||
|
for (f in latex_files) {
|
||||||
|
.copy_pkg_file(file.path("quarto/latex", f), file.path("latex", f), path, force)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Typst — shipped as template-partials so Quarto keeps its Skylighting
|
||||||
|
# definitions and syntax-highlighted code blocks render (see issue #12)
|
||||||
|
typst_files <- c("typst-template.typ", "typst-show.typ")
|
||||||
|
for (f in typst_files) {
|
||||||
|
.copy_pkg_file(file.path("quarto/typst", f), file.path("typst", f), path, force)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Logos — for _brand.yml (expects assets/logo/)
|
||||||
|
.copy_logos("assets/logo", path, force)
|
||||||
|
|
||||||
|
# Example report
|
||||||
|
.copy_pkg_file("quarto/examples/report.qmd", "examples/report.qmd", path, force)
|
||||||
|
|
||||||
|
message("\nDone! Example YAML for a report:\n")
|
||||||
|
message("---")
|
||||||
|
message("format:")
|
||||||
|
message(" html:")
|
||||||
|
message(" theme: theme/civilytics.scss")
|
||||||
|
message(" css: theme/extras.css")
|
||||||
|
message(" pdf:")
|
||||||
|
message(" include-in-header: latex/civilytics.tex")
|
||||||
|
message(" include-before-body: latex/civilytics-title.tex")
|
||||||
|
message(" typst:")
|
||||||
|
message(" template-partials:")
|
||||||
|
message(" - typst/typst-template.typ")
|
||||||
|
message(" - typst/typst-show.typ")
|
||||||
|
message("---")
|
||||||
|
message("\nSee examples/report.qmd for a complete example.")
|
||||||
|
invisible(NULL)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Install the Civilytics brand file only
|
||||||
|
#'
|
||||||
|
#' Copies `_brand.yml` and the logo assets it references into your
|
||||||
|
#' Quarto project. This gives you Quarto 1.5+ automatic brand
|
||||||
|
#' styling (colors, fonts, logos) without the full theme SCSS.
|
||||||
|
#'
|
||||||
|
#' @inheritParams use_civilytics_revealjs
|
||||||
|
#'
|
||||||
|
#' @return Invisible `NULL`.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' use_civilytics_brand()
|
||||||
|
#' }
|
||||||
|
use_civilytics_brand <- function(path = ".", force = FALSE) {
|
||||||
|
path <- normalizePath(path, mustWork = TRUE)
|
||||||
|
message("Installing Civilytics brand file into: ", path)
|
||||||
|
|
||||||
|
.copy_pkg_file("quarto/_brand.yml", "_brand.yml", path, force)
|
||||||
|
.copy_logos("assets/logo", path, force)
|
||||||
|
|
||||||
|
message("\nDone! Quarto 1.5+ will auto-apply brand colors, fonts, and logos.")
|
||||||
|
message("See: https://quarto.org/docs/authoring/brand.html")
|
||||||
|
invisible(NULL)
|
||||||
|
}
|
||||||
@@ -1,168 +1,624 @@
|
|||||||
#' Make the Civilytics plot theme
|
#' Civilytics ggplot2 theme
|
||||||
#'
|
#'
|
||||||
#' @param font_size default 14, a number representing the base font for the theme
|
#' A complete ggplot2 theme built on [ggplot2::theme_grey()] using the
|
||||||
#' @param font_family default "", a character for the font family to use in the theme
|
#' Civilytics brand color palette and typography. Requires ggplot2 >= 4.0.0
|
||||||
#' @param line_size default 0.5, the line size to use for the theme
|
#' for the `ink`, `paper`, and `accent` base-theme parameters.
|
||||||
#' @param rel_small default 12/14, the scale factor to create a small font from the base font_size
|
#'
|
||||||
#' @param rel_tiny default 11/14, the scale factor to create a tiny font from the base font_size
|
#' Produces an editorial, Pew-style layout: visible x-axis line to ground
|
||||||
#' @param rel_large default 16/14, the scale factor to create a large font from the base font_size
|
#' the data, light horizontal gridlines for reference, no panel border or
|
||||||
#' @importFrom graphics plot
|
#' y-axis line. Plot title and caption are left-aligned to the full plot
|
||||||
#' @return a ggplot2 theme object suitable for combining with ggplot objects to theme them
|
#' region.
|
||||||
#' @export
|
#'
|
||||||
theme_civilytics <-
|
#' Brand fonts (Inter for UI text, Libre Franklin for titles) are loaded
|
||||||
function (font_size = 14,
|
#' automatically via [showtext] when the package is attached. Call
|
||||||
font_family = "",
|
#' [civilytics_load_fonts()] to reload them if needed.
|
||||||
line_size = 0.5,
|
#'
|
||||||
rel_small = 12 / 14,
|
#' @param font_size Numeric. Base font size in points. Default `14`.
|
||||||
rel_tiny = 11 / 14,
|
#' @param font_family Character. Font family for body/axis text. Default
|
||||||
rel_large = 16 / 14) {
|
#' `"Inter"` (loaded via showtext).
|
||||||
half_line <- font_size / 2
|
#' @param title_family Character. Font family for plot titles and strip labels.
|
||||||
small_size <- rel_small * font_size
|
#' Default `"Libre Franklin"` (loaded via showtext).
|
||||||
theme_grey(base_size = font_size, base_family = font_family) %+replace%
|
#' @param line_size Numeric. Base line width. Default `0.5`.
|
||||||
theme(
|
#' @param rel_small Numeric. Scale factor for small text relative to
|
||||||
line = element_line(
|
#' `font_size`. Default `12/14`.
|
||||||
color = "black",
|
#' @param rel_tiny Numeric. Scale factor for tiny text relative to `font_size`.
|
||||||
linewidth = line_size,
|
#' Default `11/14`.
|
||||||
linetype = 1,
|
#' @param rel_large Numeric. Scale factor for large text (titles) relative to
|
||||||
lineend = "butt"
|
#' `font_size`. Default `20/14` (~1.43x), matching the Civilytics editorial
|
||||||
),
|
#' design system.
|
||||||
rect = element_rect(
|
#' @param ink Character. Hex code for foreground/text color. Defaults to
|
||||||
fill = NA,
|
#' [civilytics_colors]`["ink"]` (`#0E1A2B`).
|
||||||
color = NA,
|
#' @param paper Character. Hex code for background color. Defaults to
|
||||||
linewidth = line_size,
|
#' [civilytics_colors]`["paper"]` (`#FAF7F2`).
|
||||||
linetype = 1
|
#' @param accent Character. Hex code for accent/highlight color. Defaults to
|
||||||
),
|
#' [civilytics_colors]`["ember_600"]` (`#C25311`).
|
||||||
text = element_text(
|
#' @param strip_color Character. Hex code for facet strip background. Defaults
|
||||||
family = font_family,
|
#' to [civilytics_colors]`["paper_2"]` (`#F2EDE4`).
|
||||||
face = "plain",
|
#' @param grid Character. Which major gridlines to draw: `"y"` (default,
|
||||||
color = "black",
|
#' horizontal only), `"x"` (vertical only), `"both"`, or `"none"`.
|
||||||
size = font_size,
|
#' @param paper_bg Logical. If `TRUE`, fill the plot and panel backgrounds
|
||||||
hjust = 0.5,
|
#' with the warm `paper` color (Civilytics cream). Default is `FALSE`
|
||||||
vjust = 0.5,
|
#' (transparent) so that figures composite cleanly onto any background.
|
||||||
angle = 0,
|
#' Set to `TRUE` for the branded cream canvas. Note: a transparent device
|
||||||
lineheight = 0.9,
|
#' background (e.g., `dev = "ragg_png"`, `dev.args = list(background =
|
||||||
margin = margin(),
|
#' "transparent")`) is also needed for fully-transparent PNG exports.
|
||||||
debug = FALSE
|
#'
|
||||||
),
|
#' @section Font size hierarchy:
|
||||||
axis.line = element_line(
|
#' All text sizes are derived from `font_size` using relative scale factors.
|
||||||
color = "black",
|
#' At the default `font_size = 14`:
|
||||||
linewidth = line_size,
|
#'
|
||||||
lineend = "square"
|
#' | Element | Scale factor | Default size |
|
||||||
),
|
#' |:--------|:-------------|:-------------|
|
||||||
axis.line.x = NULL,
|
#' | Plot title | `rel_large` (1.43x) | ~20 pt |
|
||||||
axis.line.y = NULL,
|
#' | Subtitle | 1.0x | 14 pt |
|
||||||
axis.text = element_text(color = "black",
|
#' | Axis text (tick labels) | `rel_small` (0.86x) | ~12 pt |
|
||||||
size = small_size),
|
#' | Axis titles | `rel_small` (0.86x) | ~12 pt |
|
||||||
axis.text.x = element_text(margin = margin(t = small_size / 4),
|
#' | Legend text | `rel_small` (0.86x) | ~12 pt |
|
||||||
vjust = 1),
|
#' | Caption | `rel_tiny` (0.79x) | ~11 pt |
|
||||||
axis.text.x.top = element_text(margin = margin(b = small_size / 4),
|
#' | Legend title | `rel_tiny` (0.79x) | ~11 pt |
|
||||||
vjust = 0),
|
#' | Strip text (facets) | `rel_small` (0.86x) | ~12 pt |
|
||||||
axis.text.y = element_text(margin = margin(r = small_size / 4),
|
#'
|
||||||
hjust = 1),
|
#' To uniformly scale all text, change `font_size`. To adjust only the title
|
||||||
axis.text.y.right = element_text(margin = margin(l = small_size / 4),
|
#' prominence, change `rel_large`. When using [civilytics_logo()] to add a
|
||||||
hjust = 0),
|
#' logo below the plot, pass `font_scale` to compensate for viewport
|
||||||
axis.ticks = element_line(color = "black",
|
#' shrinkage.
|
||||||
linewidth = line_size),
|
#'
|
||||||
axis.ticks.length = unit(half_line / 2,
|
#' @return A complete ggplot2 [ggplot2::theme()] object.
|
||||||
"pt"),
|
#' @export
|
||||||
axis.title.x = element_text(margin = margin(t = half_line / 2),
|
#'
|
||||||
vjust = 1),
|
#' @examples
|
||||||
axis.title.x.top = element_text(margin = margin(b = half_line / 2),
|
#' \dontrun{
|
||||||
vjust = 0),
|
#' library(ggplot2)
|
||||||
axis.title.y = element_text(
|
#'
|
||||||
angle = 90,
|
#' # Default — transparent background for embedding
|
||||||
margin = margin(r = half_line /
|
#' ggplot(mpg, aes(displ, hwy)) +
|
||||||
2),
|
#' geom_point() +
|
||||||
vjust = 1
|
#' theme_civilytics()
|
||||||
),
|
#'
|
||||||
axis.title.y.right = element_text(
|
#' # With both gridlines and brand colors
|
||||||
angle = -90,
|
#' ggplot(mpg, aes(displ, hwy, colour = class)) +
|
||||||
margin = margin(l = half_line / 2),
|
#' geom_point() +
|
||||||
vjust = 0
|
#' scale_color_civilytics() +
|
||||||
),
|
#' theme_civilytics(grid = "both")
|
||||||
legend.background = element_blank(),
|
#'
|
||||||
legend.spacing = unit(font_size, "pt"),
|
#' # Branded cream background (opt-in)
|
||||||
legend.spacing.x = NULL,
|
#' ggplot(mpg, aes(displ, hwy)) +
|
||||||
legend.spacing.y = NULL,
|
#' geom_point() +
|
||||||
legend.margin = margin(0,
|
#' theme_civilytics(paper_bg = TRUE)
|
||||||
0, 0, 0),
|
#'
|
||||||
legend.key = element_blank(),
|
#' # Larger text for poster or display
|
||||||
legend.key.size = unit(1.1 *
|
#' ggplot(mpg, aes(displ, hwy)) +
|
||||||
font_size, "pt"),
|
#' geom_point() +
|
||||||
legend.key.height = NULL,
|
#' theme_civilytics(font_size = 18)
|
||||||
legend.key.width = NULL,
|
#' }
|
||||||
legend.text = element_text(size = rel(rel_small)),
|
theme_civilytics <- function(
|
||||||
legend.text.align = NULL,
|
font_size = 14,
|
||||||
legend.title = element_text(hjust = 0),
|
font_family = CV_FONT_SANS,
|
||||||
legend.title.align = NULL,
|
title_family = CV_FONT_DISPLAY,
|
||||||
legend.position = "right",
|
line_size = 0.5,
|
||||||
legend.direction = NULL,
|
rel_small = 12 / 14,
|
||||||
legend.justification = c("left",
|
rel_tiny = 11 / 14,
|
||||||
"center"),
|
rel_large = 20 / 14,
|
||||||
legend.box = NULL,
|
ink = unname(civilytics_colors["ink"]),
|
||||||
legend.box.margin = margin(0,
|
paper = unname(civilytics_colors["paper"]),
|
||||||
0, 0, 0),
|
accent = unname(civilytics_colors["ember_600"]),
|
||||||
legend.box.background = element_blank(),
|
strip_color = unname(civilytics_colors["paper_2"]),
|
||||||
legend.box.spacing = unit(font_size, "pt"),
|
grid = c("y", "x", "both", "none"),
|
||||||
panel.background = element_blank(),
|
paper_bg = FALSE) {
|
||||||
panel.border = element_blank(),
|
|
||||||
panel.grid = element_blank(),
|
grid <- match.arg(grid)
|
||||||
panel.grid.major = NULL,
|
half_line <- font_size / 2
|
||||||
panel.grid.minor = NULL,
|
small_size <- rel_small * font_size
|
||||||
panel.grid.major.x = NULL,
|
rule_color <- unname(civilytics_colors["rule"])
|
||||||
panel.grid.major.y = NULL,
|
ink_2 <- unname(civilytics_colors["ink_2"])
|
||||||
panel.grid.minor.x = NULL,
|
ink_3 <- unname(civilytics_colors["ink_3"])
|
||||||
panel.grid.minor.y = NULL,
|
bg_color <- if (isTRUE(paper_bg)) paper else NA
|
||||||
panel.spacing = unit(half_line,
|
|
||||||
"pt"),
|
# Grid line elements
|
||||||
panel.spacing.x = NULL,
|
grid_line <- ggplot2::element_line(color = rule_color, linewidth = 0.35)
|
||||||
panel.spacing.y = NULL,
|
no_line <- ggplot2::element_blank()
|
||||||
panel.ontop = FALSE,
|
|
||||||
strip.background = element_rect(fill = "grey80"),
|
ggplot2::theme_grey(
|
||||||
strip.text = element_text(
|
base_size = font_size,
|
||||||
size = rel(rel_small),
|
base_family = font_family,
|
||||||
margin = margin(half_line / 2, half_line /
|
ink = ink,
|
||||||
2, half_line / 2,
|
paper = paper,
|
||||||
half_line / 2)
|
accent = accent
|
||||||
),
|
) %+replace%
|
||||||
strip.text.x = NULL,
|
ggplot2::theme(
|
||||||
strip.text.y = element_text(angle = -90),
|
line = ggplot2::element_line(
|
||||||
strip.placement = "inside",
|
color = ink,
|
||||||
strip.placement.x = NULL,
|
linewidth = line_size,
|
||||||
strip.placement.y = NULL,
|
linetype = 1,
|
||||||
strip.switch.pad.grid = unit(half_line / 2,
|
lineend = "butt"
|
||||||
"pt"),
|
),
|
||||||
strip.switch.pad.wrap = unit(half_line / 2,
|
rect = ggplot2::element_rect(
|
||||||
"pt"),
|
fill = NA,
|
||||||
plot.background = element_blank(),
|
color = NA,
|
||||||
plot.title = element_text(
|
linewidth = line_size,
|
||||||
face = "bold",
|
linetype = 1
|
||||||
size = rel(rel_large),
|
),
|
||||||
hjust = 0,
|
text = ggplot2::element_text(
|
||||||
vjust = 1,
|
family = font_family,
|
||||||
margin = margin(b = half_line)
|
face = "plain",
|
||||||
),
|
color = ink,
|
||||||
plot.subtitle = element_text(
|
size = font_size,
|
||||||
size = rel(rel_small),
|
hjust = 0.5,
|
||||||
hjust = 0,
|
vjust = 0.5,
|
||||||
vjust = 1,
|
angle = 0,
|
||||||
margin = margin(b = half_line)
|
lineheight = 0.9,
|
||||||
),
|
margin = ggplot2::margin(),
|
||||||
plot.caption = element_text(
|
debug = FALSE
|
||||||
size = rel(rel_tiny),
|
),
|
||||||
hjust = 0, # set hjust to 0
|
# -- Axes --
|
||||||
vjust = 1,
|
axis.line = ggplot2::element_blank(),
|
||||||
lineheight = 1,
|
axis.line.x = ggplot2::element_line(
|
||||||
margin = margin(t = half_line)
|
color = ink,
|
||||||
),
|
linewidth = 0.6,
|
||||||
plot.tag = element_text(
|
lineend = "square"
|
||||||
face = "bold",
|
),
|
||||||
hjust = 0,
|
axis.line.y = ggplot2::element_blank(),
|
||||||
vjust = 0.7
|
axis.text = ggplot2::element_text(
|
||||||
),
|
color = ink_2,
|
||||||
plot.tag.position = c(0, 1),
|
size = ggplot2::rel(rel_small)
|
||||||
plot.margin = margin(half_line,
|
),
|
||||||
half_line, half_line, half_line),
|
axis.text.x = ggplot2::element_text(
|
||||||
complete = TRUE
|
margin = ggplot2::margin(t = small_size / 4),
|
||||||
)
|
vjust = 1
|
||||||
}
|
),
|
||||||
|
axis.text.x.top = ggplot2::element_text(
|
||||||
|
margin = ggplot2::margin(b = small_size / 4),
|
||||||
|
vjust = 0
|
||||||
|
),
|
||||||
|
axis.text.y = ggplot2::element_text(
|
||||||
|
margin = ggplot2::margin(r = small_size / 4),
|
||||||
|
hjust = 1
|
||||||
|
),
|
||||||
|
axis.text.y.right = ggplot2::element_text(
|
||||||
|
margin = ggplot2::margin(l = small_size / 4),
|
||||||
|
hjust = 0
|
||||||
|
),
|
||||||
|
axis.ticks = ggplot2::element_line(
|
||||||
|
color = ink_3,
|
||||||
|
linewidth = 0.4
|
||||||
|
),
|
||||||
|
axis.ticks.length = ggplot2::unit(4, "pt"),
|
||||||
|
axis.title.x = ggplot2::element_text(
|
||||||
|
size = ggplot2::rel(rel_small),
|
||||||
|
color = ink_3,
|
||||||
|
margin = ggplot2::margin(t = 10),
|
||||||
|
vjust = 1
|
||||||
|
),
|
||||||
|
axis.title.x.top = ggplot2::element_text(
|
||||||
|
size = ggplot2::rel(rel_small),
|
||||||
|
color = ink_3,
|
||||||
|
margin = ggplot2::margin(b = half_line / 2),
|
||||||
|
vjust = 0
|
||||||
|
),
|
||||||
|
axis.title.y = ggplot2::element_text(
|
||||||
|
size = ggplot2::rel(rel_small),
|
||||||
|
color = ink_3,
|
||||||
|
angle = 90,
|
||||||
|
margin = ggplot2::margin(r = 10),
|
||||||
|
vjust = 1
|
||||||
|
),
|
||||||
|
axis.title.y.right = ggplot2::element_text(
|
||||||
|
size = ggplot2::rel(rel_small),
|
||||||
|
color = ink_3,
|
||||||
|
angle = -90,
|
||||||
|
margin = ggplot2::margin(l = half_line / 2),
|
||||||
|
vjust = 0
|
||||||
|
),
|
||||||
|
# -- Legend --
|
||||||
|
legend.background = ggplot2::element_blank(),
|
||||||
|
legend.spacing = ggplot2::unit(font_size, "pt"),
|
||||||
|
legend.spacing.x = NULL,
|
||||||
|
legend.spacing.y = NULL,
|
||||||
|
legend.margin = ggplot2::margin(0, 0, 4, 0),
|
||||||
|
legend.key = ggplot2::element_blank(),
|
||||||
|
legend.key.size = ggplot2::unit(12, "pt"),
|
||||||
|
legend.key.height = NULL,
|
||||||
|
legend.key.width = NULL,
|
||||||
|
legend.text = ggplot2::element_text(
|
||||||
|
size = ggplot2::rel(rel_small),
|
||||||
|
color = ink_2
|
||||||
|
),
|
||||||
|
legend.title = ggplot2::element_text(
|
||||||
|
hjust = 0,
|
||||||
|
face = "bold",
|
||||||
|
size = ggplot2::rel(rel_tiny),
|
||||||
|
color = ink_3
|
||||||
|
),
|
||||||
|
legend.position = "top",
|
||||||
|
legend.direction = NULL,
|
||||||
|
legend.justification = c("left", "center"),
|
||||||
|
legend.box = NULL,
|
||||||
|
legend.box.margin = ggplot2::margin(0, 0, 0, 0),
|
||||||
|
legend.box.background = ggplot2::element_blank(),
|
||||||
|
legend.box.spacing = ggplot2::unit(font_size, "pt"),
|
||||||
|
# -- Panel --
|
||||||
|
panel.background = ggplot2::element_rect(fill = bg_color, color = NA),
|
||||||
|
panel.border = ggplot2::element_blank(),
|
||||||
|
panel.grid.minor = ggplot2::element_blank(),
|
||||||
|
panel.grid.major.x = if (grid %in% c("x", "both")) grid_line else no_line,
|
||||||
|
panel.grid.major.y = if (grid %in% c("y", "both")) grid_line else no_line,
|
||||||
|
panel.spacing = ggplot2::unit(16, "pt"),
|
||||||
|
panel.spacing.x = NULL,
|
||||||
|
panel.spacing.y = NULL,
|
||||||
|
panel.ontop = FALSE,
|
||||||
|
# -- Facet strips --
|
||||||
|
strip.background = ggplot2::element_rect(fill = strip_color, color = NA),
|
||||||
|
strip.text = ggplot2::element_text(
|
||||||
|
family = font_family,
|
||||||
|
face = "bold",
|
||||||
|
size = ggplot2::rel(rel_small),
|
||||||
|
color = ink,
|
||||||
|
margin = ggplot2::margin(
|
||||||
|
half_line / 2, half_line / 2,
|
||||||
|
half_line / 2, half_line / 2
|
||||||
|
)
|
||||||
|
),
|
||||||
|
strip.text.x = NULL,
|
||||||
|
strip.text.y = ggplot2::element_text(angle = -90),
|
||||||
|
strip.placement = "inside",
|
||||||
|
strip.placement.x = NULL,
|
||||||
|
strip.placement.y = NULL,
|
||||||
|
strip.switch.pad.grid = ggplot2::unit(half_line / 2, "pt"),
|
||||||
|
strip.switch.pad.wrap = ggplot2::unit(half_line / 2, "pt"),
|
||||||
|
# -- Plot-level --
|
||||||
|
plot.background = ggplot2::element_rect(fill = bg_color, color = NA),
|
||||||
|
plot.title = ggplot2::element_text(
|
||||||
|
family = title_family,
|
||||||
|
face = "bold",
|
||||||
|
size = ggplot2::rel(rel_large),
|
||||||
|
hjust = 0,
|
||||||
|
vjust = 1,
|
||||||
|
margin = ggplot2::margin(b = 4)
|
||||||
|
),
|
||||||
|
plot.title.position = "plot",
|
||||||
|
plot.subtitle = ggplot2::element_text(
|
||||||
|
size = ggplot2::rel(1),
|
||||||
|
color = ink_2,
|
||||||
|
hjust = 0,
|
||||||
|
vjust = 1,
|
||||||
|
lineheight = 1.3,
|
||||||
|
margin = ggplot2::margin(b = 14)
|
||||||
|
),
|
||||||
|
plot.caption = ggplot2::element_text(
|
||||||
|
size = ggplot2::rel(rel_tiny),
|
||||||
|
color = ink_3,
|
||||||
|
hjust = 0,
|
||||||
|
vjust = 1,
|
||||||
|
lineheight = 1.3,
|
||||||
|
margin = ggplot2::margin(t = 14)
|
||||||
|
),
|
||||||
|
plot.caption.position = "plot",
|
||||||
|
plot.tag = ggplot2::element_text(
|
||||||
|
face = "bold",
|
||||||
|
color = accent,
|
||||||
|
size = ggplot2::rel(rel_tiny),
|
||||||
|
hjust = 0,
|
||||||
|
vjust = 0.7
|
||||||
|
),
|
||||||
|
plot.tag.position = c(0, 1),
|
||||||
|
plot.margin = ggplot2::margin(16, 18, 16, 16),
|
||||||
|
complete = TRUE
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Dark variant of the Civilytics ggplot2 theme
|
||||||
|
#'
|
||||||
|
#' Convenience wrapper around [theme_civilytics()] with dark-background
|
||||||
|
#' defaults: navy (`#1A2E4A`) paper, warm off-white (`#FAF7F2`) ink, and
|
||||||
|
#' a lighter ember accent (`#E07840`). Facet strips use primary navy.
|
||||||
|
#'
|
||||||
|
#' Pair with `make_logo_grob(variant = "dark")` for the white logo.
|
||||||
|
#'
|
||||||
|
#' @inheritParams theme_civilytics
|
||||||
|
#'
|
||||||
|
#' @return A complete ggplot2 [ggplot2::theme()] object.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' library(ggplot2)
|
||||||
|
#' ggplot(mpg, aes(displ, hwy, colour = class)) +
|
||||||
|
#' geom_point() +
|
||||||
|
#' scale_color_civilytics() +
|
||||||
|
#' theme_civilytics_dark()
|
||||||
|
#' }
|
||||||
|
theme_civilytics_dark <- function(
|
||||||
|
font_size = 14,
|
||||||
|
font_family = CV_FONT_SANS,
|
||||||
|
title_family = CV_FONT_DISPLAY,
|
||||||
|
line_size = 0.5,
|
||||||
|
rel_small = 12 / 14,
|
||||||
|
rel_tiny = 11 / 14,
|
||||||
|
rel_large = 20 / 14,
|
||||||
|
ink = unname(civilytics_colors["paper"]),
|
||||||
|
paper = unname(civilytics_colors["navy_700"]),
|
||||||
|
accent = unname(civilytics_colors["ember_400"]),
|
||||||
|
strip_color = unname(civilytics_colors["navy_600"]),
|
||||||
|
grid = c("y", "x", "both", "none"),
|
||||||
|
paper_bg = TRUE) {
|
||||||
|
|
||||||
|
theme_civilytics(
|
||||||
|
font_size = font_size,
|
||||||
|
font_family = font_family,
|
||||||
|
title_family = title_family,
|
||||||
|
line_size = line_size,
|
||||||
|
rel_small = rel_small,
|
||||||
|
rel_tiny = rel_tiny,
|
||||||
|
rel_large = rel_large,
|
||||||
|
ink = ink,
|
||||||
|
paper = paper,
|
||||||
|
accent = accent,
|
||||||
|
strip_color = strip_color,
|
||||||
|
grid = grid,
|
||||||
|
paper_bg = paper_bg
|
||||||
|
) +
|
||||||
|
# The base theme hardcodes ink_2/ink_3 for subtitle/caption, which are
|
||||||
|
# dark colors meant for light backgrounds. Override with lighter values
|
||||||
|
# so text remains readable on the navy background.
|
||||||
|
ggplot2::theme(
|
||||||
|
plot.subtitle = ggplot2::element_text(
|
||||||
|
color = unname(civilytics_colors["navy_200"])
|
||||||
|
),
|
||||||
|
plot.caption = ggplot2::element_text(
|
||||||
|
color = unname(civilytics_colors["navy_300"])
|
||||||
|
),
|
||||||
|
axis.text = ggplot2::element_text(
|
||||||
|
color = unname(civilytics_colors["navy_200"])
|
||||||
|
),
|
||||||
|
axis.title.x = ggplot2::element_text(
|
||||||
|
color = unname(civilytics_colors["navy_300"])
|
||||||
|
),
|
||||||
|
axis.title.y = ggplot2::element_text(
|
||||||
|
color = unname(civilytics_colors["navy_300"])
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Slide-friendly Civilytics ggplot2 theme
|
||||||
|
#'
|
||||||
|
#' Variant of [theme_civilytics()] sized for Reveal.js slides or PowerPoint
|
||||||
|
#' exports: larger base font (18pt), transparent background, wider margins,
|
||||||
|
#' and a heavier x-axis line. Gridlines default to horizontal only.
|
||||||
|
#'
|
||||||
|
#' @inheritParams theme_civilytics
|
||||||
|
#'
|
||||||
|
#' @return A complete ggplot2 [ggplot2::theme()] object.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' library(ggplot2)
|
||||||
|
#' ggplot(mpg, aes(displ, hwy, colour = class)) +
|
||||||
|
#' geom_point() +
|
||||||
|
#' scale_color_civilytics() +
|
||||||
|
#' theme_civilytics_slide()
|
||||||
|
#' }
|
||||||
|
theme_civilytics_slide <- function(
|
||||||
|
font_size = 18,
|
||||||
|
font_family = CV_FONT_SANS,
|
||||||
|
title_family = CV_FONT_DISPLAY,
|
||||||
|
line_size = 0.5,
|
||||||
|
rel_small = 12 / 14,
|
||||||
|
rel_tiny = 11 / 14,
|
||||||
|
rel_large = 20 / 14,
|
||||||
|
ink = unname(civilytics_colors["ink"]),
|
||||||
|
paper = unname(civilytics_colors["paper"]),
|
||||||
|
accent = unname(civilytics_colors["ember_600"]),
|
||||||
|
strip_color = unname(civilytics_colors["paper_2"]),
|
||||||
|
grid = c("y", "x", "both", "none"),
|
||||||
|
paper_bg = FALSE) {
|
||||||
|
|
||||||
|
theme_civilytics(
|
||||||
|
font_size = font_size,
|
||||||
|
font_family = font_family,
|
||||||
|
title_family = title_family,
|
||||||
|
line_size = line_size,
|
||||||
|
rel_small = rel_small,
|
||||||
|
rel_tiny = rel_tiny,
|
||||||
|
rel_large = rel_large,
|
||||||
|
ink = ink,
|
||||||
|
paper = paper,
|
||||||
|
accent = accent,
|
||||||
|
strip_color = strip_color,
|
||||||
|
grid = grid,
|
||||||
|
paper_bg = paper_bg
|
||||||
|
) +
|
||||||
|
ggplot2::theme(
|
||||||
|
axis.line.x = ggplot2::element_line(
|
||||||
|
color = ink,
|
||||||
|
linewidth = 0.8,
|
||||||
|
lineend = "square"
|
||||||
|
),
|
||||||
|
plot.margin = ggplot2::margin(24, 24, 24, 24)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# -- Map themes ----------------------------------------------------------------
|
||||||
|
|
||||||
|
#' Shared map-theme overrides
|
||||||
|
#'
|
||||||
|
#' Strips away axes, ticks, gridlines, and axis titles/labels — the elements
|
||||||
|
#' that are meaningless on a choropleth or spatial plot.
|
||||||
|
#'
|
||||||
|
#' @return A partial ggplot2 [ggplot2::theme()] object.
|
||||||
|
#' @keywords internal
|
||||||
|
.map_theme_extras <- function() {
|
||||||
|
ggplot2::theme(
|
||||||
|
axis.line = ggplot2::element_blank(),
|
||||||
|
axis.line.x = ggplot2::element_blank(),
|
||||||
|
axis.line.y = ggplot2::element_blank(),
|
||||||
|
axis.text = ggplot2::element_blank(),
|
||||||
|
axis.text.x = ggplot2::element_blank(),
|
||||||
|
axis.text.y = ggplot2::element_blank(),
|
||||||
|
axis.ticks = ggplot2::element_blank(),
|
||||||
|
axis.ticks.length = ggplot2::unit(0, "pt"),
|
||||||
|
axis.title.x = ggplot2::element_blank(),
|
||||||
|
axis.title.y = ggplot2::element_blank(),
|
||||||
|
panel.grid.major.x = ggplot2::element_blank(),
|
||||||
|
panel.grid.major.y = ggplot2::element_blank(),
|
||||||
|
panel.grid.minor = ggplot2::element_blank()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Map-friendly Civilytics ggplot2 theme
|
||||||
|
#'
|
||||||
|
#' Variant of [theme_civilytics()] for choropleths and spatial plots.
|
||||||
|
#' Suppresses axes, axis labels, ticks, and gridlines while keeping the
|
||||||
|
#' Civilytics brand typography, colors, and plot-level elements (title,
|
||||||
|
#' subtitle, caption, legend).
|
||||||
|
#'
|
||||||
|
#' @inheritParams theme_civilytics
|
||||||
|
#'
|
||||||
|
#' @return A complete ggplot2 [ggplot2::theme()] object.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' library(ggplot2)
|
||||||
|
#' # With sf data:
|
||||||
|
#' ggplot(map_data) +
|
||||||
|
#' geom_sf(aes(fill = value)) +
|
||||||
|
#' scale_fill_civilytics_c("seq_navy") +
|
||||||
|
#' theme_civilytics_map()
|
||||||
|
#' }
|
||||||
|
theme_civilytics_map <- function(
|
||||||
|
font_size = 14,
|
||||||
|
font_family = CV_FONT_SANS,
|
||||||
|
title_family = CV_FONT_DISPLAY,
|
||||||
|
line_size = 0.5,
|
||||||
|
rel_small = 12 / 14,
|
||||||
|
rel_tiny = 11 / 14,
|
||||||
|
rel_large = 20 / 14,
|
||||||
|
ink = unname(civilytics_colors["ink"]),
|
||||||
|
paper = unname(civilytics_colors["paper"]),
|
||||||
|
accent = unname(civilytics_colors["ember_600"]),
|
||||||
|
strip_color = unname(civilytics_colors["paper_2"]),
|
||||||
|
paper_bg = TRUE) {
|
||||||
|
|
||||||
|
theme_civilytics(
|
||||||
|
font_size = font_size,
|
||||||
|
font_family = font_family,
|
||||||
|
title_family = title_family,
|
||||||
|
line_size = line_size,
|
||||||
|
rel_small = rel_small,
|
||||||
|
rel_tiny = rel_tiny,
|
||||||
|
rel_large = rel_large,
|
||||||
|
ink = ink,
|
||||||
|
paper = paper,
|
||||||
|
accent = accent,
|
||||||
|
strip_color = strip_color,
|
||||||
|
grid = "none",
|
||||||
|
paper_bg = paper_bg
|
||||||
|
) + .map_theme_extras()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Dark map-friendly Civilytics ggplot2 theme
|
||||||
|
#'
|
||||||
|
#' Variant of [theme_civilytics_dark()] for choropleths and spatial plots.
|
||||||
|
#' Suppresses axes, axis labels, ticks, and gridlines on a dark navy
|
||||||
|
#' background. Pair with `make_logo_grob(variant = "dark")`.
|
||||||
|
#'
|
||||||
|
#' @inheritParams theme_civilytics_dark
|
||||||
|
#'
|
||||||
|
#' @return A complete ggplot2 [ggplot2::theme()] object.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' library(ggplot2)
|
||||||
|
#' ggplot(map_data) +
|
||||||
|
#' geom_sf(aes(fill = value)) +
|
||||||
|
#' scale_fill_civilytics_c("seq_ember") +
|
||||||
|
#' theme_civilytics_dark_map()
|
||||||
|
#' }
|
||||||
|
theme_civilytics_dark_map <- function(
|
||||||
|
font_size = 14,
|
||||||
|
font_family = CV_FONT_SANS,
|
||||||
|
title_family = CV_FONT_DISPLAY,
|
||||||
|
line_size = 0.5,
|
||||||
|
rel_small = 12 / 14,
|
||||||
|
rel_tiny = 11 / 14,
|
||||||
|
rel_large = 20 / 14,
|
||||||
|
ink = unname(civilytics_colors["paper"]),
|
||||||
|
paper = unname(civilytics_colors["navy_700"]),
|
||||||
|
accent = unname(civilytics_colors["ember_400"]),
|
||||||
|
strip_color = unname(civilytics_colors["navy_600"]),
|
||||||
|
paper_bg = TRUE) {
|
||||||
|
|
||||||
|
theme_civilytics_dark(
|
||||||
|
font_size = font_size,
|
||||||
|
font_family = font_family,
|
||||||
|
title_family = title_family,
|
||||||
|
line_size = line_size,
|
||||||
|
rel_small = rel_small,
|
||||||
|
rel_tiny = rel_tiny,
|
||||||
|
rel_large = rel_large,
|
||||||
|
ink = ink,
|
||||||
|
paper = paper,
|
||||||
|
accent = accent,
|
||||||
|
strip_color = strip_color,
|
||||||
|
grid = "none",
|
||||||
|
paper_bg = paper_bg
|
||||||
|
) + .map_theme_extras()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#' Slide-friendly map Civilytics ggplot2 theme
|
||||||
|
#'
|
||||||
|
#' Variant of [theme_civilytics_slide()] for choropleths and spatial plots
|
||||||
|
#' on slides. Combines the larger base font and transparent background of
|
||||||
|
#' the slide theme with suppressed axes, ticks, and gridlines.
|
||||||
|
#'
|
||||||
|
#' @inheritParams theme_civilytics_slide
|
||||||
|
#'
|
||||||
|
#' @return A complete ggplot2 [ggplot2::theme()] object.
|
||||||
|
#' @export
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
|
#' library(ggplot2)
|
||||||
|
#' ggplot(map_data) +
|
||||||
|
#' geom_sf(aes(fill = value)) +
|
||||||
|
#' scale_fill_civilytics_c("seq_navy") +
|
||||||
|
#' theme_civilytics_slide_map()
|
||||||
|
#' }
|
||||||
|
theme_civilytics_slide_map <- function(
|
||||||
|
font_size = 18,
|
||||||
|
font_family = CV_FONT_SANS,
|
||||||
|
title_family = CV_FONT_DISPLAY,
|
||||||
|
line_size = 0.5,
|
||||||
|
rel_small = 12 / 14,
|
||||||
|
rel_tiny = 11 / 14,
|
||||||
|
rel_large = 20 / 14,
|
||||||
|
ink = unname(civilytics_colors["ink"]),
|
||||||
|
paper = unname(civilytics_colors["paper"]),
|
||||||
|
accent = unname(civilytics_colors["ember_600"]),
|
||||||
|
strip_color = unname(civilytics_colors["paper_2"]),
|
||||||
|
paper_bg = FALSE) {
|
||||||
|
|
||||||
|
theme_civilytics_slide(
|
||||||
|
font_size = font_size,
|
||||||
|
font_family = font_family,
|
||||||
|
title_family = title_family,
|
||||||
|
line_size = line_size,
|
||||||
|
rel_small = rel_small,
|
||||||
|
rel_tiny = rel_tiny,
|
||||||
|
rel_large = rel_large,
|
||||||
|
ink = ink,
|
||||||
|
paper = paper,
|
||||||
|
accent = accent,
|
||||||
|
strip_color = strip_color,
|
||||||
|
grid = "none",
|
||||||
|
paper_bg = paper_bg
|
||||||
|
) + .map_theme_extras()
|
||||||
|
}
|
||||||
@@ -149,6 +149,9 @@ race_short_names <- function(x) {
|
|||||||
#' Sum a numeric that contains missing values and ignore missing values
|
#' Sum a numeric that contains missing values and ignore missing values
|
||||||
#'
|
#'
|
||||||
#' @param x a numeric vector
|
#' @param x a numeric vector
|
||||||
|
#' @param quiet Logical. If `TRUE` (default `FALSE`), suppress the warning
|
||||||
|
#' message. Useful when calling `na_sum()` inside a loop or `dplyr` pipeline
|
||||||
|
#' where the message would be emitted repeatedly.
|
||||||
#'
|
#'
|
||||||
#' @return the sum, ignoring any missing values
|
#' @return the sum, ignoring any missing values
|
||||||
#' @export
|
#' @export
|
||||||
@@ -156,9 +159,12 @@ race_short_names <- function(x) {
|
|||||||
#' @examples
|
#' @examples
|
||||||
#' x <- c(2, NA, 4, 9)
|
#' x <- c(2, NA, 4, 9)
|
||||||
#' na_sum(x) # 15
|
#' na_sum(x) # 15
|
||||||
na_sum <- function(x) {
|
#' na_sum(x, quiet = TRUE) # 15 (no message)
|
||||||
|
na_sum <- function(x, quiet = FALSE) {
|
||||||
stopifnot(is.numeric(x))
|
stopifnot(is.numeric(x))
|
||||||
message("Taking a sum with missing values equal to 0, be careful!")
|
if (!quiet) {
|
||||||
|
message("Taking a sum with missing values equal to 0, be careful!")
|
||||||
|
}
|
||||||
x <- na_zero(x)
|
x <- na_zero(x)
|
||||||
return(sum(x))
|
return(sum(x))
|
||||||
}
|
}
|
||||||
@@ -171,7 +177,6 @@ na_sum <- function(x) {
|
|||||||
#' Title
|
#' Title
|
||||||
#'
|
#'
|
||||||
#' @param x a vector of state names
|
#' @param x a vector of state names
|
||||||
## #' @importFrom datasets state.abb state.name
|
|
||||||
#' @return state abbreviations matching state naems provided in X
|
#' @return state abbreviations matching state naems provided in X
|
||||||
#' @export
|
#' @export
|
||||||
#'
|
#'
|
||||||
@@ -234,14 +239,21 @@ outersect <- function(x, y, ...) {
|
|||||||
#' @param stabbr a two letter abbreviation for a US state
|
#' @param stabbr a two letter abbreviation for a US state
|
||||||
#'
|
#'
|
||||||
#' @return FIPS codes that match the abbreviation
|
#' @return FIPS codes that match the abbreviation
|
||||||
#' @import tidycensus
|
|
||||||
#' @export
|
#' @export
|
||||||
#'
|
#'
|
||||||
#' @examples
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
#' get_fips("MT")
|
#' get_fips("MT")
|
||||||
#' get_fips("PR")
|
#' get_fips("PR")
|
||||||
#' get_fips("CC")
|
#' }
|
||||||
get_fips <- function(stabbr) {
|
get_fips <- function(stabbr) {
|
||||||
|
if (!requireNamespace("tidycensus", quietly = TRUE)) {
|
||||||
|
stop(
|
||||||
|
"Package 'tidycensus' is required for get_fips(). ",
|
||||||
|
"Install it with: install.packages('tidycensus')",
|
||||||
|
call. = FALSE
|
||||||
|
)
|
||||||
|
}
|
||||||
fips <- tidycensus::fips_codes[, 1:2]
|
fips <- tidycensus::fips_codes[, 1:2]
|
||||||
fips <- fips[!duplicated(fips),]
|
fips <- fips[!duplicated(fips),]
|
||||||
out <- fips[fips$state == stabbr, 2]
|
out <- fips[fips$state == stabbr, 2]
|
||||||
@@ -253,12 +265,20 @@ get_fips <- function(stabbr) {
|
|||||||
#' @param fips a character value that captures the FIPS code with leading 0
|
#' @param fips a character value that captures the FIPS code with leading 0
|
||||||
#'
|
#'
|
||||||
#' @return a character value, length 2, with the state abbreviation
|
#' @return a character value, length 2, with the state abbreviation
|
||||||
#' @import tidycensus
|
|
||||||
#' @export
|
#' @export
|
||||||
#'
|
#'
|
||||||
#' @examples
|
#' @examples
|
||||||
|
#' \dontrun{
|
||||||
#' get_stabbr("06")
|
#' get_stabbr("06")
|
||||||
|
#' }
|
||||||
get_stabbr <- function(fips) {
|
get_stabbr <- function(fips) {
|
||||||
|
if (!requireNamespace("tidycensus", quietly = TRUE)) {
|
||||||
|
stop(
|
||||||
|
"Package 'tidycensus' is required for get_stabbr(). ",
|
||||||
|
"Install it with: install.packages('tidycensus')",
|
||||||
|
call. = FALSE
|
||||||
|
)
|
||||||
|
}
|
||||||
fips_codes <- tidycensus::fips_codes[, 1:2]
|
fips_codes <- tidycensus::fips_codes[, 1:2]
|
||||||
fips_codes <- fips_codes[!duplicated(fips_codes),]
|
fips_codes <- fips_codes[!duplicated(fips_codes),]
|
||||||
if (length(fips) != 1) {
|
if (length(fips) != 1) {
|
||||||
@@ -442,6 +462,6 @@ round_to_nearest_half <- function(x) {
|
|||||||
#' @examples
|
#' @examples
|
||||||
#' rnh(c(0.2, 0.3, 0.4, 0.8, 0.09, 0.9))
|
#' rnh(c(0.2, 0.3, 0.4, 0.8, 0.09, 0.9))
|
||||||
rnh <- function(x) {
|
rnh <- function(x) {
|
||||||
tmp <- Vectorize(civilytics::round_to_nearest_half)
|
tmp <- Vectorize(round_to_nearest_half)
|
||||||
tmp(x)
|
tmp(x)
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,284 @@
|
|||||||
|
---
|
||||||
|
output: github_document
|
||||||
|
---
|
||||||
|
|
||||||
|
```{r setup, include = FALSE}
|
||||||
|
knitr::opts_chunk$set(
|
||||||
|
collapse = TRUE,
|
||||||
|
comment = "#>",
|
||||||
|
fig.path = "man/figures/README-",
|
||||||
|
dpi = 96,
|
||||||
|
out.width = "100%"
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
# civilytics
|
||||||
|
|
||||||
|
Brand themes, color palettes, and utility functions for
|
||||||
|
[Civilytics Consulting](https://www.civilytics.com). The package provides a
|
||||||
|
complete ggplot2 theme system drawn from the Civilytics design system ---
|
||||||
|
warm paper backgrounds, civic-navy ink, and editorial typography --- along
|
||||||
|
with 10 curated color palettes, logo composition helpers, and data-wrangling
|
||||||
|
utilities for public-sector analysis.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Install from the Civilytics Gitea server:
|
||||||
|
|
||||||
|
```r
|
||||||
|
# install.packages("remotes")
|
||||||
|
remotes::install_git("https://gitea.civilytics.org/Civilytics/civilyticsR.git")
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quick start
|
||||||
|
|
||||||
|
```{r quickstart, fig.height = 4, fig.width = 7, message = FALSE}
|
||||||
|
library(civilytics)
|
||||||
|
library(ggplot2)
|
||||||
|
|
||||||
|
ggplot(mpg, aes(displ, hwy, colour = class)) +
|
||||||
|
geom_point(size = 2.5) +
|
||||||
|
scale_color_civilytics() +
|
||||||
|
labs(
|
||||||
|
title = "Fuel economy by engine displacement",
|
||||||
|
subtitle = "Highway MPG vs. engine size for 234 vehicles",
|
||||||
|
caption = "Source: EPA fuel economy data (ggplot2::mpg)",
|
||||||
|
x = "Engine displacement (litres)",
|
||||||
|
y = "Highway MPG"
|
||||||
|
) +
|
||||||
|
theme_civilytics()
|
||||||
|
```
|
||||||
|
|
||||||
|
## Color palettes
|
||||||
|
|
||||||
|
The package ships 53 named brand colors in `civilytics_colors` and 10
|
||||||
|
curated palettes in `civilytics_palettes`. Use `civilytics_palette()` to
|
||||||
|
retrieve colors by name, or pass palettes directly to the ggplot2 scales.
|
||||||
|
|
||||||
|
### Palette gallery
|
||||||
|
|
||||||
|
```{r palette-gallery, echo = FALSE, fig.height = 9, fig.width = 7}
|
||||||
|
show_palette <- function(name, colors) {
|
||||||
|
n <- length(colors)
|
||||||
|
df <- data.frame(
|
||||||
|
x = seq_len(n),
|
||||||
|
fill = factor(seq_len(n), levels = seq_len(n))
|
||||||
|
)
|
||||||
|
ggplot(df, aes(x, y = 1, fill = fill)) +
|
||||||
|
geom_tile(width = 0.9, height = 0.9, show.legend = FALSE) +
|
||||||
|
scale_fill_manual(values = colors) +
|
||||||
|
scale_x_continuous(expand = expansion(add = 0.5)) +
|
||||||
|
labs(title = name) +
|
||||||
|
theme_void() +
|
||||||
|
theme(
|
||||||
|
plot.title = element_text(
|
||||||
|
family = "Libre Franklin", face = "bold", size = 11,
|
||||||
|
hjust = 0, margin = margin(b = 2)
|
||||||
|
),
|
||||||
|
plot.margin = margin(4, 4, 4, 4)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
plots <- mapply(
|
||||||
|
show_palette,
|
||||||
|
names(civilytics_palettes),
|
||||||
|
civilytics_palettes,
|
||||||
|
SIMPLIFY = FALSE
|
||||||
|
)
|
||||||
|
|
||||||
|
gridExtra::grid.arrange(grobs = plots, ncol = 1)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using palettes
|
||||||
|
|
||||||
|
```{r palette-usage, fig.height = 3.5, fig.width = 7}
|
||||||
|
# Discrete fill with the qualitative palette
|
||||||
|
ggplot(mpg, aes(class, fill = class)) +
|
||||||
|
geom_bar(show.legend = FALSE) +
|
||||||
|
scale_fill_civilytics() +
|
||||||
|
labs(title = "Vehicle counts by class", x = NULL, y = NULL) +
|
||||||
|
theme_civilytics(grid = "y")
|
||||||
|
|
||||||
|
# Continuous fill with a sequential palette
|
||||||
|
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
|
||||||
|
geom_tile() +
|
||||||
|
scale_fill_civilytics("seq_ember", discrete = FALSE) +
|
||||||
|
labs(title = "Old Faithful eruption density") +
|
||||||
|
theme_civilytics(grid = "none")
|
||||||
|
```
|
||||||
|
|
||||||
|
## Themes
|
||||||
|
|
||||||
|
Three theme variants cover the most common output contexts. All share the
|
||||||
|
same typographic structure and accept `grid` and `paper_bg` parameters.
|
||||||
|
|
||||||
|
### Editorial (default)
|
||||||
|
|
||||||
|
The default theme uses a warm paper background with horizontal gridlines ---
|
||||||
|
an editorial, Pew-style layout.
|
||||||
|
|
||||||
|
```{r theme-editorial, fig.height = 4, fig.width = 7}
|
||||||
|
base_plot <- ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
geom_point(aes(colour = factor(cyl)), size = 2) +
|
||||||
|
scale_color_civilytics() +
|
||||||
|
labs(
|
||||||
|
title = "Engine size vs. highway fuel economy",
|
||||||
|
subtitle = "Colored by number of cylinders",
|
||||||
|
caption = "Source: ggplot2::mpg",
|
||||||
|
colour = "Cylinders",
|
||||||
|
x = "Displacement (L)", y = "Highway MPG"
|
||||||
|
)
|
||||||
|
|
||||||
|
base_plot + theme_civilytics()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Grid options
|
||||||
|
|
||||||
|
The `grid` parameter controls which major gridlines are drawn.
|
||||||
|
|
||||||
|
```{r theme-grids, echo = FALSE, fig.height = 6.5, fig.width = 7}
|
||||||
|
grid_opts <- c("y", "x", "both", "none")
|
||||||
|
grid_plots <- lapply(grid_opts, function(g) {
|
||||||
|
base_plot +
|
||||||
|
theme_civilytics(grid = g) +
|
||||||
|
labs(title = paste0("grid = \"", g, "\""), subtitle = NULL, caption = NULL)
|
||||||
|
})
|
||||||
|
gridExtra::grid.arrange(grobs = grid_plots, ncol = 2)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dark
|
||||||
|
|
||||||
|
Dark navy background with light text, suitable for presentations or
|
||||||
|
dashboards on dark surfaces.
|
||||||
|
|
||||||
|
```{r theme-dark, fig.height = 4, fig.width = 7}
|
||||||
|
base_plot + theme_civilytics_dark()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Slide
|
||||||
|
|
||||||
|
Transparent background and larger base font (18 pt), sized for Reveal.js
|
||||||
|
slides or PowerPoint exports.
|
||||||
|
|
||||||
|
```{r theme-slide, fig.height = 4, fig.width = 7}
|
||||||
|
base_plot + theme_civilytics_slide()
|
||||||
|
```
|
||||||
|
|
||||||
|
### Facets
|
||||||
|
|
||||||
|
Facet strips use the `paper_2` tint, with the title font.
|
||||||
|
|
||||||
|
```{r theme-facets, fig.height = 5, fig.width = 7}
|
||||||
|
ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
geom_point(colour = civilytics_colors["navy_600"], size = 1.5) +
|
||||||
|
facet_wrap(~class, ncol = 4) +
|
||||||
|
labs(
|
||||||
|
title = "Highway MPG by vehicle class",
|
||||||
|
x = "Displacement (L)", y = "Highway MPG"
|
||||||
|
) +
|
||||||
|
theme_civilytics(grid = "y")
|
||||||
|
```
|
||||||
|
|
||||||
|
## Logo utilities
|
||||||
|
|
||||||
|
Add the Civilytics logo to any ggplot using the pipe-friendly
|
||||||
|
`civilytics_logo()` or the lower-level `add_logo()` / `make_logo_grob()`.
|
||||||
|
The logo is automatically right-aligned below the plot area. Wrap the
|
||||||
|
ggplot chain in parentheses before piping --- R's `|>` binds tighter
|
||||||
|
than `+`.
|
||||||
|
|
||||||
|
### Wordmark on a light plot
|
||||||
|
|
||||||
|
```{r logo-wordmark, fig.height = 4.5, fig.width = 7}
|
||||||
|
p <- ggplot(mpg, aes(displ, hwy, colour = class)) +
|
||||||
|
geom_point(size = 2) +
|
||||||
|
scale_color_civilytics() +
|
||||||
|
labs(
|
||||||
|
title = "Fuel economy by engine displacement",
|
||||||
|
caption = "Source: EPA fuel economy data (ggplot2::mpg)",
|
||||||
|
x = "Displacement (L)", y = "Highway MPG"
|
||||||
|
) +
|
||||||
|
theme_civilytics()
|
||||||
|
|
||||||
|
grid::grid.draw(civilytics_logo(p))
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compact mark
|
||||||
|
|
||||||
|
Use `type = "mark"` for the compact C-pulse icon instead of the full
|
||||||
|
wordmark.
|
||||||
|
|
||||||
|
```{r logo-mark, fig.height = 4.5, fig.width = 7}
|
||||||
|
p2_logo <- ggplot(mpg, aes(displ, hwy, colour = factor(cyl))) +
|
||||||
|
geom_point(size = 2) +
|
||||||
|
scale_color_civilytics() +
|
||||||
|
labs(
|
||||||
|
title = "Engine size vs. highway fuel economy",
|
||||||
|
colour = "Cylinders",
|
||||||
|
x = "Displacement (L)", y = "Highway MPG"
|
||||||
|
) +
|
||||||
|
theme_civilytics()
|
||||||
|
|
||||||
|
grid::grid.draw(civilytics_logo(p2_logo, type = "mark"))
|
||||||
|
```
|
||||||
|
|
||||||
|
### Multi-plot layout with logo
|
||||||
|
|
||||||
|
Use `add_logo_ga()` to attach a single logo below a row of plots.
|
||||||
|
|
||||||
|
```{r logo-multi, fig.height = 4.5, fig.width = 9}
|
||||||
|
p1 <- ggplot(mpg, aes(class, fill = class)) +
|
||||||
|
geom_bar(show.legend = FALSE) +
|
||||||
|
scale_fill_civilytics() +
|
||||||
|
labs(title = "Vehicle counts", x = NULL, y = NULL) +
|
||||||
|
theme_civilytics(grid = "y")
|
||||||
|
|
||||||
|
p2 <- ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
geom_point(colour = civilytics_colors["navy_600"], size = 1.5) +
|
||||||
|
labs(title = "Displacement vs. MPG", x = "Displacement (L)", y = "Highway MPG") +
|
||||||
|
theme_civilytics(grid = "y")
|
||||||
|
|
||||||
|
logo <- make_logo_grob()
|
||||||
|
grid::grid.draw(add_logo_ga(list(p1, p2), logo))
|
||||||
|
```
|
||||||
|
|
||||||
|
## Other utilities
|
||||||
|
|
||||||
|
The package also includes helpers for public-sector data analysis:
|
||||||
|
|
||||||
|
| Function | Purpose |
|
||||||
|
|:---------|:--------|
|
||||||
|
| `pretty_count()` / `pretty_per()` | Format numbers and percentages |
|
||||||
|
| `grade_level_to_num()` | Convert grade labels (KG, 01--12) to numeric |
|
||||||
|
| `race_short_names()` | Standardize NCES race/ethnicity categories |
|
||||||
|
| `get_fips()` / `get_stabbr()` | State FIPS code lookups |
|
||||||
|
| `clopper_pearson()` / `agresti_coull_interval()` | Proportion confidence intervals |
|
||||||
|
| `match_test()` / `trunc_match()` | Fuzzy join diagnostics |
|
||||||
|
| `perturb_count()` / `random_round()` | Privacy-preserving data perturbation |
|
||||||
|
|
||||||
|
## Maintaining brand assets
|
||||||
|
|
||||||
|
Logo and brand mark files live in `inst/img/`. The package ships both
|
||||||
|
PNG (for ggplot2 raster composition) and SVG (for Quarto/HTML output)
|
||||||
|
variants:
|
||||||
|
|
||||||
|
| File | Format | Used by |
|
||||||
|
|:-----|:-------|:--------|
|
||||||
|
| `civilytics-wordmark.png` / `.svg` | Full "Civilytics" lockup | `make_logo_grob("wordmark", "light")`, Quarto templates |
|
||||||
|
| `civilytics-wordmark-reverse.png` / `.svg` | Light-on-dark wordmark | `make_logo_grob("wordmark", "dark")`, dark slides |
|
||||||
|
| `civilytics-mark.png` / `.svg` | Compact C-pulse icon | `make_logo_grob("mark", "light")` |
|
||||||
|
| `civilytics-mark-reverse.svg` | Light-on-dark mark | `make_logo_grob("mark", "dark")` |
|
||||||
|
| `civilytics-pulse.svg` | Standalone waveform glyph | Quarto slide footer chrome |
|
||||||
|
|
||||||
|
To update the logos, replace the files in `inst/img/` with new versions
|
||||||
|
using the same filenames. The PNG files must be raster images (the
|
||||||
|
ggplot2 logo functions read them via `png::readPNG()`). SVG files are
|
||||||
|
passed through as-is by Quarto and HTML templates.
|
||||||
|
|
||||||
|
After replacing files, re-render the README gallery to update the
|
||||||
|
screenshots:
|
||||||
|
|
||||||
|
```r
|
||||||
|
devtools::load_all()
|
||||||
|
rmarkdown::render("README.Rmd")
|
||||||
|
```
|
||||||
@@ -1,25 +1,258 @@
|
|||||||
|
|
||||||
# civilytics
|
# civilytics
|
||||||
|
|
||||||
<!-- badges: start -->
|
Brand themes, color palettes, and utility functions for [Civilytics
|
||||||
<!-- badges: end -->
|
Consulting](https://www.civilytics.com). The package provides a complete
|
||||||
|
ggplot2 theme system drawn from the Civilytics design system — warm
|
||||||
The goal of civilytics is to ...
|
paper backgrounds, civic-navy ink, and editorial typography — along with
|
||||||
|
10 curated color palettes, logo composition helpers, and data-wrangling
|
||||||
## Installation
|
utilities for public-sector analysis.
|
||||||
|
|
||||||
You can install the released version of civilytics from [CRAN](https://CRAN.R-project.org) with:
|
## Installation
|
||||||
|
|
||||||
``` r
|
Install from the Civilytics Gitea server:
|
||||||
install.packages("civilytics")
|
|
||||||
```
|
``` r
|
||||||
|
# install.packages("remotes")
|
||||||
## Example
|
remotes::install_git("https://gitea.civilytics.org/Civilytics/civilyticsR.git")
|
||||||
|
```
|
||||||
This is a basic example which shows you how to solve a common problem:
|
|
||||||
|
## Quick start
|
||||||
``` r
|
|
||||||
library(civilytics)
|
``` r
|
||||||
## basic example code
|
library(civilytics)
|
||||||
```
|
library(ggplot2)
|
||||||
|
|
||||||
|
ggplot(mpg, aes(displ, hwy, colour = class)) +
|
||||||
|
geom_point(size = 2.5) +
|
||||||
|
scale_color_civilytics() +
|
||||||
|
labs(
|
||||||
|
title = "Fuel economy by engine displacement",
|
||||||
|
subtitle = "Highway MPG vs. engine size for 234 vehicles",
|
||||||
|
caption = "Source: EPA fuel economy data (ggplot2::mpg)",
|
||||||
|
x = "Engine displacement (litres)",
|
||||||
|
y = "Highway MPG"
|
||||||
|
) +
|
||||||
|
theme_civilytics()
|
||||||
|
```
|
||||||
|
|
||||||
|
<img src="man/figures/README-quickstart-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
## Color palettes
|
||||||
|
|
||||||
|
The package ships 53 named brand colors in `civilytics_colors` and 10
|
||||||
|
curated palettes in `civilytics_palettes`. Use `civilytics_palette()` to
|
||||||
|
retrieve colors by name, or pass palettes directly to the ggplot2
|
||||||
|
scales.
|
||||||
|
|
||||||
|
### Palette gallery
|
||||||
|
|
||||||
|
<img src="man/figures/README-palette-gallery-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
### Using palettes
|
||||||
|
|
||||||
|
``` r
|
||||||
|
# Discrete fill with the qualitative palette
|
||||||
|
ggplot(mpg, aes(class, fill = class)) +
|
||||||
|
geom_bar(show.legend = FALSE) +
|
||||||
|
scale_fill_civilytics() +
|
||||||
|
labs(title = "Vehicle counts by class", x = NULL, y = NULL) +
|
||||||
|
theme_civilytics(grid = "y")
|
||||||
|
```
|
||||||
|
|
||||||
|
<img src="man/figures/README-palette-usage-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
``` r
|
||||||
|
|
||||||
|
# Continuous fill with a sequential palette
|
||||||
|
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
|
||||||
|
geom_tile() +
|
||||||
|
scale_fill_civilytics("seq_ember", discrete = FALSE) +
|
||||||
|
labs(title = "Old Faithful eruption density") +
|
||||||
|
theme_civilytics(grid = "none")
|
||||||
|
```
|
||||||
|
|
||||||
|
<img src="man/figures/README-palette-usage-2.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
## Themes
|
||||||
|
|
||||||
|
Three theme variants cover the most common output contexts. All share
|
||||||
|
the same typographic structure and accept `grid` and `paper_bg`
|
||||||
|
parameters.
|
||||||
|
|
||||||
|
### Editorial (default)
|
||||||
|
|
||||||
|
The default theme uses a warm paper background with horizontal gridlines
|
||||||
|
— an editorial, Pew-style layout.
|
||||||
|
|
||||||
|
``` r
|
||||||
|
base_plot <- ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
geom_point(aes(colour = factor(cyl)), size = 2) +
|
||||||
|
scale_color_civilytics() +
|
||||||
|
labs(
|
||||||
|
title = "Engine size vs. highway fuel economy",
|
||||||
|
subtitle = "Colored by number of cylinders",
|
||||||
|
caption = "Source: ggplot2::mpg",
|
||||||
|
colour = "Cylinders",
|
||||||
|
x = "Displacement (L)", y = "Highway MPG"
|
||||||
|
)
|
||||||
|
|
||||||
|
base_plot + theme_civilytics()
|
||||||
|
```
|
||||||
|
|
||||||
|
<img src="man/figures/README-theme-editorial-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
### Grid options
|
||||||
|
|
||||||
|
The `grid` parameter controls which major gridlines are drawn.
|
||||||
|
|
||||||
|
<img src="man/figures/README-theme-grids-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
### Dark
|
||||||
|
|
||||||
|
Dark navy background with light text, suitable for presentations or
|
||||||
|
dashboards on dark surfaces.
|
||||||
|
|
||||||
|
``` r
|
||||||
|
base_plot + theme_civilytics_dark()
|
||||||
|
```
|
||||||
|
|
||||||
|
<img src="man/figures/README-theme-dark-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
### Slide
|
||||||
|
|
||||||
|
Transparent background and larger base font (18 pt), sized for Reveal.js
|
||||||
|
slides or PowerPoint exports.
|
||||||
|
|
||||||
|
``` r
|
||||||
|
base_plot + theme_civilytics_slide()
|
||||||
|
```
|
||||||
|
|
||||||
|
<img src="man/figures/README-theme-slide-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
### Facets
|
||||||
|
|
||||||
|
Facet strips use the `paper_2` tint, with the title font.
|
||||||
|
|
||||||
|
``` r
|
||||||
|
ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
geom_point(colour = civilytics_colors["navy_600"], size = 1.5) +
|
||||||
|
facet_wrap(~class, ncol = 4) +
|
||||||
|
labs(
|
||||||
|
title = "Highway MPG by vehicle class",
|
||||||
|
x = "Displacement (L)", y = "Highway MPG"
|
||||||
|
) +
|
||||||
|
theme_civilytics(grid = "y")
|
||||||
|
```
|
||||||
|
|
||||||
|
<img src="man/figures/README-theme-facets-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
## Logo utilities
|
||||||
|
|
||||||
|
Add the Civilytics logo to any ggplot using the pipe-friendly
|
||||||
|
`civilytics_logo()` or the lower-level `add_logo()` /
|
||||||
|
`make_logo_grob()`. The logo is automatically right-aligned below the
|
||||||
|
plot area. Wrap the ggplot chain in parentheses before piping — R’s `|>`
|
||||||
|
binds tighter than `+`.
|
||||||
|
|
||||||
|
### Wordmark on a light plot
|
||||||
|
|
||||||
|
``` r
|
||||||
|
p <- ggplot(mpg, aes(displ, hwy, colour = class)) +
|
||||||
|
geom_point(size = 2) +
|
||||||
|
scale_color_civilytics() +
|
||||||
|
labs(
|
||||||
|
title = "Fuel economy by engine displacement",
|
||||||
|
caption = "Source: EPA fuel economy data (ggplot2::mpg)",
|
||||||
|
x = "Displacement (L)", y = "Highway MPG"
|
||||||
|
) +
|
||||||
|
theme_civilytics()
|
||||||
|
|
||||||
|
grid::grid.draw(civilytics_logo(p))
|
||||||
|
```
|
||||||
|
|
||||||
|
<img src="man/figures/README-logo-wordmark-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
### Compact mark
|
||||||
|
|
||||||
|
Use `type = "mark"` for the compact C-pulse icon instead of the full
|
||||||
|
wordmark.
|
||||||
|
|
||||||
|
``` r
|
||||||
|
p2_logo <- ggplot(mpg, aes(displ, hwy, colour = factor(cyl))) +
|
||||||
|
geom_point(size = 2) +
|
||||||
|
scale_color_civilytics() +
|
||||||
|
labs(
|
||||||
|
title = "Engine size vs. highway fuel economy",
|
||||||
|
colour = "Cylinders",
|
||||||
|
x = "Displacement (L)", y = "Highway MPG"
|
||||||
|
) +
|
||||||
|
theme_civilytics()
|
||||||
|
|
||||||
|
grid::grid.draw(civilytics_logo(p2_logo, type = "mark"))
|
||||||
|
```
|
||||||
|
|
||||||
|
<img src="man/figures/README-logo-mark-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
### Multi-plot layout with logo
|
||||||
|
|
||||||
|
Use `add_logo_ga()` to attach a single logo below a row of plots.
|
||||||
|
|
||||||
|
``` r
|
||||||
|
p1 <- ggplot(mpg, aes(class, fill = class)) +
|
||||||
|
geom_bar(show.legend = FALSE) +
|
||||||
|
scale_fill_civilytics() +
|
||||||
|
labs(title = "Vehicle counts", x = NULL, y = NULL) +
|
||||||
|
theme_civilytics(grid = "y")
|
||||||
|
|
||||||
|
p2 <- ggplot(mpg, aes(displ, hwy)) +
|
||||||
|
geom_point(colour = civilytics_colors["navy_600"], size = 1.5) +
|
||||||
|
labs(title = "Displacement vs. MPG", x = "Displacement (L)", y = "Highway MPG") +
|
||||||
|
theme_civilytics(grid = "y")
|
||||||
|
|
||||||
|
logo <- make_logo_grob()
|
||||||
|
grid::grid.draw(add_logo_ga(list(p1, p2), logo))
|
||||||
|
```
|
||||||
|
|
||||||
|
<img src="man/figures/README-logo-multi-1.png" alt="" width="100%" />
|
||||||
|
|
||||||
|
## Other utilities
|
||||||
|
|
||||||
|
The package also includes helpers for public-sector data analysis:
|
||||||
|
|
||||||
|
| Function | Purpose |
|
||||||
|
|:---|:---|
|
||||||
|
| `pretty_count()` / `pretty_per()` | Format numbers and percentages |
|
||||||
|
| `grade_level_to_num()` | Convert grade labels (KG, 01–12) to numeric |
|
||||||
|
| `race_short_names()` | Standardize NCES race/ethnicity categories |
|
||||||
|
| `get_fips()` / `get_stabbr()` | State FIPS code lookups |
|
||||||
|
| `clopper_pearson()` / `agresti_coull_interval()` | Proportion confidence intervals |
|
||||||
|
| `match_test()` / `trunc_match()` | Fuzzy join diagnostics |
|
||||||
|
| `perturb_count()` / `random_round()` | Privacy-preserving data perturbation |
|
||||||
|
|
||||||
|
## Maintaining brand assets
|
||||||
|
|
||||||
|
Logo and brand mark files live in `inst/img/`. The package ships both
|
||||||
|
PNG (for ggplot2 raster composition) and SVG (for Quarto/HTML output)
|
||||||
|
variants:
|
||||||
|
|
||||||
|
| File | Format | Used by |
|
||||||
|
|:---|:---|:---|
|
||||||
|
| `civilytics-wordmark.png` / `.svg` | Full “Civilytics” lockup | `make_logo_grob("wordmark", "light")`, Quarto templates |
|
||||||
|
| `civilytics-wordmark-reverse.png` / `.svg` | Light-on-dark wordmark | `make_logo_grob("wordmark", "dark")`, dark slides |
|
||||||
|
| `civilytics-mark.png` / `.svg` | Compact C-pulse icon | `make_logo_grob("mark", "light")` |
|
||||||
|
| `civilytics-mark-reverse.svg` | Light-on-dark mark | `make_logo_grob("mark", "dark")` |
|
||||||
|
| `civilytics-pulse.svg` | Standalone waveform glyph | Quarto slide footer chrome |
|
||||||
|
|
||||||
|
To update the logos, replace the files in `inst/img/` with new versions
|
||||||
|
using the same filenames. The PNG files must be raster images (the
|
||||||
|
ggplot2 logo functions read them via `png::readPNG()`). SVG files are
|
||||||
|
passed through as-is by Quarto and HTML templates.
|
||||||
|
|
||||||
|
After replacing files, re-render the README gallery to update the
|
||||||
|
screenshots:
|
||||||
|
|
||||||
|
``` r
|
||||||
|
devtools::load_all()
|
||||||
|
rmarkdown::render("README.Rmd")
|
||||||
|
```
|
||||||
|
After Width: | Height: | Size: 149 KiB |
@@ -0,0 +1,7 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" role="img" aria-label="Civilytics mark">
|
||||||
|
<rect width="100" height="100" fill="#0E1A2B"></rect>
|
||||||
|
<g fill="none" stroke="#FAF7F2" stroke-linecap="butt">
|
||||||
|
<path d="M 82.77 27.06 A 40 40 0 1 0 82.77 72.94" stroke-width="15"></path>
|
||||||
|
<path d="M 30 50 L 35 50 L 38 44 L 42 56 L 46 42 L 50 58 L 54 50 L 64 50" stroke-width="3.5" stroke-linecap="square"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 438 B |
|
After Width: | Height: | Size: 20 KiB |
@@ -0,0 +1,7 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" role="img" aria-label="Civilytics mark">
|
||||||
|
|
||||||
|
<g fill="none" stroke="#0E1A2B" stroke-linecap="butt">
|
||||||
|
<path d="M 82.77 27.06 A 40 40 0 1 0 82.77 72.94" stroke-width="15"></path>
|
||||||
|
<path d="M 30 50 L 35 50 L 38 44 L 42 56 L 46 42 L 50 58 L 54 50 L 64 50" stroke-width="3.5" stroke-linecap="square"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 385 B |
@@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 14" role="img" aria-label="Civic pulse">
|
||||||
|
<path d="M0 8 L5 8 L8 3 L12 13 L16 1 L20 11 L23 8 L30 8" fill="none" stroke="#0E1A2B" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter"></path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 264 B |
|
After Width: | Height: | Size: 69 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 558 160" role="img" aria-label="Civilytics">
|
||||||
|
<rect width="558" height="160" fill="#0E1A2B"></rect><path fill="#FAF7F2" d="M43.12 33.78Q50.18 33.78 56.17 35.68Q62.16 37.58 66.81 41.06Q71.46 44.53 74.42 49.23Q77.39 53.94 78.51 59.54Q79.07 61.89 78.68 62.56Q78.29 63.23 77.06 63.46L57.46 64.69Q56.22 64.69 55.89 64.18Q55.55 63.68 55.33 62.56Q54.43 57.63 51.91 54.33Q49.39 51.02 43.79 51.02Q37.52 51.02 33.77 56.57Q30.02 62.11 30.02 75.78Q30.02 89.66 33.43 95.21Q36.85 100.75 43.68 100.75Q49.28 100.75 53.59 97.9Q57.9 95.04 60.82 87.65Q61.38 86.3 63.95 86.75L77.95 89.55Q78.51 89.66 79.18 90.34Q79.86 91.01 79.52 93.25Q79.18 95.04 77.73 98.18Q76.27 101.31 73.58 104.95Q70.9 108.59 66.64 111.78Q62.38 114.98 56.5 117.05Q50.62 119.12 42.9 119.12Q30.91 119.12 22.01 113.46Q13.1 107.81 8.23 97.9Q3.36 87.98 3.36 75.33Q3.36 62.67 8.23 53.38Q13.1 44.08 22.06 38.93Q31.02 33.78 43.12 33.78Z M104.54 114.75Q104.54 116.54 103.64 117.27Q102.74 118 100.84 118L85.05 118Q83.37 118 82.75 117.33Q82.14 116.66 82.14 115.2L82.14 61.22Q82.14 58.64 84.26 58.64L102.52 58.64Q104.54 58.64 104.54 60.88ZM104.54 50.46Q104.54 53.71 100.84 53.71L85.05 53.71Q83.37 53.71 82.75 52.98Q82.14 52.26 82.14 50.8L82.14 37.47Q82.14 34.9 84.26 34.9L102.52 34.9Q104.54 34.9 104.54 37.25Z M166.51 58.64Q167.86 58.64 168.36 59.65Q168.86 60.66 168.42 61.89L146.58 115.2Q145.46 118 142.43 118L131.9 118Q128.88 118 127.76 115.2L106.03 61.89Q105.58 60.66 106.2 59.65Q106.82 58.64 108.16 58.64L127.09 58.64Q128.1 58.64 128.88 59.31Q129.66 59.98 130 60.88L139.86 86.75Q140.53 88.88 141.54 86.64L151.06 60.88Q151.5 59.98 152.23 59.31Q152.96 58.64 153.97 58.64L166.51 58.64Z M192.31 114.75Q192.31 116.54 191.42 117.27Q190.52 118 188.62 118L172.82 118Q171.14 118 170.53 117.33Q169.91 116.66 169.91 115.2L169.91 61.22Q169.91 58.64 172.04 58.64L190.3 58.64Q192.31 58.64 192.31 60.88ZM192.31 50.46Q192.31 53.71 188.62 53.71L172.82 53.71Q171.14 53.71 170.53 52.98Q169.91 52.26 169.91 50.8L169.91 37.47Q169.91 34.9 172.04 34.9L190.3 34.9Q192.31 34.9 192.31 37.25Z M219.01 114.75Q219.01 116.54 218.11 117.27Q217.22 118 215.31 118L199.41 118Q196.38 118 196.38 115.2L196.94 37.47Q196.94 34.9 199.07 34.9L216.99 34.9Q219.01 34.9 219.01 37.25Z M230.14 136.48Q226.66 136.48 225.26 136.03Q223.86 135.58 223.86 134.02L223.86 122.59Q223.86 121.92 224.54 121.19Q225.21 120.46 227 120.46L234.95 120.46Q236.86 120.46 238.42 119.9Q239.99 119.34 240.94 118.5Q241.9 117.66 242.29 116.6Q242.68 115.54 242.23 114.53L220.5 61.89Q220.06 60.66 220.67 59.65Q221.29 58.64 222.63 58.64L241.56 58.64Q242.57 58.64 243.35 59.31Q244.14 59.98 244.47 60.88L253.99 87.76Q254.33 88.77 254.89 88.82Q255.45 88.88 255.9 87.76L265.53 60.88Q265.98 59.98 266.7 59.31Q267.43 58.64 268.44 58.64L280.98 58.64Q282.33 58.64 282.89 59.65Q283.45 60.66 282.89 61.89L261.05 114.53Q258.14 121.58 255.28 125.9Q252.42 130.21 248.95 132.5Q245.48 134.8 240.94 135.64Q236.41 136.48 230.14 136.48Z M315.3 73.76Q313.84 73.76 313.84 75.22L313.84 96.72Q313.84 99.63 315.69 101.14Q317.54 102.66 321.68 102.66L326.5 102.66Q327.39 102.66 327.95 103.33Q328.51 104 328.51 104.9L328.4 113.86Q328.4 116.54 325.15 117.22Q322.69 117.55 320.17 117.72Q317.65 117.89 315.13 117.94Q312.61 118 310.03 118Q301.97 118 296.7 114.14Q291.44 110.27 291.44 103.1L291.44 75.78Q291.44 73.76 289.76 73.76L284.38 73.76Q281.7 73.76 281.7 71.3L281.7 60.77Q281.7 58.64 284.16 58.64L290.77 58.64Q292 58.64 292.11 57.3L293.9 40.72Q294.13 38.48 295.92 38.48L312.38 38.48Q314.51 38.48 314.51 40.94L314.51 57.3Q314.51 58.53 315.74 58.53L326.05 58.53Q328.51 58.53 328.51 60.66L328.51 71.3Q328.51 73.76 325.71 73.76Z M353.42 114.75Q353.42 116.54 352.52 117.27Q351.62 118 349.72 118L333.93 118Q332.25 118 331.63 117.33Q331.02 116.66 331.02 115.2L331.02 61.22Q331.02 58.64 333.14 58.64L351.4 58.64Q353.42 58.64 353.42 60.88ZM353.42 50.46Q353.42 53.71 349.72 53.71L333.93 53.71Q332.25 53.71 331.63 52.98Q331.02 52.26 331.02 50.8L331.02 37.47Q331.02 34.9 333.14 34.9L351.4 34.9Q353.42 34.9 353.42 37.25Z M386.38 57.52Q394.45 57.52 400.05 60.49Q405.65 63.46 408.9 67.82Q412.14 72.19 413.04 76.56Q413.82 79.36 411.02 79.47L395.68 80.26Q394.11 80.37 393.78 78.69Q393.55 77.23 392.99 75.61Q392.43 73.98 391.03 72.81Q389.63 71.63 386.94 71.63Q384.26 71.63 382.24 73.31Q380.22 74.99 379.1 78.63Q377.98 82.27 377.98 88.32Q377.98 94.48 379.22 98.23Q380.45 101.98 382.74 103.61Q385.04 105.23 388.18 105.23Q392.77 105.23 394.95 102.71Q397.14 100.19 399.26 96.38Q399.49 95.94 399.94 95.77Q400.38 95.6 401.5 95.82L412.03 97.84Q413.6 98.18 413.04 100.42Q412.59 102.54 410.91 105.74Q409.23 108.93 406.1 111.95Q402.96 114.98 398.09 117.05Q393.22 119.12 386.38 119.12Q377.42 119.12 370.42 115.26Q363.42 111.39 359.39 104.5Q355.36 97.62 355.36 88.54Q355.36 79.25 359.45 72.3Q363.54 65.36 370.54 61.44Q377.54 57.52 386.38 57.52Z M452.06 75.66Q450.38 73.76 447.69 72.14Q445 70.51 440.86 70.51Q437.94 70.51 435.82 71.52Q433.69 72.53 433.69 74.43Q433.69 75.22 434.42 76Q435.14 76.78 438.17 77.34L450.04 79.81Q460.46 81.94 464.66 87.2Q468.86 92.46 468.86 98.96Q468.86 105.46 465.27 109.94Q461.69 114.42 455.3 116.77QLine truncated
|
||||||
|
<path fill="none" stroke="#FAF7F2" stroke-width="5" stroke-linecap="square" stroke-linejoin="miter" d="M479.87199999999996 90 L489.87199999999996 90 L495.87199999999996 80 L503.87199999999996 104 L511.87199999999996 76 L519.872 102 L525.872 90 L547.872 90"></path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 57 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 558 160" role="img" aria-label="Civilytics">
|
||||||
|
<path fill="#0E1A2B" d="M43.12 33.78Q50.18 33.78 56.17 35.68Q62.16 37.58 66.81 41.06Q71.46 44.53 74.42 49.23Q77.39 53.94 78.51 59.54Q79.07 61.89 78.68 62.56Q78.29 63.23 77.06 63.46L57.46 64.69Q56.22 64.69 55.89 64.18Q55.55 63.68 55.33 62.56Q54.43 57.63 51.91 54.33Q49.39 51.02 43.79 51.02Q37.52 51.02 33.77 56.57Q30.02 62.11 30.02 75.78Q30.02 89.66 33.43 95.21Q36.85 100.75 43.68 100.75Q49.28 100.75 53.59 97.9Q57.9 95.04 60.82 87.65Q61.38 86.3 63.95 86.75L77.95 89.55Q78.51 89.66 79.18 90.34Q79.86 91.01 79.52 93.25Q79.18 95.04 77.73 98.18Q76.27 101.31 73.58 104.95Q70.9 108.59 66.64 111.78Q62.38 114.98 56.5 117.05Q50.62 119.12 42.9 119.12Q30.91 119.12 22.01 113.46Q13.1 107.81 8.23 97.9Q3.36 87.98 3.36 75.33Q3.36 62.67 8.23 53.38Q13.1 44.08 22.06 38.93Q31.02 33.78 43.12 33.78Z M104.54 114.75Q104.54 116.54 103.64 117.27Q102.74 118 100.84 118L85.05 118Q83.37 118 82.75 117.33Q82.14 116.66 82.14 115.2L82.14 61.22Q82.14 58.64 84.26 58.64L102.52 58.64Q104.54 58.64 104.54 60.88ZM104.54 50.46Q104.54 53.71 100.84 53.71L85.05 53.71Q83.37 53.71 82.75 52.98Q82.14 52.26 82.14 50.8L82.14 37.47Q82.14 34.9 84.26 34.9L102.52 34.9Q104.54 34.9 104.54 37.25Z M166.51 58.64Q167.86 58.64 168.36 59.65Q168.86 60.66 168.42 61.89L146.58 115.2Q145.46 118 142.43 118L131.9 118Q128.88 118 127.76 115.2L106.03 61.89Q105.58 60.66 106.2 59.65Q106.82 58.64 108.16 58.64L127.09 58.64Q128.1 58.64 128.88 59.31Q129.66 59.98 130 60.88L139.86 86.75Q140.53 88.88 141.54 86.64L151.06 60.88Q151.5 59.98 152.23 59.31Q152.96 58.64 153.97 58.64L166.51 58.64Z M192.31 114.75Q192.31 116.54 191.42 117.27Q190.52 118 188.62 118L172.82 118Q171.14 118 170.53 117.33Q169.91 116.66 169.91 115.2L169.91 61.22Q169.91 58.64 172.04 58.64L190.3 58.64Q192.31 58.64 192.31 60.88ZM192.31 50.46Q192.31 53.71 188.62 53.71L172.82 53.71Q171.14 53.71 170.53 52.98Q169.91 52.26 169.91 50.8L169.91 37.47Q169.91 34.9 172.04 34.9L190.3 34.9Q192.31 34.9 192.31 37.25Z M219.01 114.75Q219.01 116.54 218.11 117.27Q217.22 118 215.31 118L199.41 118Q196.38 118 196.38 115.2L196.94 37.47Q196.94 34.9 199.07 34.9L216.99 34.9Q219.01 34.9 219.01 37.25Z M230.14 136.48Q226.66 136.48 225.26 136.03Q223.86 135.58 223.86 134.02L223.86 122.59Q223.86 121.92 224.54 121.19Q225.21 120.46 227 120.46L234.95 120.46Q236.86 120.46 238.42 119.9Q239.99 119.34 240.94 118.5Q241.9 117.66 242.29 116.6Q242.68 115.54 242.23 114.53L220.5 61.89Q220.06 60.66 220.67 59.65Q221.29 58.64 222.63 58.64L241.56 58.64Q242.57 58.64 243.35 59.31Q244.14 59.98 244.47 60.88L253.99 87.76Q254.33 88.77 254.89 88.82Q255.45 88.88 255.9 87.76L265.53 60.88Q265.98 59.98 266.7 59.31Q267.43 58.64 268.44 58.64L280.98 58.64Q282.33 58.64 282.89 59.65Q283.45 60.66 282.89 61.89L261.05 114.53Q258.14 121.58 255.28 125.9Q252.42 130.21 248.95 132.5Q245.48 134.8 240.94 135.64Q236.41 136.48 230.14 136.48Z M315.3 73.76Q313.84 73.76 313.84 75.22L313.84 96.72Q313.84 99.63 315.69 101.14Q317.54 102.66 321.68 102.66L326.5 102.66Q327.39 102.66 327.95 103.33Q328.51 104 328.51 104.9L328.4 113.86Q328.4 116.54 325.15 117.22Q322.69 117.55 320.17 117.72Q317.65 117.89 315.13 117.94Q312.61 118 310.03 118Q301.97 118 296.7 114.14Q291.44 110.27 291.44 103.1L291.44 75.78Q291.44 73.76 289.76 73.76L284.38 73.76Q281.7 73.76 281.7 71.3L281.7 60.77Q281.7 58.64 284.16 58.64L290.77 58.64Q292 58.64 292.11 57.3L293.9 40.72Q294.13 38.48 295.92 38.48L312.38 38.48Q314.51 38.48 314.51 40.94L314.51 57.3Q314.51 58.53 315.74 58.53L326.05 58.53Q328.51 58.53 328.51 60.66L328.51 71.3Q328.51 73.76 325.71 73.76Z M353.42 114.75Q353.42 116.54 352.52 117.27Q351.62 118 349.72 118L333.93 118Q332.25 118 331.63 117.33Q331.02 116.66 331.02 115.2L331.02 61.22Q331.02 58.64 333.14 58.64L351.4 58.64Q353.42 58.64 353.42 60.88ZM353.42 50.46Q353.42 53.71 349.72 53.71L333.93 53.71Q332.25 53.71 331.63 52.98Q331.02 52.26 331.02 50.8L331.02 37.47Q331.02 34.9 333.14 34.9L351.4 34.9Q353.42 34.9 353.42 37.25Z M386.38 57.52Q394.45 57.52 400.05 60.49Q405.65 63.46 408.9 67.82Q412.14 72.19 413.04 76.56Q413.82 79.36 411.02 79.47L395.68 80.26Q394.11 80.37 393.78 78.69Q393.55 77.23 392.99 75.61Q392.43 73.98 391.03 72.81Q389.63 71.63 386.94 71.63Q384.26 71.63 382.24 73.31Q380.22 74.99 379.1 78.63Q377.98 82.27 377.98 88.32Q377.98 94.48 379.22 98.23Q380.45 101.98 382.74 103.61Q385.04 105.23 388.18 105.23Q392.77 105.23 394.95 102.71Q397.14 100.19 399.26 96.38Q399.49 95.94 399.94 95.77Q400.38 95.6 401.5 95.82L412.03 97.84Q413.6 98.18 413.04 100.42Q412.59 102.54 410.91 105.74Q409.23 108.93 406.1 111.95Q402.96 114.98 398.09 117.05Q393.22 119.12 386.38 119.12Q377.42 119.12 370.42 115.26Q363.42 111.39 359.39 104.5Q355.36 97.62 355.36 88.54Q355.36 79.25 359.45 72.3Q363.54 65.36 370.54 61.44Q377.54 57.52 386.38 57.52Z M452.06 75.66Q450.38 73.76 447.69 72.14Q445 70.51 440.86 70.51Q437.94 70.51 435.82 71.52Q433.69 72.53 433.69 74.43Q433.69 75.22 434.42 76Q435.14 76.78 438.17 77.34L450.04 79.81Q460.46 81.94 464.66 87.2Q468.86 92.46 468.86 98.96Q468.86 105.46 465.27 109.94Q461.69 114.42 455.3 116.77Q448.92 119.12 440.52 119.12Q429.77 119.12 422.6 115.5Line truncated
|
||||||
|
<path fill="none" stroke="#0E1A2B" stroke-width="5" stroke-linecap="square" stroke-linejoin="miter" d="M479.87199999999996 90 L489.87199999999996 90 L495.87199999999996 80 L503.87199999999996 104 L511.87199999999996 76 L519.872 102 L525.872 90 L547.872 90"></path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 217 KiB |
@@ -1,720 +0,0 @@
|
|||||||
%PDF-1.5␍%âãÏÓ
|
|
||||||
1 0 obj␍<</Metadata 2 0 R/OCProperties<</D<</ON[5 0 R]/Order 6 0 R/RBGroups[]>>/OCGs[5 0 R]>>/Pages 3 0 R/Type/Catalog>>␍endobj␍2 0 obj␍<</Length 46463/Subtype/XML/Type/Metadata>>stream
|
|
||||||
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
|
|
||||||
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c145 79.163499, 2018/08/13-16:40:22 ">
|
|
||||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
|
||||||
<rdf:Description rdf:about=""
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
|
|
||||||
xmlns:xmpGImg="http://ns.adobe.com/xap/1.0/g/img/"
|
|
||||||
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
|
|
||||||
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
|
|
||||||
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
|
|
||||||
xmlns:illustrator="http://ns.adobe.com/illustrator/1.0/"
|
|
||||||
xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/"
|
|
||||||
xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#"
|
|
||||||
xmlns:xmpG="http://ns.adobe.com/xap/1.0/g/"
|
|
||||||
xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
|
|
||||||
<dc:format>application/pdf</dc:format>
|
|
||||||
<dc:title>
|
|
||||||
<rdf:Alt>
|
|
||||||
<rdf:li xml:lang="x-default">Civilytics Consulting Logo</rdf:li>
|
|
||||||
</rdf:Alt>
|
|
||||||
</dc:title>
|
|
||||||
<xmp:CreatorTool>Adobe Illustrator CC 23.0 (Windows)</xmp:CreatorTool>
|
|
||||||
<xmp:CreateDate>2019-10-03T08:33:30-04:00</xmp:CreateDate>
|
|
||||||
<xmp:ModifyDate>2019-10-03T08:33:30-04:00</xmp:ModifyDate>
|
|
||||||
<xmp:MetadataDate>2019-10-03T08:33:30-04:00</xmp:MetadataDate>
|
|
||||||
<xmp:Thumbnails>
|
|
||||||
<rdf:Alt>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpGImg:width>256</xmpGImg:width>
|
|
||||||
<xmpGImg:height>52</xmpGImg:height>
|
|
||||||
<xmpGImg:format>JPEG</xmpGImg:format>
|
|
||||||
<xmpGImg:image>/9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA
AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK
DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f
Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgANAEAAwER
AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA
AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB
UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE
1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ
qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy
obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp
0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo
+DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A6bpPnfzD+Y/nzWNH8uX7
6N5P8suLbUtUt1ie7vrslh6cDyrIkUSlDVlUsR3HIUVRP5kx+ffJXlC91vy1r89+lsqrdWuqpDcP
GkjLH9YtpUjjbnFXkVl5oRXYHqqi/wAx/L+jeYfNXlgy+cxodxol8kj6RFcxRSXTy8DFHx5pIJHI
ULXlVWNBU4qzK483eVLaeS3uNasIZ4mKSxSXMKurDYqylgQRiqrdeZPLtpefUrrVbO3vaqPq0txE
ktX+yODMG+Ku22+KsG0nQfL97+bV75pg86LqhvbAW0PlmO6hkiVFAWRvTRzyj2DU4/aJJOKvP/yf
s9K0D8//AMx7OArZ6Rp1qGRXekUEXKOR/ic0VFqT12GKveLLzP5avrhbax1azurl6lIILiKRzQVN
FVidhiqivnPye0csq67p5igT1ZnF3BxSPkqc2PP4V5Oq1PcjxxV5p+U/562/mXUPM8fmXU9J02LT
tQ+q6OomSD1oAXAes0reoTxXddsVTy/0XR9U/N/SNfj87KJtOguLNPKsVxD+8nQOJPgRw7cRyMis
paqjcAUCrOdX17Q9GhSfWNRtdNgkbhHLdzRwIzH9kNIVBPtiqppmraVq1mt7pd7Bf2bkhLm1lSaI
lTQgPGWU0PviqWr578jtPcW6+YtMae0EjXUIvLcvEIFLSmRedVEairV6DriqeYq8y/Mj8xdbt/OO
h/l35RMSeZtcrPdahMoljsbJOReX0iQHkKxuVVttv8oYqns3kzzPb2jS6Z5v1F9XRaxtqC2s1pLJ
14zQRwREIx/30ykdj2xV35TeY9d8w+Q7TWPMASPVprnUEu4kAVIvQv54ViWnaNIwlTuaVJJqcVTO
y8++Rr7UBptl5i0y61FjxWyhvLeScsOwjVy9foxVF6n5m8t6VMINU1azsJiqyCK5uIoW4MxVW4uy
mhZSAfHFVKTzj5Qj1hdEk1zT01lmCLpjXUIuix6KIS3qVPhTFUdqWqaZpdm97qd3BY2cVPUubmRI
YlrsOTuVUffiqX2PnTydqCLJYa7p13G/qcXgu4JAfRXnLQo5/u13bwHXFURYeZfLmoPMlhqtndvb
p6lwsFxFKY0P7ThGPEe5xVZYeZPLGrzPZWGqWWoTekZJLaCeKdvSJClmRGY8KsBWlN8VeFfk/Z6X
oP5//mNZ2/Gz0nT7VWjV3pFDFyjkb4nNFRak+2Ksl8q/nva6l+anmfQNT1TSLXyxpUSHSb8TJH67
sU5EzvKY5PtNsgGKp1+aWmeXvNI0CKTzzH5eisbuHUHjgu4YmuonAMfFi6sCR/duKruTRtqKs4uP
M3lu2v10651azg1B5EhSzkuIkmMktPTQRswbk/IcRTeuKqVt5x8o3Orto1trmnz6whZX02O6he5U
p9oGFWMgK99sVR+o6lp2m2cl7qN1DZWcVDLc3EixRKCaDk7lVG/icVYNqf5wadJrenaX5PtE84+t
LENXuNKuoZUsLeWT0xNJ6fq86cXPGo6CpHIYqwL/AJwyKH8utaL0+uHW5vXrT1KfVbfjz/apy5Ur
3rioe6aq+lJp1w2rNAumhD9ba7KCD0+/qep8HH54q8O/5yFsbJPzO/KO9SCNbyXXoo5bhVAkdFur
QqrMN2C1NK9MVQn5+aBpnk/8wvKX5qxWEclnHeLZeZE9NGV1kUqk5Qj4pPSMg5HuqdDir0a60by/
5m/Nay1D6pb3I8rWHrm9Co5e61Ej6uvKh5CGCJ5Bvt6iEYq870XTrGx/5zB1OOygjto5dG9V44lC
KXaKLk3FaCrUqffFVb8s4opv+clPzNhmRZIpLaNJI3AZWVvSBVgdiCMVQ/5aaTp/5cf85Ca/5P8A
qscWneZrcaj5cmKgsgTm7W8bn4ggHqrSv+61xV6J+Wvlby5O+u+b4tMtY28z3btbFIVAOnW/GC3o
pFAJzD9ZP8xcE9BRV57/AM4xabp1xqv5ievawzelrbCL1I1biOcuy1G3TFVfzVpthaf85d+SJrW3
jgku9Mu5bpo1C+pJ9XvhzenViNieuKrvy8uz5v8A+cjfOmpasPX/AMKJ+j9Dt3+KO3AlMTyxgk0d
/SYk/wCUfbFWbQ/lVf6fJ+YV/p+tyvqPnSGQWaMDDHZTGGWNGX02IYgyL8fHlRe++KvEvK3mDQ18
lzfkX+Z2nHyvqY5ppesyxK0HrvIXguGNVHIO1PUDcXWoLLXFX1lir5+0Ew/9DkeYxe/b/Q0Y0yv8
31e0LU/2Pq4q+gcVeH/85Ra++m/lJ9W8uTRRw6zrH6MvHtSgWrNcS3Sck6O1xAyy968g29cVTH84
/wAvPLWn/kZfWFhaR2reW7WO70q5hURyxT2pDeoGWh5SfFyPcsT1xV5h+bmoSeaf+ccPJHmu9RZf
MTXlvbHUGA9Vii3ET8m7h3iDkeOKsz/5yY8oaBpH5KH6naRpc6dd2rw3vBfrDSu/CSV5ac2eTkS7
E1Y7nFSr/nHoHnbX/wAu/JPmLQ7caze6A9nrF9pcoMn1plgR+RiBHqkNWqDchjTFVT8uPNH5dfmd
5303zZpyLo/m7SLW6g1nRZol9W5jnVY+XqAqHWJq/Fx5b0YDbFUr/IyytrP89/zRs7S3SCyjkULD
GFWNazMQoQDYbnptiqp+Wuk6fpP/ADlR5/stPhW3tV0yGVIY1CqrTrZzPxVQABzkOKr/AMsER/8A
nJb8zEdQyNbxqysKgg+kCCDiqh+WOmabJ/zkl+Y9vJaQvBFBEY4WjUou8X2VIoMVa/5yz0zTo7by
Vex20aXaavHbrOqgOIePL06j9kFRQdsVUv8AnKXSYpvOP5ayWcfoapeaobcXluAlwf31qI6SD4qo
zVTwPTFVX/nKTy9oeg+TPKmoaLYw6de6brltb2U9sgiaOJoZpGUFadXhRt+4+eKo7/nKKzvDd+Qd
Uuonn8pabrKP5hRfiQK8sAjZ0HUcFlUGn7VO+KoDXBB5i/5yV8p6r5FkhvbWwsuXmDVdPKSWoiZp
QY5Zoqxs7IwUCtd18NlWR6T5C81/lt5+1nWvK1gdc8m+Y3+salpEMkUd7Z3Clm524maKOVKu1EDg
0NP2RVVNPzHTz5528n32ieX9Cl0xLlVa4udWkgieRInV/Qt4oZJjzkK8S0vBQPGuyqSfnh5V/MPz
F5x8nX/lzy+by18qX66jJcy3VrCs7epBKI40eQOKeiQSwHt44q9A88eVl88/l7qWhX1s1nPqdqfT
hnKM0FyvxwlmiaRDwlVSeLGoxVAfkx5N1Typ5A0+w1pi+vTKs2qsziQiQIsUcXNSwPowRRxbEj4d
sVYHaeWfzJT/AJyBuPPz+V5V0Ge1GnrH9bsTcLHwRfVZBPx+0leIbp74q3+X/lb8ydK/OvzH5u1L
yy0Gi+ZFEIIvLN5bcK0fGSRVl+JaIeQWp8K4qj/+cgPI/wDimbyjfaLei11+11lNNiuoDWQRXALX
Aqu9YEhMlD0UN44q9esLG10+xtrC0jEVraRJBbxDoscahEUfJRirwfy55T/NbyH5k856V5e0Vb6D
zXem70fzEZ4hBYiRpPiuYpKO7QrIDxC/ERtWuKovzV5Z/M25/PTy/wCdbHy293o/l22eweR7uySe
6DrcRvOieqqryFxyVWp7gdAqq6n5L8+eQ/zZ1Pzx5Q0geYtB8xoBrekxzJDcwy8gWli9RlV/iHId
ftMKDZsVZRqMH5j+aPKfm1ryw/RC6jo11YaD5dMsElw1xLBIBcXFwvwRs7MqKgk4qKljXoqwz82P
Kvnf8xfJ+jeV7nytJbeZ4biE3Line truncated
|
|
||||||
</rdf:li>
|
|
||||||
</rdf:Alt>
|
|
||||||
</xmp:Thumbnails>
|
|
||||||
<xmpMM:OriginalDocumentID>uuid:9E3E5C9A8C81DB118734DB58FDDE4BA7</xmpMM:OriginalDocumentID>
|
|
||||||
<xmpMM:DocumentID>xmp.did:f663c0bc-2bc8-e14f-a4eb-0ae2aefff354</xmpMM:DocumentID>
|
|
||||||
<xmpMM:InstanceID>uuid:cd5f7198-b551-4996-b056-4cfbcc97d13d</xmpMM:InstanceID>
|
|
||||||
<xmpMM:RenditionClass>proof:pdf</xmpMM:RenditionClass>
|
|
||||||
<xmpMM:DerivedFrom rdf:parseType="Resource">
|
|
||||||
<stRef:instanceID>uuid:dab6724e-c618-4184-9b2e-7d44879e5e5f</stRef:instanceID>
|
|
||||||
<stRef:documentID>xmp.did:008add62-65b7-3547-8416-6472cd533b2c</stRef:documentID>
|
|
||||||
<stRef:originalDocumentID>uuid:9E3E5C9A8C81DB118734DB58FDDE4BA7</stRef:originalDocumentID>
|
|
||||||
<stRef:renditionClass>proof:pdf</stRef:renditionClass>
|
|
||||||
</xmpMM:DerivedFrom>
|
|
||||||
<xmpMM:History>
|
|
||||||
<rdf:Seq>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<stEvt:action>saved</stEvt:action>
|
|
||||||
<stEvt:instanceID>xmp.iid:f663c0bc-2bc8-e14f-a4eb-0ae2aefff354</stEvt:instanceID>
|
|
||||||
<stEvt:when>2019-10-03T08:33:27-04:00</stEvt:when>
|
|
||||||
<stEvt:softwareAgent>Adobe Illustrator CC 23.0 (Windows)</stEvt:softwareAgent>
|
|
||||||
<stEvt:changed>/</stEvt:changed>
|
|
||||||
</rdf:li>
|
|
||||||
</rdf:Seq>
|
|
||||||
</xmpMM:History>
|
|
||||||
<illustrator:StartupProfile>Basic RGB</illustrator:StartupProfile>
|
|
||||||
<xmpTPg:NPages>1</xmpTPg:NPages>
|
|
||||||
<xmpTPg:HasVisibleTransparency>False</xmpTPg:HasVisibleTransparency>
|
|
||||||
<xmpTPg:HasVisibleOverprint>False</xmpTPg:HasVisibleOverprint>
|
|
||||||
<xmpTPg:MaxPageSize rdf:parseType="Resource">
|
|
||||||
<stDim:w>6.728299</stDim:w>
|
|
||||||
<stDim:h>1.834201</stDim:h>
|
|
||||||
<stDim:unit>Inches</stDim:unit>
|
|
||||||
</xmpTPg:MaxPageSize>
|
|
||||||
<xmpTPg:PlateNames>
|
|
||||||
<rdf:Seq>
|
|
||||||
<rdf:li>Cyan</rdf:li>
|
|
||||||
<rdf:li>Magenta</rdf:li>
|
|
||||||
<rdf:li>Yellow</rdf:li>
|
|
||||||
<rdf:li>Black</rdf:li>
|
|
||||||
</rdf:Seq>
|
|
||||||
</xmpTPg:PlateNames>
|
|
||||||
<xmpTPg:SwatchGroups>
|
|
||||||
<rdf:Seq>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:groupName>Default Swatch Group</xmpG:groupName>
|
|
||||||
<xmpG:groupType>0</xmpG:groupType>
|
|
||||||
<xmpG:Colorants>
|
|
||||||
<rdf:Seq>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>White</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>0.000000</xmpG:cyan>
|
|
||||||
<xmpG:magenta>0.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>0.000000</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>Black</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>74.972147</xmpG:cyan>
|
|
||||||
<xmpG:magenta>67.919427</xmpG:magenta>
|
|
||||||
<xmpG:yellow>67.049664</xmpG:yellow>
|
|
||||||
<xmpG:black>90.145719</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>RGB Red</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>0.000000</xmpG:cyan>
|
|
||||||
<xmpG:magenta>99.328601</xmpG:magenta>
|
|
||||||
<xmpG:yellow>100.000000</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>RGB Yellow</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>6.182956</xmpG:cyan>
|
|
||||||
<xmpG:magenta>0.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>96.548408</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>RGB Green</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>62.658119</xmpG:cyan>
|
|
||||||
<xmpG:magenta>0.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>100.000000</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>RGB Cyan</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>51.808953</xmpG:cyan>
|
|
||||||
<xmpG:magenta>0.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>12.567329</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>RGB Blue</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>88.384831</xmpG:cyan>
|
|
||||||
<xmpG:magenta>76.852059</xmpG:magenta>
|
|
||||||
<xmpG:yellow>0.000000</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>RGB Magenta</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>27.106124</xmpG:cyan>
|
|
||||||
<xmpG:magenta>81.603718</xmpG:magenta>
|
|
||||||
<xmpG:yellow>0.000000</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=193 G=39 B=45</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>16.891736</xmpG:cyan>
|
|
||||||
<xmpG:magenta>97.961390</xmpG:magenta>
|
|
||||||
<xmpG:yellow>92.785531</xmpG:yellow>
|
|
||||||
<xmpG:black>6.729228</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=237 G=28 B=36</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>0.296025</xmpG:cyan>
|
|
||||||
<xmpG:magenta>99.276721</xmpG:magenta>
|
|
||||||
<xmpG:yellow>97.207594</xmpG:yellow>
|
|
||||||
<xmpG:black>0.088502</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=241 G=90 B=36</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>0.000000</xmpG:cyan>
|
|
||||||
<xmpG:magenta>79.913020</xmpG:magenta>
|
|
||||||
<xmpG:yellow>96.704048</xmpG:yellow>
|
|
||||||
<xmpG:black>0.012207</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=247 G=147 B=30</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>0.021363</xmpG:cyan>
|
|
||||||
<xmpG:magenta>50.087738</xmpG:magenta>
|
|
||||||
<xmpG:yellow>98.608375</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=251 G=176 B=59</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>0.000000</xmpG:cyan>
|
|
||||||
<xmpG:magenta>34.851605</xmpG:magenta>
|
|
||||||
<xmpG:yellow>87.261766</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=252 G=238 B=33</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>4.547188</xmpG:cyan>
|
|
||||||
<xmpG:magenta>0.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>93.218887</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=217 G=224 B=33</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>18.875410</xmpG:cyan>
|
|
||||||
<xmpG:magenta>0.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>98.425263</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=140 G=198 B=63</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>50.032806</xmpG:cyan>
|
|
||||||
<xmpG:magenta>0.161746</xmpG:magenta>
|
|
||||||
<xmpG:yellow>99.304187</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=57 G=181 B=74</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>74.663919</xmpG:cyan>
|
|
||||||
<xmpG:magenta>0.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>99.768060</xmpG:yellow>
|
|
||||||
<xmpG:black>0.009155</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=0 G=146 B=69</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>86.407262</xmpG:cyan>
|
|
||||||
<xmpG:magenta>17.633325</xmpG:magenta>
|
|
||||||
<xmpG:yellow>100.000000</xmpG:yellow>
|
|
||||||
<xmpG:black>3.823911</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=0 G=104 B=55</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>90.328830</xmpG:cyan>
|
|
||||||
<xmpG:magenta>33.408102</xmpG:magenta>
|
|
||||||
<xmpG:yellow>98.858625</xmpG:yellow>
|
|
||||||
<xmpG:black>26.044098</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=34 G=181 B=115</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>76.229495</xmpG:cyan>
|
|
||||||
<xmpG:magenta>0.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>74.920267</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=0 G=169 B=157</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>78.408480</xmpG:cyan>
|
|
||||||
<xmpG:magenta>9.073014</xmpG:magenta>
|
|
||||||
<xmpG:yellow>45.722133</xmpG:yellow>
|
|
||||||
<xmpG:black>0.027466</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=41 G=171 B=226</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>69.719994</xmpG:cyan>
|
|
||||||
<xmpG:magenta>14.785992</xmpG:magenta>
|
|
||||||
<xmpG:yellow>0.000000</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=0 G=113 B=188</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>87.487596</xmpG:cyan>
|
|
||||||
<xmpG:magenta>52.660406</xmpG:magenta>
|
|
||||||
<xmpG:yellow>0.000000</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=46 G=49 B=146</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>99.197370</xmpG:cyan>
|
|
||||||
<xmpG:magenta>96.453798</xmpG:magenta>
|
|
||||||
<xmpG:yellow>3.418021</xmpG:yellow>
|
|
||||||
<xmpG:black>0.491341</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=27 G=20 B=100</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>100.000000</xmpG:cyan>
|
|
||||||
<xmpG:magenta>100.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>26.172274</xmpG:yellow>
|
|
||||||
<xmpG:black>24.441901</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=102 G=45 B=145</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>74.554050</xmpG:cyan>
|
|
||||||
<xmpG:magenta>98.455787</xmpG:magenta>
|
|
||||||
<xmpG:yellow>0.982681</xmpG:yellow>
|
|
||||||
<xmpG:black>0.228885</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=147 G=39 B=143</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>49.448386</xmpG:cyan>
|
|
||||||
<xmpG:magenta>99.258411</xmpG:magenta>
|
|
||||||
<xmpG:yellow>1.321431</xmpG:yellow>
|
|
||||||
<xmpG:black>0.106813</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=158 G=0 B=93</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>34.848553</xmpG:cyan>
|
|
||||||
<xmpG:magenta>100.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>37.164873</xmpG:yellow>
|
|
||||||
<xmpG:black>10.803387</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=212 G=20 B=90</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>11.926451</xmpG:cyan>
|
|
||||||
<xmpG:magenta>100.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>49.256122</xmpG:yellow>
|
|
||||||
<xmpG:black>0.878920</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=237 G=30 B=121</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>0.000000</xmpG:cyan>
|
|
||||||
<xmpG:magenta>97.082472</xmpG:magenta>
|
|
||||||
<xmpG:yellow>20.383000</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=199 G=178 B=153</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>22.882429</xmpG:cyan>
|
|
||||||
<xmpG:magenta>27.399099</xmpG:magenta>
|
|
||||||
<xmpG:yellow>39.954221</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=153 G=134 B=117</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>39.859617</xmpG:cyan>
|
|
||||||
<xmpG:magenta>42.893109</xmpG:magenta>
|
|
||||||
<xmpG:yellow>52.553594</xmpG:yellow>
|
|
||||||
<xmpG:black>6.805523</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=115 G=99 B=87</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>50.441748</xmpG:cyan>
|
|
||||||
<xmpG:magenta>53.072399</xmpG:magenta>
|
|
||||||
<xmpG:yellow>60.970473</xmpG:yellow>
|
|
||||||
<xmpG:black>23.602654</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=83 G=71 B=65</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>57.607383</xmpG:cyan>
|
|
||||||
<xmpG:magenta>60.415041</xmpG:magenta>
|
|
||||||
<xmpG:yellow>63.701838</xmpG:yellow>
|
|
||||||
<xmpG:black>41.919583</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=198 G=156 B=109</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>22.659647</xmpG:cyan>
|
|
||||||
<xmpG:magenta>38.376439</xmpG:magenta>
|
|
||||||
<xmpG:yellow>63.649952</xmpG:yellow>
|
|
||||||
<xmpG:black>1.181048</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=166 G=124 B=82</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>31.540397</xmpG:cyan>
|
|
||||||
<xmpG:magenta>49.149308</xmpG:magenta>
|
|
||||||
<xmpG:yellow>74.108487</xmpG:yellow>
|
|
||||||
<xmpG:black>9.897001</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=140 G=98 B=57</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>36.243227</xmpG:cyan>
|
|
||||||
<xmpG:magenta>57.430381</xmpG:magenta>
|
|
||||||
<xmpG:yellow>83.996338</xmpG:yellow>
|
|
||||||
<xmpG:black>22.613870</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=117 G=76 B=36</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>39.163804</xmpG:cyan>
|
|
||||||
<xmpG:magenta>64.052790</xmpG:magenta>
|
|
||||||
<xmpG:yellow>93.292129</xmpG:yellow>
|
|
||||||
<xmpG:black>35.577935</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=96 G=56 B=19</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>41.574728</xmpG:cyan>
|
|
||||||
<xmpG:magenta>70.016021</xmpG:magenta>
|
|
||||||
<xmpG:yellow>97.061110</xmpG:yellow>
|
|
||||||
<xmpG:black>49.149308</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=66 G=33 B=11</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>47.708857</xmpG:cyan>
|
|
||||||
<xmpG:magenta>73.470664</xmpG:magenta>
|
|
||||||
<xmpG:yellow>83.718622</xmpG:yellow>
|
|
||||||
<xmpG:black>68.142211</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
</rdf:Seq>
|
|
||||||
</xmpG:Colorants>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:groupName>Cold</xmpG:groupName>
|
|
||||||
<xmpG:groupType>1</xmpG:groupType>
|
|
||||||
<xmpG:Colorants>
|
|
||||||
<rdf:Seq>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>C=56 M=0 Y=20 K=0</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>55.809867</xmpG:cyan>
|
|
||||||
<xmpG:magenta>0.000000</xmpG:magenta>
|
|
||||||
<xmpG:yellow>19.998473</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>C=51 M=43 Y=0 K=0</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>51.107037</xmpG:cyan>
|
|
||||||
<xmpG:magenta>43.094528</xmpG:magenta>
|
|
||||||
<xmpG:yellow>0.000000</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>C=26 M=41 Y=0 K=0</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>26.425573</xmpG:cyan>
|
|
||||||
<xmpG:magenta>41.297016</xmpG:magenta>
|
|
||||||
<xmpG:yellow>0.000000</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
</rdf:Seq>
|
|
||||||
</xmpG:Colorants>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:groupName>Grays</xmpG:groupName>
|
|
||||||
<xmpG:groupType>1</xmpG:groupType>
|
|
||||||
<xmpG:Colorants>
|
|
||||||
<rdf:Seq>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=0 G=0 B=0</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>74.972147</xmpG:cyan>
|
|
||||||
<xmpG:magenta>67.919427</xmpG:magenta>
|
|
||||||
<xmpG:yellow>67.049664</xmpG:yellow>
|
|
||||||
<xmpG:black>90.145719</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=26 G=26 B=26</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>72.606999</xmpG:cyan>
|
|
||||||
<xmpG:magenta>66.668189</xmpG:magenta>
|
|
||||||
<xmpG:yellow>65.243000</xmpG:yellow>
|
|
||||||
<xmpG:black>78.234529</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=51 G=51 B=51</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>69.433123</xmpG:cyan>
|
|
||||||
<xmpG:magenta>63.234907</xmpG:magenta>
|
|
||||||
<xmpG:yellow>62.102687</xmpG:yellow>
|
|
||||||
<xmpG:black>58.355075</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=77 G=77 B=77</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>65.395588</xmpG:cyan>
|
|
||||||
<xmpG:magenta>58.022428</xmpG:magenta>
|
|
||||||
<xmpG:yellow>56.820017</xmpG:yellow>
|
|
||||||
<xmpG:black>36.655220</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=102 G=102 B=102</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>59.771115</xmpG:cyan>
|
|
||||||
<xmpG:magenta>51.183337</xmpG:magenta>
|
|
||||||
<xmpG:yellow>50.771338</xmpG:yellow>
|
|
||||||
<xmpG:black>20.129701</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=128 G=128 B=128</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>51.619744</xmpG:cyan>
|
|
||||||
<xmpG:magenta>43.204394</xmpG:magenta>
|
|
||||||
<xmpG:yellow>43.204394</xmpG:yellow>
|
|
||||||
<xmpG:black>7.547112</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=153 G=153 B=153</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>42.615396</xmpG:cyan>
|
|
||||||
<xmpG:magenta>34.741738</xmpG:magenta>
|
|
||||||
<xmpG:yellow>35.318530</xmpG:yellow>
|
|
||||||
<xmpG:black>0.985733</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=179 G=179 B=179</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>30.695048</xmpG:cyan>
|
|
||||||
<xmpG:magenta>24.188600</xmpG:magenta>
|
|
||||||
<xmpG:yellow>24.777599</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=204 G=204 B=204</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>19.467460</xmpG:cyan>
|
|
||||||
<xmpG:magenta>15.017928</xmpG:magenta>
|
|
||||||
<xmpG:yellow>15.637445</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=230 G=230 B=230</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>8.499275</xmpG:cyan>
|
|
||||||
<xmpG:magenta>6.103609</xmpG:magenta>
|
|
||||||
<xmpG:yellow>6.628519</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
<rdf:li rdf:parseType="Resource">
|
|
||||||
<xmpG:swatchName>R=242 G=242 B=242</xmpG:swatchName>
|
|
||||||
<xmpG:mode>CMYK</xmpG:mode>
|
|
||||||
<xmpG:type>PROCESS</xmpG:type>
|
|
||||||
<xmpG:cyan>3.707942</xmpG:cyan>
|
|
||||||
<xmpG:magenta>2.462806</xmpG:magenta>
|
|
||||||
<xmpG:yellow>2.462806</xmpG:yellow>
|
|
||||||
<xmpG:black>0.000000</xmpG:black>
|
|
||||||
</rdf:li>
|
|
||||||
</rdf:Seq>
|
|
||||||
</xmpG:Colorants>
|
|
||||||
</rdf:li>
|
|
||||||
</rdf:Seq>
|
|
||||||
</xmpTPg:SwatchGroups>
|
|
||||||
<pdf:Producer>Adobe PDF library 15.00</pdf:Producer>
|
|
||||||
</rdf:Description>
|
|
||||||
</rdf:RDF>
|
|
||||||
</x:xmpmeta>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?xpacket end="w"?>
|
|
||||||
endstream␍endobj␍3 0 obj␍<</Count 1/Kids[7 0 R]/Type/Pages>>␍endobj␍7 0 obj␍<</ArtBox[26.572 22.4644 458.572 104.978]/BleedBox[0.0 0.0 484.438 132.062]/Contents 8 0 R/CropBox[0.0 0.0 484.438 132.062]/MediaBox[0.0 0.0 484.438 132.062]/Parent 3 0 R/Resources<</ExtGState<</GS0 9 0 R>>/Properties<</MC0 5 0 R>>>>/Thumb 10 0 R/TrimBox[0.0 0.0 484.438 132.062]/Type/Page>>␍endobj␍8 0 obj␍<</Filter/FlateDecode/Length 17103>>stream
|
|
||||||
H‰|WÉ®$I¼×WÔ¼œð%¶+ƒÄ !Ä�h±HÌŒ4ðÿf摯ª›fÔR¿òÌÈ_ÌÌ=~øÓ�Ïþøc{þî÷?>¿>ÚÓ¯6ü™+¯Œùü¸üûo�¿>y´kög»ÆÜúßðÿnöü×ã‡?ü¥=ÿñŸÇ¯O<Ã?{šåµËáÇ\Ï/??øÿ_m;~ý„_†C.ã~6òùáWè7>øˆ«¯þüò¸M¿/ù™mÚqYÃF—;¼ø{çÐïøÐ®±6Ì~␍|è×¼-�g\3gY{c-í{\ÍÖóe¾|YcÖ~ —�ôsn+‹?æÕûx_Íës³7“›ÜÖíÇ>‹ã%ÎìWŸ~B€»y-ß SúÀ3ÙazÝ"”]¦…Ýju3<÷¸Òk9MTª·ø\Ž#—ŸÕôPÐÿL>be²áÆæ>؆y–—ƒ…|ÌRV«p‡Þõè' | |||||||