Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

graph::easy::layout::repair(3pm) [debian man page]

Graph::Easy::Layout::Repair(3pm)			User Contributed Perl Documentation			  Graph::Easy::Layout::Repair(3pm)

NAME
Graph::Easy::Layout::Repair - Repair spliced layout with group cells SYNOPSIS
use Graph::Easy; my $graph = Graph::Easy->new(); my $bonn = Graph::Easy::Node->new( name => 'Bonn', ); my $berlin = Graph::Easy::Node->new( name => 'Berlin', ); $graph->add_edge ($bonn, $berlin); $graph->layout(); print $graph->as_ascii( ); # prints: # +------+ +--------+ # | Bonn | --> | Berlin | # +------+ +--------+ DESCRIPTION
"Graph::Easy::Layout::Repair" contains code that can splice in group cells into a layout, as well as repair the layout after that step. It is part of Graph::Easy and used automatically. METHODS
"Graph::Easy::Layout" injects the following methods into the "Graph::Easy" namespace: _edges_into_groups() Put the edges into the appropriate group and class. _assign_ranks() $graph->_assign_ranks(); _repair_nodes() Splicing the rows/columns to add filler cells will have torn holes into multi-edges nodes, so we insert additional filler cells to repair this. _splice_edges() Splicing the rows/columns to add filler cells might have torn holes into multi-celled edges, so we splice these together again. _repair_edges() Splicing the rows/columns to add filler cells might have put "holes" between an edge start/end and the node cell it points to. This routine fixes this problem by extending the edge by one cell if necessary. _fill_group_cells() After doing a "layout()", we need to add the group to each cell based on what group the nearest node is in. This routine will also find the label cell for each group, and repair edge/node damage done by the splicing. EXPORT
Exports nothing. SEE ALSO
Graph::Easy. AUTHOR
Copyright (C) 2004 - 2007 by Tels <http://bloodgate.com> See the LICENSE file for information. perl v5.14.2 2011-12-23 Graph::Easy::Layout::Repair(3pm)

Check Out this Related Man Page

Graph::Easy::Parser::Graphviz(3pm)			User Contributed Perl Documentation			Graph::Easy::Parser::Graphviz(3pm)

NAME
Graph::Easy::Parser::Graphviz - Parse Graphviz text into Graph::Easy SYNOPSIS
# creating a graph from a textual description use Graph::Easy::Parser::Graphviz; my $parser = Graph::Easy::Parser::Graphviz->new(); my $graph = $parser->from_text( "digraph MyGraph { " . " Bonn -> "Berlin" }" ); print $graph->as_ascii(); print $parser->from_file('mygraph.dot')->as_ascii(); DESCRIPTION
"Graph::Easy::Parser::Graphviz" parses the text format from the DOT language use by Graphviz and constructs a "Graph::Easy" object from it. The resulting object can than be used to layout and output the graph in various formats. Please see the Graphviz manual for a full description of the syntax rules of the DOT language. Output The output will be a Graph::Easy object (unless overrriden with "use_class()"), see the documentation for Graph::Easy what you can do with it. Attributes Attributes will be remapped to the proper Graph::Easy attribute names and values, as much as possible. Anything else will be converted to custom attributes starting with "x-dot-". So "ranksep: 2" will become "x-dot-ranksep: 2". METHODS
"Graph::Easy::Parser::Graphviz" supports the same methods as its parent class "Graph::Easy::Parser": new() use Graph::Easy::Parser::Graphviz; my $parser = Graph::Easy::Parser::Graphviz->new(); Creates a new parser object. There are two valid parameters: debug fatal_errors Both take either a false or a true value. my $parser = Graph::Easy::Parser::Graphviz->new( debug => 1 ); $parser->from_text('digraph G { A -> B }'); reset() $parser->reset(); Reset the status of the parser, clear errors etc. Automatically called when you call any of the "from_XXX()" methods below. use_class() $parser->use_class('node', 'Graph::Easy::MyNode'); Override the class to be used to constructs objects while parsing. See Graph::Easy::Parser for further information. from_text() my $graph = $parser->from_text( $text ); Create a Graph::Easy object from the textual description in $text. Returns undef for error, you can find out what the error was with error(). This method will reset any previous error, and thus the $parser object can be re-used to parse different texts by just calling "from_text()" multiple times. from_file() my $graph = $parser->from_file( $filename ); my $graph = Graph::Easy::Parser->from_file( $filename ); Creates a Graph::Easy object from the textual description in the file $filename. The second calling style will create a temporary parser object, parse the file and return the resulting "Graph::Easy" object. Returns undef for error, you can find out what the error was with error() when using the first calling style. error() my $error = $parser->error(); Returns the last error, or the empty string if no error occured. parse_error() $parser->parse_error( $msg_nr, @params); Sets an error message from a message number and replaces embedded templates like "##param1##" with the passed parameters. CAVEATS
The parser has problems with the following things: encoding and charset attribute The parser assumes the input to be "utf-8". Input files in <code>Latin1</code> are not parsed properly, even when they have the charset attribute set. shape=record Nodes with shape record are only parsed properly when the label does not contain groups delimited by "{" and "}", so the following is parsed wrongly: node1 [ shape=record, label="A|{B|C}" ] default shape The default shape for a node is 'rect', opposed to 'circle' as dot renders nodes. attributes Some attributes are not remapped properly to what Graph::Easy expects, thus losing information, either because Graph::Easy doesn't support this feature yet, or because the mapping is incomplete. Some attributes meant only for nodes or edges etc. might be incorrectly applied to other objects, resulting in unnec. warnings while parsing. Attributes not valid in the original DOT language are silently ignored by dot, but result in a warning when parsing under Graph::Easy. This helps catching all these pesky misspellings, but it's not yet possible to disable these warnings. comments Comments written in the source code itself are discarded. If you want to have comments on the graph, clusters, nodes or edges, use the attribute "comment". These are correctly read in and stored, and then output into the different formats, too. EXPORT
Exports nothing. SEE ALSO
Graph::Easy, Graph::Reader::Dot. AUTHOR
Copyright (C) 2005 - 2007 by Tels <http://bloodgate.com> See the LICENSE file for information. perl v5.14.2 2011-12-23 Graph::Easy::Parser::Graphviz(3pm)
Man Page