Commit Graph
56 Commits
Author SHA1 Message Date
jared 41fe2b6170 fix: use full-bleed background rect instead of opaque logo grob
R-CMD-check / R CMD check (push) Successful in 4m4s
The previous fix applied the plot's background to the logo grob
directly, which made it opaque and covered caption/axis text that
overlaps into the logo area via negative margins.

Instead, wrap the entire arrangeGrob composition in a grobTree with
a background rectGrob behind it. This fills transparent areas (logo
strip, padding gaps) with the plot's background color while keeping
the logo grob itself transparent so overlapping text remains visible.
2026-05-19 22:12:03 -06:00
jared ac8e3eb60e fix: inherit plot background color in logo compositing
R-CMD-check / R CMD check (push) Successful in 3m41s
The logo grob uses theme_void() (transparent background), so when
arrangeGrob() composites it with a dark-themed plot, the logo strip
falls back to the device default (white). Extract the plot's
plot.background fill and apply it to the logo grob before compositing.

Fixes the issue where theme_civilytics_dark(font_size = 16) piped to
civilytics_logo(variant = "dark") would show a light background in
the logo/caption area.
2026-05-19 16:47:36 -06:00
jared 98e0949d27 feat: add map theme variants and fix dark theme text readability
R-CMD-check / R CMD check (push) Successful in 3m48s
Add theme_civilytics_map(), theme_civilytics_dark_map(), and
theme_civilytics_slide_map() for choropleths — suppress axes, ticks,
gridlines, and axis labels while preserving titles, captions, and legends.

Fix subtitle, caption, and axis text colors in theme_civilytics_dark()
which were inheriting dark ink_2/ink_3 values meant for light backgrounds,
making them hard to read on navy. Now uses navy_200/navy_300 instead.
2026-05-19 16:07:42 -06:00
jaredandClaude Opus 4.6 328d9d2fd6 feat: add position argument to civilytics_logo() for corner placement
R-CMD-check / R CMD check (push) Successful in 3m37s
Supports "bottom-right" (default), "bottom-left", "top-right", and
"top-left". The position controls both horizontal alignment of the logo
grob and whether it is placed above or below the plot.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-19 15:44:18 -06:00
jared 95b8ba1da4 fix: revert font_size default to 14pt, keep DPI fix
R-CMD-check / R CMD check (push) Successful in 3m37s
2026-05-19 15:11:27 -06:00
jared f134621df5 fix: bump base font_size to 16pt and drop fig.retina for readable README
R-CMD-check / R CMD check (push) Successful in 3m33s
The old fig.retina=2 at 150 DPI rendered PNGs at 2x resolution that
GitHub markdown can't use, making text appear half its intended size.
Switching to 96 DPI without retina produces images at their natural
display size. Combined with the base font bump (14 → 16pt), titles
and labels now render with proper editorial presence.
2026-05-19 14:40:48 -06:00
jared 31d3e2886d feat: bump title sizes, add font_scale to logo functions, ship SVGs
R-CMD-check / R CMD check (push) Successful in 3m36s
- Change rel_large default from 16/14 to 20/14 (~1.43x) to match the
  Civilytics editorial design system. Subtitle now renders at 1.0x base
  instead of 0.86x.
- Switch axis.text to rel() sizing so all text elements cascade from the
  root font_size, enabling uniform scaling.
- Add font_scale parameter (default 1.1) to civilytics_logo(),
  add_logo(), and add_logo_ga() — inflates text by ~10% before
  arrangeGrob composition to compensate for viewport shrinkage.
- Ship SVG logo variants (mark, wordmark, pulse) in inst/img/ for
  Quarto/HTML templates.
- Add "Maintaining brand assets" section to README documenting inst/img/
  file inventory and update workflow.
- Document full font size hierarchy in theme_civilytics() roxygen.
2026-05-19 12:51:23 -06:00
jared 34622ccf88 fix: use remotes::install_git() for Gitea installation instructions
R-CMD-check / R CMD check (push) Successful in 3m37s
2026-05-19 10:46:32 -06:00
jared f9b51cc558 fix: use light-variant mark in logo example to match light logo area
R-CMD-check / R CMD check (push) Successful in 3m42s
2026-05-19 10:43:52 -06:00
jared 875251068a docs: add rendered logo examples to README gallery
R-CMD-check / R CMD check (push) Successful in 3m38s
Show three logo use cases: wordmark on a light plot, compact mark on a
dark plot, and multi-plot layout with a shared logo via add_logo_ga().
2026-05-19 10:39:12 -06:00
jared 515bae8685 feat: expand color system to 53 colors/10 palettes, add grid/slide themes, and README gallery
R-CMD-check / R CMD check (push) Successful in 3m41s
Replace the 16-color / 3-palette system with the full Civilytics design
system: 53 named colors (full navy, ember, violet ramps plus teal, plum,
moss, brass supporting hues) and 10 visualization palettes (qual,
qual_warm, qual_cool, seq_ember, seq_navy, seq_violet, seq_paper_ink,
div_navy_ember, div_violet_ember).

Enrich theme_civilytics() with grid and paper_bg parameters, add
theme_civilytics_slide() for presentations, and load all four brand fonts
(Inter, Libre Franklin, Source Serif 4, JetBrains Mono).

Add README.Rmd with rendered gallery showing all palettes, theme
variants, grid options, dark/slide modes, facets, and scale usage.
2026-05-19 10:35:32 -06:00
jared 099fff1d1d fix: correct pipe precedence docs — |> binds tighter than +
R-CMD-check / R CMD check (push) Successful in 2m46s
R's |> has higher precedence than +, so parentheses ARE required
around the ggplot chain before piping to civilytics_logo():

  (ggplot(df, aes(x, y)) + geom_point() + theme_civilytics()) |>
    civilytics_logo()

Updated docs, examples, and pipe test accordingly.
2026-05-17 22:54:53 -06:00
jared 7371069379 feat: rebrand logos with wordmark/mark variants and pipe-friendly API
R-CMD-check / R CMD check (push) Successful in 2m39s
- Replace old civilytics_logo.png/white.png/jpg/pdf with new rebrand
  assets: civilytics-wordmark.png, civilytics-wordmark-reverse.png,
  civilytics-mark.png, civilytics-mark-reverse.png (all transparent bg)
- make_logo_grob() now accepts type = c("wordmark", "mark") alongside
  variant = c("light", "dark") for 4 combinations
- New civilytics_logo() pipe-friendly convenience function:
    ggplot(df, aes(x, y)) + geom_point() + theme_civilytics() |>
      civilytics_logo()
  R's |> has lower precedence than +, so the full ggplot chain pipes
  through without parentheses
- Remove old icon/favicon assets no longer used
- Wrap showtext-dependent examples in \dontrun{} to prevent R CMD check
  failures in headless PostScript environments
2026-05-17 22:42:40 -06:00
jared 3a6f20b723 ci: bump rocker container to r-ver:4.6 for ggplot2 4.0 CRAN snapshot
R-CMD-check / R CMD check (push) Successful in 2m55s
2026-05-17 10:41:50 -06:00
jared c93c469267 feat: add brand color system, showtext fonts, and dark theme
R-CMD-check / R CMD check (push) Failing after 1m39s
- R/colors.R: civilytics_colors named vector (from --cv-* CSS vars on
  civilytics.com), three palettes (main/sequential/diverging),
  scale_color_civilytics() and scale_fill_civilytics() for ggplot2
- R/fonts.R: auto-loads Inter + Libre Franklin from Google Fonts via
  showtext in .onLoad(); exports civilytics_load_fonts() for manual retry
- R/theme.R: wires ggplot2 4.0 ink/paper/accent params into theme_grey()
  base, adds title_family + strip_color params; new theme_civilytics_dark()
  using navy_dark background and warm off-white text
- R/logo.R: make_logo_grob(variant) accepts "light"/"dark" to select the
  white logo for dark-background compositions
- DESCRIPTION: adds showtext, sysfonts; pins ggplot2 >= 4.0.0
- tests/testthat/test_theme.R: full test suite for colors, palettes,
  scales, both theme variants, and logo grob variants
2026-05-17 10:36:59 -06:00
jared 2d70d9aecf fix: clean up theme.R and logo.R before restyling
R-CMD-check / R CMD check (push) Successful in 1m45s
theme.R:
- Remove deprecated legend.text.align and legend.title.align (ggplot2 3.5.0)
- Remove stale @importFrom graphics plot (unused in theme function)

logo.R:
- Fix make_logo_grob() spurious two-row data frame (drop aes/data from canvas)
- Fix add_logo_ga() caption measurement always using first plot; now uses max
  across all plots with captions
- Fix add_logo_ga() ncol hardcoded to 2; now uses length(plot_list)
- Fix add_logo_ga() widths silently ignored in nrow > 1 path; now warns
- Replace deprecated qplot() in examples with ggplot() equivalents
- Fix native = T -> TRUE in plot_jpeg()
2026-05-17 10:01:35 -06:00
jared bf6f7cc480 fix: use globalVariables for state.abb/state.name, regenerate docs
R-CMD-check / R CMD check (push) Successful in 1m36s
@importFrom does not work for base R lazy data objects — replaced with
utils::globalVariables() in the package file to suppress the R CMD check
NOTE. Removed the invalid @importFrom datasets tag from utils.R.

Also commits all man/ and NAMESPACE changes from devtools::document().
2026-05-17 09:36:59 -06:00
jared b84fc2f7d0 fix: resolve all R CMD check errors and notes
R-CMD-check / R CMD check (push) Failing after 1m32s
- Wrap get_fips/get_stabbr examples in dontrun (tidycensus is Suggests)
- Add .gitea to .Rbuildignore (hidden dir note)
- Add importFrom(datasets, state.abb/state.name) for postcode_lookup
- Remove LazyData: true (no data/ directory)
2026-05-17 09:30:01 -06:00
jared d17a4fbc7c ci: use rocker container with shell git checkout
R-CMD-check / R CMD check (push) Failing after 2m13s
Replace actions/checkout@v4 (JS action, requires Node.js) with plain git
commands using the auto-injected gitea.token for auth. This lets the workflow
run entirely inside rocker/r-ver:4.4 without any Node.js dependency.
2026-05-17 09:15:24 -06:00
jared 53299c7e88 ci: run on host runner, install R from CRAN PPA
R-CMD-check / R CMD check (push) Failing after 10m49s
Remove container directive — rocker/r-ver has no Node.js so actions/checkout
(a JS action) fails with exit 127. Install R 4.x from the official CRAN
Ubuntu PPA on the host runner instead.
2026-05-17 09:12:37 -06:00
jared 38cdaa8ea7 ci: replace Jenkins with Gitea Actions, modernize DESCRIPTION
R-CMD-check / R CMD check (push) Failing after 3s
- Add real R CMD check workflow via Gitea Actions (rocker/r-ver:4.4)
- Remove Jenkinsfile and demo workflow
- Modernize DESCRIPTION: Authors@R, R >= 4.1.0, URL/BugReports fields,
  move tidycensus from Imports to Suggests, testthat edition 3
- Fix agresti_coull_interval: correct implementation, export it
- Convert get_fips/get_stabbr to use requireNamespace for tidycensus
- Remove civilytics:: self-reference in rnh()
2026-05-17 09:05:45 -06:00
Jared Knowles 01c9d1c796 test actions
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 36s
Gitea Organization/civilyticsR/pipeline/head This commit looks good
2025-04-04 11:51:19 -04:00
jared b59cbeb9b6 Merge pull request 'fix proportion ci calc and theme' (#2) from feature-prop_int into master
Gitea Organization/civilyticsR/pipeline/head This commit looks good
Reviewed-on: #2
2024-09-19 16:17:32 -04:00
jared f3f13fcfe5 fix message unicode
Gitea Organization/civilyticsR/pipeline/head This commit looks good
2024-09-19 16:14:30 -04:00
jared 962f8ea6b7 add rounding utilities
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2024-09-19 14:32:43 -04:00
jared f4a4ee85a7 fix doco
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
Gitea Organization/civilyticsR/pipeline/pr-master There was a failure building this commit
2024-08-09 15:34:39 -04:00
jared 82b8db7f84 fix proportion ci calc and theme
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2024-08-09 15:05:59 -04:00
Jared Knowles 4f49ae6d5a dockerfile edits
Gitea Organization/civilyticsR/pipeline/head This commit looks good
2023-07-20 15:44:17 -04:00
Jared Knowles e27ff481c1 fix docker build agent to have correct geo dependencies installed
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2023-07-20 15:08:16 -04:00
Jared Knowles 91dceb9c1c somehow licenses are important
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2023-07-20 14:57:08 -04:00
Jared Knowles c6079eb515 working build
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2023-07-20 14:51:04 -04:00
Jared Knowles 0ad87eb333 fix dockerfile
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2023-07-20 14:18:02 -04:00
Jared Knowles ac63932a31 add additional functions
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2023-07-20 11:48:42 -04:00
Jared Knowles 9acebb5133 unit test match funs
Gitea Organization/civilyticsR/pipeline/head This commit looks good
2023-07-19 17:37:18 -04:00
Jared Knowles a0b4abdb9e add code coverage
Gitea Organization/civilyticsR/pipeline/head This commit looks good
2022-10-31 12:39:13 -04:00
Jared Knowles f0133e32b7 typo
Gitea Organization/civilyticsR/pipeline/head This commit looks good
2022-10-16 19:31:42 -04:00
Jared Knowles 91dad76526 cleanup tests and build
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 19:30:05 -04:00
Jared Knowles a02e72e618 get dockerfile requirements right
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 19:20:20 -04:00
Jared Knowles 4a2cd9e1dd refresh doco
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 19:17:38 -04:00
Jared Knowles f50290ba40 nest stages
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 19:15:33 -04:00
Jared Knowles 8b8dd50de3 fill out testing
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 19:08:06 -04:00
Jared Knowles 34cc4a5c1a update dockerfile
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 18:59:48 -04:00
Jared Knowles 6f4ccc0d4e convert makefile to jenkinsfile
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 18:58:22 -04:00
Jared Knowles 920098e18d remove uneeded git dependency
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 18:45:37 -04:00
Jared Knowles c004628682 typo
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 18:42:09 -04:00
Jared Knowles f2dca18041 typo
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 18:41:14 -04:00
Jared Knowles 72afbaeefa dockerfile version
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 18:38:10 -04:00
Jared Knowles d061c4e802 configure jenkinsfile better
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 18:19:39 -04:00
Jared Knowles 904ca1dbc8 typos
Gitea Organization/civilyticsR/pipeline/head Something is wrong with the build of this commit
2022-10-16 18:08:53 -04:00
Jared Knowles 1550c2cb5b rockstar test
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
2022-10-16 18:07:42 -04:00