R/set_node_labels_grob.R

Defines functions set_node_labelsGrob

set_node_labelsGrob <- function(loon.grob, whichIsDeactive) {

  newGrob <- grid::getGrob(loon.grob, "graph labels")
  which_is_active <- setdiff(1:length(newGrob$children), whichIsDeactive)

  lapply(which_is_active,
         function(i){
           newGrob$children[[i]] <<- do.call(
             grid::textGrob,
             getGrobArgs(newGrob$children[[i]])
           )
         }
  )

  grid::setGrob(
    gTree = loon.grob,
    gPath = "graph labels",
    newGrob = newGrob
  )
}

Try the loon.shiny package in your browser

Any scripts or data that you put into this service are public.

loon.shiny documentation built on Oct. 8, 2022, 5:05 p.m.