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