Skip to contents

Shared colour palettes, ggplot2 theme, and scales for the Circadia Lab R ecosystem.

License: MIT R R-CMD-check


๐Ÿ“– What is circadia?

circadia is the visual identity layer for the Circadia Lab R ecosystem. It provides a consistent set of brand colours, a clean ggplot2 theme, and discrete and continuous scale functions that plug directly into plots produced by zeitR, slumbR, tallieR, syncR, and standalone analysis notebooks.


โœจ Features

  • ๐ŸŽจ Five named palettes โ€” main (6-colour qualitative), core (4-colour compact), diverging (blue โ†’ antique white โ†’ coral), blues (sequential), warm (sequential)
  • ๐Ÿ”ฌ Domain colour map โ€” domain_colour_for() returns the brand colour for a named data domain ("actigraphy", "sleep", "circadian", "questionnaire", "demographics", "clinical")
  • ๐Ÿ“Š Discrete scales โ€” scale_colour_circadia() and scale_fill_circadia() for categorical data
  • ๐ŸŒˆ Continuous scales โ€” scale_colour_circadia_c() and scale_fill_circadia_c() with colour interpolation
  • ๐Ÿ–ผ theme_circadia() โ€” minimal ggplot2 theme with configurable gridlines, Circadia Lab typography, and brand accent colours

๐Ÿ—‚๏ธ Project Structure

circadia/
โ”œโ”€โ”€ R/
โ”‚   โ”œโ”€โ”€ circadia-package.R   # package-level documentation
โ”‚   โ”œโ”€โ”€ palettes.R           # palette definitions and retrieval functions
โ”‚   โ”œโ”€โ”€ scales.R             # ggplot2 discrete and continuous scales
โ”‚   โ””โ”€โ”€ theme.R              # theme_circadia()
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ testthat/
โ”‚       โ”œโ”€โ”€ test-palettes.R
โ”‚       โ””โ”€โ”€ test-scales.R
โ”œโ”€โ”€ vignettes/
โ”‚   โ””โ”€โ”€ getting-started.Rmd
โ”œโ”€โ”€ _pkgdown.yml
โ”œโ”€โ”€ DESCRIPTION
โ””โ”€โ”€ LICENSE

๐Ÿš€ Getting Started

Installation

# install.packages("remotes")
remotes::install_github("circadia-bio/circadia")

Basic usage

library(circadia)
library(ggplot2)

# Retrieve a palette
circadia_palette("core")
#> deep_blue    coral_red        amber antique_white
#> "#014370"   "#FC544A"   "#FFA75D"   "#FFECD4"

# Domain colour lookup
domain_colour_for("sleep")
#>     sleep
#> "#1B6799"

# Apply theme and scales to a plot
ggplot(mtcars, aes(wt, mpg, colour = factor(cyl))) +
  geom_point(size = 3) +
  scale_colour_circadia() +
  theme_circadia()

# Continuous fill scale with the diverging palette
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
  geom_tile() +
  scale_fill_circadia_c("warm") +
  theme_circadia(grid = "none")

๐Ÿ“ฆ Dependencies

Package Version Purpose
ggplot2 โ‰ฅ 3.4.0 Theme and scale infrastructure

๐Ÿ‘ฅ Authors

Role Name Affiliation
Author, maintainer Lucas Franรงa Northumbria University
Author Mario Leocadio-Miguel Northumbria University

  • โŒš๏ธ zeitR โ€” wrist actigraphy analysis and circadian metrics
  • ๐Ÿ›Œ slumbR โ€” sleep diary processing
  • ๐Ÿงฎ tallieR โ€” sociodemographic and questionnaire data
  • ๐Ÿ”„ syncR โ€” unified participant-indexed database
  • ๐Ÿ”ฌ circadia-bio โ€” the Circadia Lab GitHub organisation

๐Ÿ“„ Licence

Released under the MIT License.

Copyright ยฉ Lucas Franรงa, Mario Leocadio-Miguel, 2025