See ggplot2::fortify for details.