Uses R6toPlant to generate a PlantUML file from a set of R6 classes,
then calls plantuml to render it as an SVG.
With output_dir = NULL the SVG is returned as a string (for an
output: asis vignette chunk); otherwise the .uml and .svg are written
there.
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")
)
} # }