A curated gallery of data visualizations for building science and indoor environmental quality research, maintained by UC Berkeley's Center for the Built Environment.
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.
# 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 previewchart-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
Contributions are welcome! Here's how you can help:
-
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
-
Create the gallery page in
pages/plots/as a.qmdfile:--- 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 -
Preview locally with
quarto previewto verify rendering -
Submit a pull request with your changes
Add new palettes to src/R/x_theme.R and document them in pages/styling/color-palettes.qmd.
- Fix typos or clarify explanations
- Add examples to the code tutorials in
pages/code/ - Expand the styling 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
# Full site build (outputs to docs/)
quarto render
# Render a single page
quarto render pages/plots/your-plot.qmd
# Preview with live reload
quarto previewThis project is maintained by the Center for the Built Environment at UC Berkeley.