Scroll to navigation

gv(3ruby) gv(3ruby)

NAME

gv_ruby - graph manipulation in ruby

SYNOPSIS

#!/usr/bin/ruby
require 'gv'

USAGE

INTRODUCTION

gv_ruby is a dynamically loaded extension for ruby that provides access to the graph facilities of graphviz.

COMMANDS



graph_handle Gv.graph (name);
graph_handle Gv.digraph (name);
graph_handle Gv.strictgraph (name);
graph_handle Gv.strictdigraph (name);

graph_handle Gv.readstring (string);
graph_handle Gv.read (string filename);
graph_handle Gv.read (channel);

graph_handle Gv.graph (graph_handle, name);


node_handle Gv.node (graph_handle, name);


edge_handle Gv.edge (tail_node_handle, head_node_handle);

edge_handle Gv.edge (tail_node_handle, head_name);

edge_handle Gv.edge (tail_name, head_node_handle);

edge_handle Gv.edge (graph_handle, tail_name, head_name);


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);

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);


string Gv.getv (graph_handle, attr_name);
string Gv.getv (node_handle, attr_name);
string Gv.getv (edge_handle, attr_name);

string Gv.getv (graph_handle, attr_handle);
string Gv.getv (node_handle, attr_handle);
string Gv.getv (edge_handle, attr_handle);

string Gv.nameof (graph_handle);
string Gv.nameof (node_handle);
string Gv.nameof (attr_handle);

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);

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);

node_handle Gv.protonode (graph_handle);
edge_handle Gv.protoedge (graph_handle);


bool Gv.ok (graph_handle);
bool Gv.ok (node_handle);
bool Gv.ok (edge_handle);
bool Gv.ok (attr_handle);

graph_handle Gv.firstsubg (graph_handle);
graph_handle Gv.nextsubg (graph_handle, subgraph_handle);

graph_handle Gv.firstsupg (graph_handle);
graph_handle Gv.nextsupg (graph_handle, subgraph_handle);

edge_handle Gv.firstedge (graph_handle);
edge_handle Gv.nextedge (graph_handle, edge_handle);

edge_handle Gv.firstout (graph_handle);
edge_handle Gv.nextout (graph_handle, edge_handle);

edge_handle Gv.firstedge (node_handle);
edge_handle Gv.nextedge (node_handle, edge_handle);

edge_handle Gv.firstout (node_handle);
edge_handle Gv.nextout (node_handle, edge_handle);

node_handle Gv.firsthead (node_handle);
node_handle Gv.nexthead (node_handle, head_node_handle);

edge_handle Gv.firstin (graph_handle);
edge_handle Gv.nextin (node_handle, edge_handle);

edge_handle Gv.firstin (node_handle);
edge_handle Gv.nextin (graph_handle, edge_handle);

node_handle Gv.firsttail (node_handle);
node_handle Gv.nexttail (node_handle, tail_node_handle);

node_handle Gv.firstnode (graph_handle);
node_handle Gv.nextnode (graph_handle, node_handle);

node_handle Gv.firstnode (edge_handle);
node_handle Gv.nextnode (edge_handle, node_handle);

attribute_handle Gv.firstattr (graph_handle);
attribute_handle Gv.nextattr (graph_handle, attr_handle);

attribute_handle Gv.firstattr (edge_handle);
attribute_handle Gv.nextattr (edge_handle, attr_handle);

attribute_handle Gv.firstattr (node_handle);
attribute_handle Gv.nextattr (node_handle, attr_handle);

bool Gv.rm (graph_handle);
bool Gv.rm (node_handle);
bool Gv.rm (edge_handle);


bool Gv.layout (graph_handle, string engine);


bool Gv.render (graph_handle);

bool Gv.render (graph_handle, string format);

bool Gv.render (graph_handle, string format, channel fout);

bool Gv.render (graph_handle, string format, string filename);

string Gv.renderresult (graph_handle ing, string format);
Gv.renderresult (graph_handle, string format, string outdata);

bool Gv.renderchannel (graph_handle, string format, string channelname);

(deprecated - too easy to leak memory)

(still needed for "eval [gv::renderdata $G tk]" )

string Gv.renderdata (graph_handle, string format);

bool Gv.write (graph_handle, string filename);
bool Gv.write (graph_handle, channel);

bool Gv.tred (graph_handle);

KEYWORDS

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

28 March 2022