inst/app/controllers/reactives_modify.R

# do we have a tree with root-node only?
is_empty_tree <- reactive({
  if (json() == "[]") {
    return(TRUE)
  }
  return(FALSE)
})

hierarchy <- reactive({
  js <- json()
  if (is.null(js)) {
    return(NULL)
  }
  hier_import(inp = js, from = "json")
})

overall_level_name <- reactive({
  attributes(json())$totlev
})

all_nodes <- reactive({
  dd <- hierarchy()
  if (is.null(dd)) {
    return("")
  }
  hier_nodenames(dd)
})

Try the sdcHierarchies package in your browser

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

sdcHierarchies documentation built on May 29, 2024, 8:01 a.m.