lemon icon indicating copy to clipboard operation
lemon copied to clipboard

Idea: Strip text search

Open stefanedwards opened this issue 6 years ago • 1 comments

To find a strip (any?) grob with a particular label. Question is, what to return? It is essentially a tree-path to the grob.

stefanedwards avatar Sep 21 '17 10:09 stefanedwards

Code from a project that searches for 'Overall' and updates the gpar to bold.

# find strip overall and make bold
i <- (grepl('strip', g$layout$name) & !sapply(g$grobs, lemon:::is.zero)) %>% which
j <- which(sapply(g$grobs[i], function(x) x[[1]][[1]]$children[[2]]$children[[1]]$label, simplify=FALSE) == 'Overall')
g$grobs[[i[j]]]$grobs[[1]]$children[[2]]$children[[1]]$gp$fontface <- 'bold' 
g$grobs[[i[j]]]$grobs[[1]]$children[[2]]$children[[1]]$gp$font <- c('bold'=2L)

stefanedwards avatar Dec 08 '17 10:12 stefanedwards