add ( graph statement -- graph' )
Graphviz > Graphviz data structures

Prev:<edge> ( tail head -- edge )
Next:add-node ( graph id -- graph' )


Vocabulary
graphviz

Inputs and outputs
grapha graph or a subgraph
statementan object
graph'a graph or a subgraph


Word description
Adds an arbitrary object to the statements slot of a graph or subgraph, leaving the updated tuple on the stack. This is the most basic way to construct a graph.

Notes
add does not check the type of statement. You should ensure that graphs and subgraphs only contain instances of:
subgraph
node
edge
graph-attributes
node-attributes
edge-attributes


Examples
USING: accessors graphviz prettyprint sequences ; <graph> 1 <node> add statements>> [ id>> . ] each
"1"


USING: accessors graphviz prettyprint sequences ; <graph> 1 <node> add 2 <node> add statements>> [ id>> . ] each
"1" "2"


USING: accessors classes graphviz prettyprint sequences ; <graph> 1 <node> add 2 <node> add 1 2 <edge> add statements>> [ class-of . ] each
node node edge


See also
add-node, add-nodes, add-path

Definition