Skip to contents

Uses R6toPlant to generate a PlantUML file from a set of R6 classes, then calls plantuml to render it as an SVG.

When output_dir is NULL (default), the SVG is piped from plantuml to stdout and returned as a character string — suitable for inline rendering in a vignette chunk with output: asis. When output_dir is provided, the .uml and .svg files are written to that directory instead.

Usage

nemo_uml(classes, output_dir = NULL, pkg = "nemo")

Arguments

classes

(character(n))
Names of R6 classes to include in the diagram.

output_dir

(character(1) or NULL)
Output directory for the .uml and .svg files. If NULL, returns the SVG as a string.

pkg

(character(1))
Package namespace to look up class objects from.

Value

When output_dir is NULL, a character string containing the SVG. Otherwise, the path to the .uml file (invisibly).

Examples

if (FALSE) { # \dontrun{
# inline SVG for vignette use
svg <- nemo_uml(c("Config", "Tool", "Tool1", "Workflow", "Workflow1"))

# write files to disk
nemo_uml(
  classes = c("Config", "Tool", "Tool1", "Workflow", "Workflow1"),
  output_dir = here::here("vignettes", "fig", "uml")
)
} # }