Chapter 19 Internals of ggplot2

Learning Objectives

  • What is the difference between user-facing code and internal code?
  • What is the distinction between ggplot_build() and ggplot_gtable()?
  • What the division of labor between {ggplot2} and {grid}?
  • What is the basic structure of/motivation for ggproto?
Libraries and Helper Functions
library(ggplot2)
library(ggtrace) # remotes::install_github("yjunechoe/ggtrace")
library(purrr)
library(dplyr)

# source("utilities/workflows-inspect.R")
# source("utilities/aliases.R")

obj_byte <- function(x) {
  scales::label_bytes()(as.numeric(object.size(x)))
}