Graph::Reader::Dot3pm
Class for reading a graph instance from dot format
Usage
use Graph::Reader::Dot;use Graph;$reader = Graph::Reader::Dot->new();$graph = $reader->read_graph('mygraph.dot');
Overview
Graph::Reader::Dot is a class for reading in a directed graph in the file format used by the dot tool (part of the AT+T graphviz package).
Graph::Reader::Dot is a subclass of Graph::Reader, which defines the generic interface for Graph reader classes.
Methods and configuration
"new()"
Constructor - generate a new reader instance.
$reader = Graph::Reader::Dot->new();
This doesn't take any arguments.
"read_graph()"
Read a graph from a file:
$graph = $reader->read_graph( $file );
The $file argument can be either a filename or a filehandle of a previously opened file.
$Graph::Reader::Dot::UseNodeAttr
Controls, if implicit node attributes given by the dot directive "node[]" will be merged into (new) nodes. Setting it to 0 or "undef" (default) will not disable this feature. Setting it to any other value will enable this feature.
$Graph::Reader::Dot::UseEdgeAttr
Controls, if implicit edge attributes given by the dot directive "edge[]" will be merged into edges. Setting it to 0 or "undef" (default) will not disable this feature. Setting it to any other value will enable this feature.
Restrictions
- •
-
Default (graph) attributes in subgraphs (i.e. inside
"{}") are not processed.
- •
-
Sub nodes as used by dot's
"record"node shape are supported.
- •
-
Undirected graphs will be treated as directed graphs. This means that the
"--"edge operator works as the"->"edge operator.
- •
-
Be aware that you are loosing scope information on writing back the graph.
- •
-
Multiple
"node[]"or"edge[]"statements in the same scope are not correctly supported.
Releases
8 releases since Debian 6.0 (Squeeze); the text changed 5 times.