Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Strip text search #6

Open
stefanedwards opened this issue Sep 21, 2017 · 1 comment
Open

Idea: Strip text search #6

stefanedwards opened this issue Sep 21, 2017 · 1 comment

Comments

@stefanedwards
Copy link
Owner

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
Copy link
Owner Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant