gv(3php)

πŸ“¦ version 12.2.1, in opensuse-leap 16.0

🌈 gv_php β€” graph manipulation in php 🌈

okay bestie, this is the gv(3php) manual page and it's literally all about gv_php β€” graph manipulation in php. we're gonna go through every command, no skips, no cap πŸ’…

πŸ“› NAME

gv_php - graph manipulation in php

🧾 SYNOPSIS

#!/usr/bin/php
<?
include("gv.php")
?>

πŸ› οΈ USAGE

πŸ’– INTRODUCTION

gv_php is a dynamically loaded extension for php that provides access to the graph facilities of graphviz. ✨

πŸ‘‘ COMMANDS

🌱 New graphs

New empty graph β€” makes a brand-new empty graph and hands you the handle, periodt:

graph_handle gv::graph (name);
graph_handle gv::digraph (name);
graph_handle gv::strictgraph (name);
graph_handle gv::strictdigraph (name);

New graph from a dot-syntax string or file β€” reads dot-syntax in directly, or pulls it from a filename or channel:

graph_handle gv::readstring (string);
graph_handle gv::read (string filename);
graph_handle gv::read (channel);

Add new subgraph to existing graph β€” drops a new subgraph into a graph you already have:

graph_handle gv::graph (graph_handle, name);

🌱 New nodes

Add new node to existing graph β€” makes a new node on that graph:

node_handle gv::node (graph_handle, name);

🌱 New edges

Add new edge between existing nodes β€” connects two node handles you already have:

edge_handle gv::edge (tail_node_handle, head_node_handle);

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 handle, head name, and the head gets induced if it's not already there:

edge_handle gv::edge (tail_node_handle, head_name);

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 handle, tail name, tail gets induced if needed:

edge_handle gv::edge (tail_name, head_node_handle);

Add a new edge between named tail and head nodes which will be induced in the graph if they don't already exist β€” you give the graph plus both names, and both get induced if they're missing:

edge_handle gv::edge (graph_handle, tail_name, head_name);

πŸŽ€ Setting attribute values

Set value of named attribute of graph/node/edge - creating attribute if necessary β€” sets by name and makes the attribute if it has to:

string gv::setv (graph_handle, attr_name, attr_value);
string gv::setv (node_handle, attr_name, attr_value);
string gv::setv (edge_handle, attr_name, attr_value);

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

string gv::setv (graph_handle, attr_handle, attr_value);
string gv::setv (node_handle, attr_handle, attr_value);
string gv::setv (edge_handle, attr_handle, attr_value);

πŸ’Ž Getting attribute values

Get value of named attribute of graph/node/edge β€” reads the value by attribute name:

string gv::getv (graph_handle, attr_name);
string gv::getv (node_handle, attr_name);
string gv::getv (edge_handle, attr_name);

Get value of attribute of graph/node/edge (using attribute handle) β€” reads it with an attribute handle:

string gv::getv (graph_handle, attr_handle);
string gv::getv (node_handle, attr_handle);
string gv::getv (edge_handle, attr_handle);

πŸ¦‹ Obtain names from handles

Obtain names from handles β€” turns a handle back into its name string:

string gv::nameof (graph_handle);
string gv::nameof (node_handle);
string gv::nameof (attr_handle);

πŸ” Find handles from names

Find handles from names β€” looks up subgraph, node, edge, and attribute handles by name:

graph_handle gv::findsubg (graph_handle, name);
node_handle gv::findnode (graph_handle, name);
edge_handle gv::findedge (tail_node_handle, head_node_handle);
attribute_handle gv::findattr (graph_handle, name);
attribute_handle gv::findattr (node_handle, name);
attribute_handle gv::findattr (edge_handle, name);

🧭 Misc graph navigators returning handles

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

node_handle gv::headof (edge_handle);
node_handle gv::tailof (edge_handle);
graph_handle gv::graphof (graph_handle);
graph_handle gv::graphof (edge_handle);
graph_handle gv::graphof (node_handle);
graph_handle gv::rootof (graph_handle);

🧚 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 or proto edge handle so you can set default attribute values:

node_handle gv::protonode (graph_handle);
edge_handle gv::protoedge (graph_handle);

πŸ” Iterators

Iteration termination tests β€” vibe check truthy test for graph, node, edge, and attribute iterators:

bool gv::ok (graph_handle);
bool gv::ok (node_handle);
bool gv::ok (edge_handle);
bool gv::ok (attr_handle);

Iterate over subgraphs of a graph β€” first and next subgraph handles:

graph_handle gv::firstsubg (graph_handle);
graph_handle gv::nextsubg (graph_handle, subgraph_handle);

Iterate over supergraphs of a graph (obscure and rarely useful) β€” first and next supergraph handles; yeah, the original literally calls this obscure and rarely useful, iykyk:

graph_handle gv::firstsupg (graph_handle);
graph_handle gv::nextsupg (graph_handle, subgraph_handle);

Iterate over edges of a graph β€” first and next edge handles on a graph:

edge_handle gv::firstedge (graph_handle);
edge_handle gv::nextedge (graph_handle, edge_handle);

Iterate over outedges of a graph β€” first and next outedge handles on a graph:

edge_handle gv::firstout (graph_handle);
edge_handle gv::nextout (graph_handle, edge_handle);

Iterate over edges of a node β€” first and next edge handles on a node:

edge_handle gv::firstedge (node_handle);
edge_handle gv::nextedge (node_handle, edge_handle);

Iterate over out-edges of a node β€” first and next out-edge handles on a node:

edge_handle gv::firstout (node_handle);
edge_handle gv::nextout (node_handle, edge_handle);

Iterate over head nodes reachable from out-edges of a node β€” first and next head node handles:

node_handle gv::firsthead (node_handle);
node_handle gv::nexthead (node_handle, head_node_handle);

Iterate over in-edges of a graph β€” first and next in-edge handles for a graph:

edge_handle gv::firstin (graph_handle);
edge_handle gv::nextin (node_handle, edge_handle);

Iterate over in-edges of a node β€” first and next in-edge handles for a node:

edge_handle gv::firstin (node_handle);
edge_handle gv::nextin (graph_handle, edge_handle);

Iterate over tail nodes reachable from in-edges of a node β€” first and next tail node handles:

node_handle gv::firsttail (node_handle);
node_handle gv::nexttail (node_handle, tail_node_handle);

Iterate over nodes of a graph β€” first and next node handles on a graph:

node_handle gv::firstnode (graph_handle);
node_handle gv::nextnode (graph_handle, node_handle);

Iterate over nodes of an edge β€” first and next node handles on an edge:

node_handle gv::firstnode (edge_handle);
node_handle gv::nextnode (edge_handle, node_handle);

Iterate over attributes of a graph β€” first and next attribute handles on a graph:

attribute_handle gv::firstattr (graph_handle);
attribute_handle gv::nextattr (graph_handle, attr_handle);

Iterate over attributes of an edge β€” first and next attribute handles on an edge:

attribute_handle gv::firstattr (edge_handle);
attribute_handle gv::nextattr (edge_handle, attr_handle);

Iterate over attributes of a node β€” first and next attribute handles on a node:

attribute_handle gv::firstattr (node_handle);
attribute_handle gv::nextattr (node_handle, attr_handle);

Remove graph objects β€” removes a graph, node, or edge object, returns bool:

bool gv::rm (graph_handle);
bool gv::rm (node_handle);
bool gv::rm (edge_handle);

🎨 Layout

Annotate a graph with layout attributes and values using a specific layout engine β€” runs the layout engine you name and writes the layout attributes and values onto the graph, main character energy:

bool gv::layout (graph_handle, string engine);

πŸ–ΌοΈ Render

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

bool gv::render (graph_handle);

Render a layout to stdout β€” renders straight to stdout in the format you name:

bool gv::render (graph_handle, string format);

Render to an open file β€” renders to an open channel fout:

bool gv::render (graph_handle, string format, channel fout);

Render a layout to an unopened file by name β€” renders to a file that isn't opened yet, by filename:

bool gv::render (graph_handle, string format, string filename);

Render to a string result β€” string result output, with the exact signatures:

string gv::renderresult (graph_handle ing, string format);
gv::renderresult (graph_handle, string format, string outdata);
not me keeping graph_handle ing exactly as written πŸ’€ that's literally what the page says, bestie.

Render to an open channel β€” renders to an open channel by channel name:

bool gv::renderchannel (graph_handle, string format, string
              channelname);

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

(deprecated - too easy to leak memory) (still needed for "eval [gv::renderdata $G tk]" )
string gv::renderdata (graph_handle, string format);

πŸ“ Writing graph back to file

Writing graph back to file β€” writes the graph to a filename, or to a channel:

bool gv::write (graph_handle, string filename);
bool gv::write (graph_handle, channel);

πŸ”„ Graph transformation tools

Graph transformation tools β€” the graph transformation tool hook:

bool gv::tred (graph_handle);

🏷️ KEYWORDS

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

okay that's the whole page, bestie 🫢 β€” it's gv(3php), stamped 1748602181 ✨

πŸ“¦ where this page comes from