Skip to content

CenterForTheBuiltEnvironment/chart-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CBE Chart Library

A curated gallery of data visualizations for building science and indoor environmental quality research, maintained by UC Berkeley's Center for the Built Environment.

View the live site

Overview

The CBE Chart Library provides:

  • Plot Gallery β€” Reusable visualization patterns for survey data, thermal comfort metrics, and building performance analysis
  • Styling Guidelines β€” Standards for publication-ready figures including color palettes, typography, and layout recommendations
  • Code Examples β€” Tutorials and templates for R, Python, and reproducible research workflows

The goal is to promote consistency across CBE research outputs and reduce time spent reformatting figures for publications.

Quick Start

View the Site Locally

# Clone the repository
git clone https://github.com/centerforthebuiltenvironment/chart-library.git
cd chart-library

# Restore R packages
R -e "renv::restore()"

# Preview the site
quarto preview

Requirements

  • Quarto (v1.3 or later)
  • R (v4.4+)
  • R packages managed via renv

Project Structure

chart-library/
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ plots/          # Gallery entries (one .qmd per visualization)
β”‚   β”œβ”€β”€ styling/        # Color palettes, typography, guidelines
β”‚   β”œβ”€β”€ code/           # R, Python, Git tutorials
β”‚   └── resources/      # External references
β”œβ”€β”€ src/
β”‚   └── R/
β”‚       β”œβ”€β”€ plots/      # Standalone R scripts for each plot
β”‚       β”œβ”€β”€ x_data.R    # Sample data and factor definitions
β”‚       β”œβ”€β”€ x_func.R    # Reusable plotting functions
β”‚       └── x_theme.R   # Color palette definitions
β”œβ”€β”€ styles/
β”‚   └── custom.css      # Site styling
β”œβ”€β”€ docs/               # Generated site (GitHub Pages)
└── _quarto.yml         # Quarto configuration

Contributing

Contributions are welcome! Here's how you can help:

Adding a New Plot

  1. Create the R script in src/R/plots/ following the existing pattern:

    source(here::here("src", "R", "x_data.R"))
    source(here::here("src", "R", "x_func.R"))
    source(here::here("src", "R", "x_theme.R"))
    
    # Your plotting code here
  2. Create the gallery page in pages/plots/ as a .qmd file:

    ---
    title: "Your Plot Title"
    description: "Brief description of the visualization."
    categories: ["Survey data", "R"]
    code-contributor: "Your Name"
    ---
    #| file: "../../src/R/plots/your-plot.R"
    #| code-fold: true
    
  3. Preview locally with quarto preview to verify rendering

  4. Submit a pull request with your changes

Adding Color Palettes

Add new palettes to src/R/x_theme.R and document them in pages/styling/color-palettes.qmd.

Improving Documentation

  • Fix typos or clarify explanations
  • Add examples to the code tutorials in pages/code/
  • Expand the styling guidelines

Guidelines

  • Follow the styling standards for all visualizations
  • Use existing color palettes when appropriate
  • Keep code examples minimal and focused
  • Test that the site builds without errors before submitting

Building the Site

# Full site build (outputs to docs/)
quarto render

# Render a single page
quarto render pages/plots/your-plot.qmd

# Preview with live reload
quarto preview

License

This project is maintained by the Center for the Built Environment at UC Berkeley.

Acknowledgments

Created by t-kramer. Built with Quarto.

About

Collection of charts useful in building science research πŸ“Š

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published