Open thomasp85 opened 1 month ago
It may be hard because the intent of the theme is not always obvious from its parts. E.g. theme_minimal()
has the intention of minimalism but there is no obvious way to deduce that other than looking at it's effect on a plot
@teunbrand any ideas for this?
I had a bit of an experiment going with more formally putting gt tables as legends/axes. The code I used to homogenise styling lives here: https://github.com/teunbrand/gtguides/blob/138c17c177c03e64624052f88a4875592dbff2d6/R/gtlegend.R#L197-L240 However, this is a first draft and doesn't really cover everything.
It'd be easier if tables had dedicated ggplot2 theme elements to deal with table specific stuff like stripes and such. The question however is where these theme settings should live. {gt} has no dependency on {ggplot2} and {ggplot2} has no intrinsically motivated reason to incorporate such elements.
Perhaps too specifically, I've also had some more detailed ideas.
plot.background
and panel.background
to have alternating colours for striping. This would mean theme_gray()
has striping but theme_minimal()
does not.panel.grid
could determine what the body cell borders looks like, so theme_minimal()
would have light gray borders, theme_gray()
white borders (that only show up on striped cells) and theme_classic()
would have no borders.panel.border
could be used for the first and last borderlines that set apart the table body.Yeah, I was thinking something along those lines but I'm still unsure whether the end result would feel "native" to the plot.
It could be pretty nifty if we could derive a nice compatible theming of gt tables from a complete ggplot2 theme...