Open billdenney opened 6 months ago
My thoughts on an interface would be:
paginate_data_map <- function(plot) {
###
}
plot
is the gg object.
plot
is not a gg
object, raise an error.plot
does not use facet_wrap_paginate()
or facet_grid_paginate()
, it would return NULL
, equivalent to `n_pages().
facet_wrap()
or facet_grid()
, it could do the same extraction where page
is always set to 1 in the data, and the columns are still extracted.data.frame(page = 1)
.page
, and if so, choose a different name for the page
column with a warning.
.page
so that it is very unlikely to have a collision, and if there is a collision, add more dots to the beginning of .page
until there is no collision (so ..page
would be tested next). This would also have a warning.
Is there any way to extract the facet to page mapping when using
facet_wrap_paginate()
andfacet_grid_paginate()
? I'm hoping that there is a function likepaginate_data_map()
(which I know doesn't exist) that would extract the information of which facet is on which page similar to the example below:Created on 2024-03-24 with reprex v2.1.0
If it doesn't exist and would be of interest, I could try to make a PR for it with guidance about where to find the information within the gg object.
FYI, this is for use in the
ggtibble
package so that I can automatically expand the pages into agglist
andggtibble
object there.