Note: this is an initial experimental implementation of diagram building and may change or be deprecated in the future.
Usage
d2_diagram(
lines = NULL,
...,
connector = NULL,
id = NULL,
direction = getOption("d2r.direction"),
import = NULL,
collapse = NULL
)
Arguments
- lines
A list or character vector. Named elements are connected using the supplied
connector
value. Unnamed elements are kept as is and assumed to be valid D2 code.- ...
Additional elements for diagram included after initial lines.
- connector
Default to
NULL
which uses"->"
to connect the name of any shape to the value of any shape. Must be vector of: –, ->, <-, and <->. Vector is recycled to match length of named shapes.- id
Identifier for map container for diagram.
- direction
Optional direction for diagram. Must be one of: up, down, right, and left.
- import
File name or names to append as an import to the top of the diagram. If named, the standard import method using the name of the import as the name of the imported element. If import is unnamed, the partial import method is used: https://d2lang.com/tour/imports#partial-imports See: https://d2lang.com/tour/imports
- collapse
an optional character string to separate the results. Not
NA_character_
. Whencollapse
is a string, the result is always a string (character
of length 1).