Function that takes a list with node details and draws them on an existing figure (see [pathdiagrams::pd_base_figure]). Details for nodes can be added to a list via [pathdiagrams::pd_node].

pd_draw_nodes(
  inputs,
  args.polygon = NULL,
  args.text = NULL,
  args.arrows = NULL
)

Arguments

inputs

A named list, where each element corresponds to a node to add to the figure.

args.polygon

A named list, additional arguments to pass to the [graphics::polygon] function to apply to all nodes without pre-existing options already specified.

Examples

pd_base_figure( default = '5 x 5' )

lst_inputs <- list() |>
  pd_node( 'N01', c(x = .5, y = .8), string = 'Node-1' ) |>
  pd_node( 'N02', string = 'Node-2',
           from = c( N01.center = 0, N01.bottom = -1.5 ),
           to = 'top - N01.bottom' )
pd_draw_nodes( lst_inputs )