gv(3r)

πŸ“¦
version 16.1.0 Β· 5 versions
, in arch rolling

🫢 gv(3r) β€” gv_R: graph manipulation in R πŸ’…

okay bestie, this is the manual page for gv_R, the R extension for graphviz graph facilities. The header vibe is gv(3r), and the whole thing is literally graph manipulation in R. no cap. πŸ’–

πŸ’– NAME πŸ’–

gv_R β€” graph manipulation in R. iconic.

✨ SYNOPSIS ✨

System.loadLibrary("gv");

🌈 USAGE 🌈

the usage section is present and accounted for, bestie. introduction era is next.

πŸ¦‹ INTRODUCTION πŸ¦‹

gv_R is a dynamically loaded extension for R that provides access to the graph facilities of graphviz. that's the intro, and it ate. 🫢


πŸŽ€ COMMANDS πŸŽ€

okay so here's the whole command buffet β€” every overload, every handle, every little SWIGTYPE_p_... kept exactly. no cap.

New graphs

New empty graph β€” fresh graph, no nodes, no drama.

SWIGTYPE_p_Agraph_t gv.graph (string name);
SWIGTYPE_p_Agraph_t gv.digraph (string name);
SWIGTYPE_p_Agraph_t gv.strictgraph (string name);
SWIGTYPE_p_Agraph_t gv.strictdigraph (string name);

New graph from a dot-syntax string or file β€” read the dot-syntax tea from a string or a file.

SWIGTYPE_p_Agraph_t gv.readstring (string string);
SWIGTYPE_p_Agraph_t gv.read (string filename);
SWIGTYPE_p_Agraph_t gv.read (SWIGTYPE_p_FILE f);

Add new subgraph to existing graph β€” exactly what it says, bestie.

SWIGTYPE_p_Agraph_t gv.graph (SWIGTYPE_p_Agraph_t g, string
              name);

New nodes

Add new node to existing graph β€” drop a node into a graph.

SWIGTYPE_p_Agnode_t gv.node (SWIGTYPE_p_Agraph_t g, string name);

New edges

Add new edge between existing nodes β€” connect two existing nodes.

SWIGTYPE_p_Agedge_t gv.edge (SWIGTYPE_p_Agnode_t t,
              SWIGTYPE_p_Agnode_t h);

Add a new edge between an existing tail node, and a named head node which will be induced in the graph if it doesn't already exist β€” tail is already there, head gets induced if missing.

SWIGTYPE_p_Agedge_t gv.edge (SWIGTYPE_p_Agnode_t t, string
              hname);

Add a new edge between an existing head node, and a named tail node which will be induced in the graph if it doesn't already exist β€” head is already there, tail gets induced if missing.

SWIGTYPE_p_Agedge_t gv.edge (string tname, SWIGTYPE_p_Agnode_t
              h);

Add a new edge between named tail and head nodes which will be induced in the graph if they don't already exist β€” named tail and head nodes, induced if they're not already there.

SWIGTYPE_p_Agedge_t gv.edge (SWIGTYPE_p_Agraph_t g, string tname,
              string hname);

Setting attribute values

Set value of named attribute of graph/node/edge - creating attribute if necessary β€” set by name, and if the attribute isn't there yet it gets created.

string gv.setv (SWIGTYPE_p_Agraph_t g, string attr, string val);
string gv.setv (SWIGTYPE_p_Agnode_t n, string attr, string val);
string gv.setv (SWIGTYPE_p_Agedge_t e, string attr, string val);

Set value of existing attribute of graph/node/edge (using attribute handle) β€” same setting energy, but with an Agsym_t handle.

string gv.setv (SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agsym_t a,
              string val);
string gv.setv (SWIGTYPE_p_Agnode_t n, SWIGTYPE_p_Agsym_t a,
              string val);
string gv.setv (SWIGTYPE_p_Agedge_t e, SWIGTYPE_p_Agsym_t a,
              string val);

Getting attribute values

Get value of named attribute of graph/node/edge β€” read the value by attribute name.

string gv.getv (SWIGTYPE_p_Agraph_t g, string attr);
string gv.getv (SWIGTYPE_p_Agnode_t n, string attr);
string gv.getv (SWIGTYPE_p_Agedge_t e, string attr);

Get value of attribute of graph/node/edge (using attribute handle) β€” read it with an Agsym_t handle.

string gv.getv (SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agsym_t a);
string gv.getv (SWIGTYPE_p_Agnode_t n, SWIGTYPE_p_Agsym_t a);
string gv.getv (SWIGTYPE_p_Agedge_t e, SWIGTYPE_p_Agsym_t a);

Obtain names from handles

Obtain names from handles β€” turn a handle back into its name.

string gv.nameof (SWIGTYPE_p_Agraph_t g);
string gv.nameof (SWIGTYPE_p_Agnode_t n);
string gv.nameof (SWIGTYPE_p_Agsym_t a);

Find handles from names

Find handles from names β€” name in, handle out. slay.

SWIGTYPE_p_Agraph_t gv.findsubg (SWIGTYPE_p_Agraph_t g, string
              name);
SWIGTYPE_p_Agnode_t gv.findnode (SWIGTYPE_p_Agraph_t g, string
              name);
SWIGTYPE_p_Agedge_t gv.findedge (SWIGTYPE_p_Agnode_t t,
              SWIGTYPE_p_Agnode_t h);
SWIGTYPE_p_Agsym_t gv.findattr (SWIGTYPE_p_Agraph_t g, string
              name);
SWIGTYPE_p_Agsym_t gv.findattr (SWIGTYPE_p_Agnode_t n, string
              name);
SWIGTYPE_p_Agsym_t gv.findattr (SWIGTYPE_p_Agedge_t e, string
              name);

Misc graph navigators returning handles

Misc graph navigators returning handles β€” little navigator besties that hand you handles.

SWIGTYPE_p_Agnode_t gv.headof (SWIGTYPE_p_Agedge_t e);
SWIGTYPE_p_Agnode_t gv.tailof (SWIGTYPE_p_Agedge_t e);
SWIGTYPE_p_Agraph_t gv.graphof (SWIGTYPE_p_Agraph_t g);
SWIGTYPE_p_Agraph_t gv.graphof (SWIGTYPE_p_Agedge_t e);
SWIGTYPE_p_Agraph_t gv.graphof (SWIGTYPE_p_Agnode_t n);
SWIGTYPE_p_Agraph_t gv.rootof (SWIGTYPE_p_Agraph_t g);

Obtain handles of proto node/edge for setting default attribute values

Obtain handles of proto node/edge for setting default attribute values β€” grab the proto node/edge handles for default attribute values.

SWIGTYPE_p_Agnode_t gv.protonode (SWIGTYPE_p_Agraph_t g);
SWIGTYPE_p_Agedge_t gv.protoedge (SWIGTYPE_p_Agraph_t g);

Iterators

Iteration termination tests β€” check if the iterator is still okay to keep going.

bool gv.ok (SWIGTYPE_p_Agraph_t g);
bool gv.ok (SWIGTYPE_p_Agnode_t n);
bool gv.ok (SWIGTYPE_p_Agedge_t e);
bool gv.ok (SWIGTYPE_p_Agsym_t a);

Iterate over subgraphs of a graph β€” subgraph loop time.

SWIGTYPE_p_Agraph_t gv.firstsubg (SWIGTYPE_p_Agraph_t g);
SWIGTYPE_p_Agraph_t gv.nextsubg (SWIGTYPE_p_Agraph_t g,
              SWIGTYPE_p_Agraph_t sg);

Iterate over supergraphs of a graph (obscure and rarely useful) β€” yes, the original literally calls this obscure and rarely useful. we keep that energy.

SWIGTYPE_p_Agraph_t gv.firstsupg (SWIGTYPE_p_Agraph_t g);
SWIGTYPE_p_Agraph_t gv.nextsupg (SWIGTYPE_p_Agraph_t g,
              SWIGTYPE_p_Agraph_t sg);

Iterate over edges of a graph β€” edge loop on a graph.

SWIGTYPE_p_Agedge_t gv.firstedge (SWIGTYPE_p_Agraph_t g);
SWIGTYPE_p_Agedge_t gv.nextedge (SWIGTYPE_p_Agraph_t g,
              SWIGTYPE_p_Agedge_t e);

Iterate over outedges of a graph β€” outedge loop on a graph.

SWIGTYPE_p_Agedge_t gv.firstout (SWIGTYPE_p_Agraph_t g);
SWIGTYPE_p_Agedge_t gv.nextout (SWIGTYPE_p_Agraph_t g,
              SWIGTYPE_p_Agedge_t e);

Iterate over edges of a node β€” edge loop on a node.

SWIGTYPE_p_Agedge_t gv.firstedge (SWIGTYPE_p_Agnode_t n);
SWIGTYPE_p_Agedge_t gv.nextedge (SWIGTYPE_p_Agnode_t n,
              SWIGTYPE_p_Agedge_t e);

Iterate over out-edges of a node β€” out-edge loop on a node.

SWIGTYPE_p_Agedge_t gv.firstout (SWIGTYPE_p_Agnode_t n);
SWIGTYPE_p_Agedge_t gv.nextout (SWIGTYPE_p_Agnode_t n,
              SWIGTYPE_p_Agedge_t e);

Iterate over head nodes reachable from out-edges of a node β€” head node loop from a node's out-edges.

SWIGTYPE_p_Agnode_t gv.firsthead (SWIGTYPE_p_Agnode_t n);
SWIGTYPE_p_Agnode_t gv.nexthead (SWIGTYPE_p_Agnode_t n,
              SWIGTYPE_p_Agnode_t h);

Iterate over in-edges of a graph β€” in-edge loop on a graph.

SWIGTYPE_p_Agedge_t gv.firstin (SWIGTYPE_p_Agraph_t g);
SWIGTYPE_p_Agedge_t gv.nextin (SWIGTYPE_p_Agnode_t n,
              SWIGTYPE_p_Agedge_t e);

Iterate over in-edges of a node β€” in-edge loop on a node.

SWIGTYPE_p_Agedge_t gv.firstin (SWIGTYPE_p_Agnode_t n);
SWIGTYPE_p_Agedge_t gv.nextin (SWIGTYPE_p_Agraph_t g,
              SWIGTYPE_p_Agedge_t e);

Iterate over tail nodes reachable from in-edges of a node β€” tail node loop from a node's in-edges.

SWIGTYPE_p_Agnode_t gv.firsttail (SWIGTYPE_p_Agnode_t n);
SWIGTYPE_p_Agnode_t gv.nexttail (SWIGTYPE_p_Agnode_t n,
              SWIGTYPE_p_Agnode_t t);

Iterate over nodes of a graph β€” node loop on a graph.

SWIGTYPE_p_Agnode_t gv.firstnode (SWIGTYPE_p_Agraph_t g);
SWIGTYPE_p_Agnode_t gv.nextnode (SWIGTYPE_p_Agraph_t g,
              SWIGTYPE_p_Agnode_t n);

Iterate over nodes of an edge β€” node loop on an edge.

SWIGTYPE_p_Agnode_t gv.firstnode (SWIGTYPE_p_Agedge_t e);
SWIGTYPE_p_Agnode_t gv.nextnode (SWIGTYPE_p_Agedge_t e,
              SWIGTYPE_p_Agnode_t n);

Iterate over attributes of a graph β€” attribute loop on a graph.

SWIGTYPE_p_Agsym_t gv.firstattr (SWIGTYPE_p_Agraph_t g);
SWIGTYPE_p_Agsym_t gv.nextattr (SWIGTYPE_p_Agraph_t g,
              SWIGTYPE_p_Agsym_t a);

Iterate over attributes of an edge β€” attribute loop on an edge.

SWIGTYPE_p_Agsym_t gv.firstattr (SWIGTYPE_p_Agedge_t e);
SWIGTYPE_p_Agsym_t gv.nextattr (SWIGTYPE_p_Agedge_t e,
              SWIGTYPE_p_Agsym_t a);

Iterate over attributes of a node β€” attribute loop on a node.

SWIGTYPE_p_Agsym_t gv.firstattr (SWIGTYPE_p_Agnode_t n);
SWIGTYPE_p_Agsym_t gv.nextattr (SWIGTYPE_p_Agnode_t n,
              SWIGTYPE_p_Agsym_t a);

Remove graph objects

Remove graph objects β€” rm the graph, node, or edge.

bool gv.rm (SWIGTYPE_p_Agraph_t g);
bool gv.rm (SWIGTYPE_p_Agnode_t n);
bool gv.rm (SWIGTYPE_p_Agedge_t e);

Layout

Annotate a graph with layout attributes and values using a specific layout engine β€” layout engine goes in, graph gets annotated.

bool gv.layout (SWIGTYPE_p_Agraph_t g, string engine);

Render

Render a layout into attributes of the graph β€” render into the graph's attributes.

bool gv.render (SWIGTYPE_p_Agraph_t g);

Render a layout to stdout β€” render to stdout with a format.

bool gv.render (SWIGTYPE_p_Agraph_t g, string format);

Render to an open file β€” render to an already-open file.

bool gv.render (SWIGTYPE_p_Agraph_t g, string format,
              SWIGTYPE_p_FILE fout);

Render a layout to an unopened file by name β€” render to a file by name.

bool gv.render (SWIGTYPE_p_Agraph_t g, string format, string
              filename);

Render to a string result β€” string result time.

string gv.renderresult (SWIGTYPE_p_Agraph_t ing, string format);
gv.renderresult (SWIGTYPE_p_Agraph_t g, string format, string
              outdata);

Render to an open channel β€” render to a named open channel.

bool gv.renderchannel (SWIGTYPE_p_Agraph_t g, string format,
              string channelname);

Render a layout to a malloc'ed string, to be free'd by the caller β€” deprecated - too easy to leak memory. still needed for "eval [gv::renderdata $G tk]".

string gv.renderdata (SWIGTYPE_p_Agraph_t g, string format);

Writing graph back to file

Writing graph back to file β€” write the graph back out.

bool gv.write (SWIGTYPE_p_Agraph_t g, string filename);
bool gv.write (SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_FILE f);

Graph transformation tools

Graph transformation tools β€” graph transformation, bestie.

bool gv.tred (SWIGTYPE_p_Agraph_t g);

πŸ”‘ KEYWORDS πŸ”‘

graph, dot, neato, fdp, circo, twopi, R.


okay that's the whole gv(3r) page, bestie. footer bits: 1792256243 and the manual tag gv(3r). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from