I'm looking for detailed documentation on grid, grobs, gtable and similar classes. Basically, I need to work with the output of ggplot_gtable() but can't find any resources on the subject. I am mainly interested in how layouts are calculated, but it would also be nice to have a list of valid gpar values, what units are used and how drawing order is determined.
Thanks. I made some progress in understanding how the grid package works, but there seems to be a lot of undocumented (admittedly internal) things. For example, the $widths and $heights of a gtable object refer to the rows ans columns of its grid, but what do the $widths and $heights in a gTree refer to? Can I assume that the height of a gTree is the sum of its $heights? (I'm aware of the fact that there are functions to calculate a grob's dimensions, but this is more about understanding the internals)