1Graph::Easy(3) User Contributed Perl Documentation Graph::Easy(3)
2
3
4
6 Graph::Easy - Convert or render graphs (as ASCII, HTML, SVG or via
7 Graphviz)
8
10 use Graph::Easy;
11
12 my $graph = Graph::Easy->new();
13
14 # make a fresh copy of the graph
15 my $new_graph = $graph->copy();
16
17 $graph->add_edge ('Bonn', 'Berlin');
18
19 # will not add it, since it already exists
20 $graph->add_edge_once ('Bonn', 'Berlin');
21
22 print $graph->as_ascii( ); # prints:
23
24 # +------+ +--------+
25 # | Bonn | --> | Berlin |
26 # +------+ +--------+
27
28 #####################################################
29 # alternatively, let Graph::Easy parse some text:
30
31 my $graph = Graph::Easy->new( '[Bonn] -> [Berlin]' );
32
33 #####################################################
34 # slightly more verbose way:
35
36 my $graph = Graph::Easy->new();
37
38 my $bonn = $graph->add_node('Bonn');
39 $bonn->set_attribute('border', 'solid 1px black');
40
41 my $berlin = $graph->add_node('Berlin');
42
43 $graph->add_edge ($bonn, $berlin);
44
45 print $graph->as_ascii( );
46
47 # You can use plain scalars as node names and for the edge label:
48 $graph->add_edge ('Berlin', 'Frankfurt', 'via train');
49
50 # adding edges with attributes:
51
52 my $edge = Graph::Easy::Edge->new();
53 $edge->set_attributes( {
54 label => 'train',
55 style => 'dotted',
56 color => 'red',
57 } );
58
59 # now with the optional edge object
60 $graph->add_edge ($bonn, $berlin, $edge);
61
62 # raw HTML section
63 print $graph->as_html( );
64
65 # complete HTML page (with CSS)
66 print $graph->as_html_file( );
67
68 # Other possibilities:
69
70 # SVG (possible after you installed Graph::Easy::As_svg):
71 print $graph->as_svg( );
72
73 # Graphviz:
74 my $graphviz = $graph->as_graphviz();
75 open $DOT, '|dot -Tpng -o graph.png' or die ("Cannot open pipe to dot: $!");
76 print $DOT $graphviz;
77 close $DOT;
78
79 # Please see also the command line utility 'graph-easy'
80
82 "Graph::Easy" lets you generate graphs consisting of various shaped
83 nodes connected by edges (with optional labels).
84
85 It can read and write graphs in a variety of formats, as well as render
86 them via its own grid-based layouter.
87
88 Since the layouter works on a grid (manhattan layout), the output is
89 most useful for flow charts, network diagrams, or hierarchy trees.
90
91 Input
92 Apart from driving the module with Perl code, you can also use
93 "Graph::Easy::Parser" to parse graph descriptions like:
94
95 [ Bonn ] --> [ Berlin ]
96 [ Frankfurt ] <=> [ Dresden ]
97 [ Bonn ] -- [ Frankfurt ]
98
99 See the "EXAMPLES" section below for how this might be rendered.
100
101 Creating graphs
102 First, create a graph object:
103
104 my $graph = Graph::Easy->new();
105
106 Then add a node to it:
107
108 my $node = $graph->add_node('Koblenz');
109
110 Don't worry, adding the node again will do nothing:
111
112 $node = $graph->add_node('Koblenz');
113
114 You can get back a node by its name with "node()":
115
116 $node = $graph->node('Koblenz');
117
118 You can either add another node:
119
120 my $second = $graph->node('Frankfurt');
121
122 Or add an edge straight-away:
123
124 my ($first,$second,$edge) = $graph->add_edge('Mainz','Ulm');
125
126 Adding the edge the second time creates another edge from 'Mainz' to
127 'Ulm':
128
129 my $other_edge;
130 ($first,$second,$other_edge) = $graph->add_edge('Mainz','Ulm');
131
132 This can be avoided by using "add_edge_once()":
133
134 my $edge = $graph->add_edge_once('Mainz','Ulm');
135 if (defined $edge)
136 {
137 # the first time the edge was added, do something with it
138 $edge->set_attribute('color','blue');
139 }
140
141 You can set attributes on nodes and edges:
142
143 $node->attribute('fill', 'yellow');
144 $edge->attribute('label', 'train');
145
146 It is possible to add an edge with a label:
147
148 $graph->add_edge('Cottbus', 'Berlin', 'my label');
149
150 You can also add self-loops:
151
152 $graph->add_edge('Bremen','Bremen');
153
154 Adding multiple nodes is easy:
155
156 my ($bonn,$rom) = Graph::Easy->add_nodes('Bonn','Rom');
157
158 You can also have subgraphs (these are called groups):
159
160 my ($group) = Graph::Easy->add_group('Cities');
161
162 Only nodes can be part of a group, edges are automatically considered
163 to be in the group if they lead from one node inside the group to
164 another node in the same group. There are multiple ways to add one or
165 more nodes into a group:
166
167 $group->add_member($bonn);
168 $group->add_node($rom);
169 $group->add_nodes($rom,$bonn);
170
171 For more options please see the online manual:
172 <http://bloodgate.com/perl/graph/manual/> .
173
174 Output
175 The output can be done in various styles:
176
177 ASCII ART
178 Uses things like "+", "-" "<" and "|" to render the boxes.
179
180 BOXART
181 Uses Unicode box art drawing elements to output the graph.
182
183 HTML
184 HTML tables with CSS making everything "pretty".
185
186 SVG
187 Creates a Scalable Vector Graphics output.
188
189 Graphviz
190 Creates graphviz code that can be feed to 'dot', 'neato' or similar
191 programs.
192
193 GraphML
194 Creates a textual description of the graph in the GraphML format.
195
196 GDL/VCG
197 Creates a textual description of the graph in the VCG or GDL (Graph
198 Description Language) format.
199
201 The following examples are given in the simple text format that is
202 understood by Graph::Easy::Parser.
203
204 You can also see many more examples at:
205
206 <http://bloodgate.com/perl/graph/>
207
208 One node
209 The most simple graph (apart from the empty one :) is a graph
210 consisting of only one node:
211
212 [ Dresden ]
213
214 Two nodes
215 A simple graph consisting of two nodes, linked together by a directed
216 edge:
217
218 [ Bonn ] -> [ Berlin ]
219
220 Three nodes
221 A graph consisting of three nodes, and both are linked from the first:
222
223 [ Bonn ] -> [ Berlin ]
224 [ Bonn ] -> [ Hamburg ]
225
226 Three nodes in a chain
227 A graph consisting of three nodes, showing that you can chain
228 connections together:
229
230 [ Bonn ] -> [ Berlin ] -> [ Hamburg ]
231
232 Two not connected graphs
233 A graph consisting of two separate parts, both of them not connected to
234 each other:
235
236 [ Bonn ] -> [ Berlin ]
237 [ Freiburg ] -> [ Hamburg ]
238
239 Three nodes, interlinked
240 A graph consisting of three nodes, and two of the are connected from
241 the first node:
242
243 [ Bonn ] -> [ Berlin ]
244 [ Berlin ] -> [ Hamburg ]
245 [ Bonn ] -> [ Hamburg ]
246
247 Different edge styles
248 A graph consisting of a couple of nodes, linked with the different
249 possible edge styles.
250
251 [ Bonn ] <-> [ Berlin ] # bidirectional
252 [ Berlin ] ==> [ Rostock ] # double
253 [ Hamburg ] ..> [ Altona ] # dotted
254 [ Dresden ] - > [ Bautzen ] # dashed
255 [ Leipzig ] ~~> [ Kirchhain ] # wave
256 [ Hof ] .-> [ Chemnitz ] # dot-dash
257 [ Magdeburg ] <=> [ Ulm ] # bidrectional, double etc
258 [ Magdeburg ] -- [ Ulm ] # arrow-less edge
259
260 More examples at: <http://bloodgate.com/perl/graph/>
261
263 Note: Animations are not yet implemented!
264
265 It is possible to add animations to a graph. This is done by adding
266 steps via the pseudo-class "step":
267
268 step.0 {
269 target: Bonn; # find object with id=Bonn, or
270 # if this fails, the node named
271 # "Bonn".
272 animate: fill: # animate this attribute
273 from: yellow; # start value (0% of duration)
274 via: red; # at 50% of the duration
275 to: yellow; # and 100% of duration
276 wait: 0; # after triggering, wait so many seconds
277 duration: 5; # entire time to go from "from" to "to"
278 trigger: onload; # when to trigger this animation
279 repeat: 2; # how often to repeat ("2" means two times)
280 # also "infinite", then "next" will be ignored
281 next: 1; # which step to take after repeat is up
282 }
283 step.1 {
284 from: white; # set to white
285 to: white;
286 duration: 0.1; # 100ms
287 next: 0; # go back to step.0
288 }
289
290 Here two steps are created, 0 and 1 and the animation will be going
291 like this:
292
293 0.1s
294 +-------------------------------+
295 v |
296 +--------+ 0s +--------+ 5s +--------+ 5s +--------+
297 | onload | ----> | step.0 | ----> | step.0 | ----> | step.1 |
298 +--------+ +--------+ +--------+ +--------+
299
300 You can generate a a graph with the animation flow via
301 "animation_as_graph()".
302
303 Output
304 Currently no output formats supports animations yet.
305
307 "Graph::Easy" supports the following methods:
308
309 new()
310 use Graph::Easy;
311
312 my $graph = Graph::Easy->new( );
313
314 Creates a new, empty "Graph::Easy" object.
315
316 Takes optional a hash reference with a list of options. The following
317 are valid options:
318
319 debug if true, enables debug output
320 timeout timeout (in seconds) for the layouter
321 fatal_errors wrong attributes are fatal errors, default: true
322 strict test attribute names for being valid, default: true
323 undirected create an undirected graph, default: false
324
325 copy()
326 my $copy = $graph->copy( );
327
328 Create a copy of this graph and return it as a new Graph::Easy object.
329
330 error()
331 my $error = $graph->error();
332
333 Returns the last error or '' for none. Optionally, takes an error
334 message to be set.
335
336 $graph->error( 'Expected Foo, but found Bar.' );
337
338 See warn() on how to catch error messages. See also non_fatal_errors()
339 on how to turn errors into warnings.
340
341 warn()
342 my $warning = $graph->warn();
343
344 Returns the last warning or '' for none. Optionally, takes a warning
345 message to be output to STDERR:
346
347 $graph->warn( 'Expected Foo, but found Bar.' );
348
349 If you want to catch warnings from the layouter, enable catching of
350 warnings or errors:
351
352 $graph->catch_messages(1);
353
354 # Or individually:
355 # $graph->catch_warnings(1);
356 # $graph->catch_errors(1);
357
358 # something which warns or throws an error:
359 ...
360
361 if ($graph->error())
362 {
363 my @errors = $graph->errors();
364 }
365 if ($graph->warning())
366 {
367 my @warnings = $graph->warnings();
368 }
369
370 See Graph::Easy::Base for more details on error/warning message
371 capture.
372
373 add_edge()
374 my ($first, $second, $edge) = $graph->add_edge( 'node 1', 'node 2');
375
376 add_edge()
377 my ($first, $second, $edge) = $graph->add_edge( 'node 1', 'node 2');
378 my $edge = $graph->add_edge( $x, $y, $edge);
379 $graph->add_edge( $x, $y);
380
381 Add an edge between nodes X and Y. The optional edge object defines the
382 style of the edge, if not present, a default object will be used.
383
384 When called in scalar context, will return $edge. In array/list context
385 it will return the two nodes and the edge object.
386
387 $x and $y should be either plain scalars with the names of the nodes,
388 or objects of Graph::Easy::Node, while the optional $edge should be
389 Graph::Easy::Edge.
390
391 Note: "Graph::Easy" graphs are multi-edged, and adding the same edge
392 twice will result in two edges going from $x to $y! See
393 "add_edge_once()" on how to avoid that.
394
395 You can also use "edge()" to check whether an edge from X to Y already
396 exists in the graph.
397
398 add_edge_once()
399 my ($first, $second, $edge) = $graph->add_edge_once( 'node 1', 'node 2');
400 my $edge = $graph->add_edge_once( $x, $y, $edge);
401 $graph->add_edge_once( $x, $y);
402
403 if (defined $edge)
404 {
405 # got added once, so do something with it
406 $edge->set_attribute('label','unique');
407 }
408
409 Adds an edge between nodes X and Y, unless there exists already an edge
410 between these two nodes. See "add_edge()".
411
412 Returns undef when an edge between X and Y already exists.
413
414 When called in scalar context, will return $edge. In array/list context
415 it will return the two nodes and the edge object.
416
417 flip_edges()
418 my $graph = Graph::Easy->new();
419 $graph->add_edge('Bonn','Berlin');
420 $graph->add_edge('Berlin','Bonn');
421
422 print $graph->as_ascii();
423
424 # +--------------+
425 # v |
426 # +--------+ +------+
427 # | Berlin | --> | Bonn |
428 # +--------+ +------+
429
430 $graph->flip_edges('Bonn', 'Berlin');
431
432 print $graph->as_ascii();
433
434 # +--------------+
435 # | v
436 # +--------+ +------+
437 # | Berlin | --> | Bonn |
438 # +--------+ +------+
439
440 Turn around (transpose) all edges that are going from the first node to
441 the second node.
442
443 add_node()
444 my $node = $graph->add_node( 'Node 1' );
445 # or if you already have a Graph::Easy::Node object:
446 $graph->add_node( $x );
447
448 Add a single node X to the graph. $x should be either a
449 "Graph::Easy::Node" object, or a unique name for the node. Will do
450 nothing if the node already exists in the graph.
451
452 It returns an Graph::Easy::Node object.
453
454 add_anon_node()
455 my $anon_node = $graph->add_anon_node( );
456
457 Creates a single, anonymous node and adds it to the graph, returning
458 the "Graph::Easy::Node::Anon" object.
459
460 The created node is equal to one created via " [ ] " in the Graph::Easy
461 text description.
462
463 add_nodes()
464 my @nodes = $graph->add_nodes( 'Node 1', 'Node 2' );
465
466 Add all the given nodes to the graph. The arguments should be either a
467 "Graph::Easy::Node" object, or a unique name for the node. Will do
468 nothing if the node already exists in the graph.
469
470 It returns a list of Graph::Easy::Node objects.
471
472 rename_node()
473 $node = $graph->rename_node($node, $new_name);
474
475 Changes the name of a node. If the passed node is not part of this
476 graph or just a string, it will be added with the new name to this
477 graph.
478
479 If the node was part of another graph, it will be deleted there and
480 added to this graph with the new name, effectively moving the node from
481 the old to the new graph and renaming it at the same time.
482
483 del_node()
484 $graph->del_node('Node name');
485 $graph->del_node($node);
486
487 Delete the node with the given name from the graph.
488
489 del_edge()
490 $graph->del_edge($edge);
491
492 Delete the given edge object from the graph. You can use "edge()" to
493 find an edge from Node A to B:
494
495 $graph->del_edge( $graph->edge('A','B') );
496
497 merge_nodes()
498 $graph->merge_nodes( $first_node, $second_node );
499 $graph->merge_nodes( $first_node, $second_node, $joiner );
500
501 Merge two nodes. Will delete all connections between the two nodes,
502 then move over any connection to/from the second node to the first,
503 then delete the second node from the graph.
504
505 Any attributes on the second node will be lost.
506
507 If present, the optional $joiner argument will be used to join the
508 label of the second node to the label of the first node. If not
509 present, the label of the second node will be dropped along with all
510 the other attributes:
511
512 my $graph = Graph::Easy->new('[A]->[B]->[C]->[D]');
513
514 # this produces "[A]->[C]->[D]"
515 $graph->merge_nodes( 'A', 'B' );
516
517 # this produces "[A C]->[D]"
518 $graph->merge_nodes( 'A', 'C', ' ' );
519
520 # this produces "[A C \n D]", note single quotes on the third argument!
521 $graph->merge_nodes( 'A', 'C', ' \n ' );
522
523 get_attribute()
524 my $value = $graph->get_attribute( $class, $name );
525
526 Return the value of attribute $name from class $class.
527
528 Example:
529
530 my $color = $graph->attribute( 'node', 'color' );
531
532 You can also call all the various attribute related methods on members
533 of the graph directly, for instance:
534
535 $node->get_attribute('label');
536 $edge->get_attribute('color');
537 $group->get_attribute('fill');
538
539 attribute()
540 my $value = $graph->attribute( $class, $name );
541
542 Is an alias for get_attribute.
543
544 color_attribute()
545 # returns f.i. #ff0000
546 my $color = $graph->get_color_attribute( 'node', 'color' );
547
548 Just like get_attribute(), but only for colors, and returns them as
549 hex, using the current colorscheme.
550
551 get_color_attribute()
552 Is an alias for color_attribute().
553
554 get_attributes()
555 my $att = $object->get_attributes();
556
557 Return all effective attributes on this object (graph/node/group/edge)
558 as an anonymous hash ref. This respects inheritance and default values.
559
560 Note that this does not include custom attributes.
561
562 See also get_custom_attributes and raw_attributes().
563
564 get_custom_attributes()
565 my $att = $object->get_custom_attributes();
566
567 Return all the custom attributes on this object (graph/node/group/edge)
568 as an anonymous hash ref.
569
570 custom_attributes()
571 my $att = $object->custom_attributes();
572
573 "custom_attributes()" is an alias for get_custom_attributes.
574
575 raw_attributes()
576 my $att = $object->raw_attributes();
577
578 Return all set attributes on this object (graph, node, group or edge)
579 as an anonymous hash ref. Thus you get all the locally active
580 attributes for this object.
581
582 Inheritance is respected, e.g. attributes that have the value "inherit"
583 and are inheritable, will be inherited from the base class.
584
585 But default values for unset attributes are skipped. Here is an
586 example:
587
588 node { color: red; }
589
590 [ A ] { class: foo; color: inherit; }
591
592 This will return:
593
594 { class => foo, color => red }
595
596 As you can see, attributes like "background" etc. are not included,
597 while the color value was inherited properly.
598
599 See also get_attributes().
600
601 default_attribute()
602 my $def = $graph->default_attribute($class, 'fill');
603
604 Returns the default value for the given attribute in the class of the
605 object.
606
607 The default attribute is the value that will be used if the attribute
608 on the object itself, as well as the attribute on the class is unset.
609
610 To find out what attribute is on the class, use the three-arg form of
611 attribute on the graph:
612
613 my $g = Graph::Easy->new();
614 my $node = $g->add_node('Berlin');
615
616 print $node->attribute('fill'), "\n"; # print "white"
617 print $node->default_attribute('fill'), "\n"; # print "white"
618 print $g->attribute('node','fill'), "\n"; # print "white"
619
620 $g->set_attribute('node','fill','red'); # class is "red"
621 $node->set_attribute('fill','green'); # this object is "green"
622
623 print $node->attribute('fill'), "\n"; # print "green"
624 print $node->default_attribute('fill'), "\n"; # print "white"
625 print $g->attribute('node','fill'), "\n"; # print "red"
626
627 See also raw_attribute().
628
629 raw_attribute()
630 my $value = $object->raw_attribute( $name );
631
632 Return the value of attribute $name from the object it this method is
633 called on (graph, node, edge, group etc.). If the attribute is not set
634 on the object itself, returns undef.
635
636 This method respects inheritance, so an attribute value of 'inherit' on
637 an object will make the method return the inherited value:
638
639 my $g = Graph::Easy->new();
640 my $n = $g->add_node('A');
641
642 $g->set_attribute('color','red');
643
644 print $n->raw_attribute('color'); # undef
645 $n->set_attribute('color','inherit');
646 print $n->raw_attribute('color'); # 'red'
647
648 See also attribute().
649
650 raw_color_attribute()
651 # returns f.i. #ff0000
652 my $color = $graph->raw_color_attribute('color' );
653
654 Just like raw_attribute(), but only for colors, and returns them as
655 hex, using the current colorscheme.
656
657 If the attribute is not set on the object, returns "undef".
658
659 raw_attributes()
660 my $att = $object->raw_attributes();
661
662 Returns a hash with all the raw attributes of that object. Attributes
663 that are no set on the object itself, but on the class this object
664 belongs to are not included.
665
666 This method respects inheritance, so an attribute value of 'inherit' on
667 an object will make the method return the inherited value.
668
669 set_attribute()
670 # Set the attribute on the given class.
671 $graph->set_attribute( $class, $name, $val );
672
673 # Set the attribute on the graph itself. This is synonymous
674 # to using 'graph' as class in the form above.
675 $graph->set_attribute( $name, $val );
676
677 Sets a given attribute named $name to the new value $val in the class
678 specified in $class.
679
680 Example:
681
682 $graph->set_attribute( 'graph', 'gid', '123' );
683
684 The class can be one of "graph", "edge", "node" or "group". The last
685 three can also have subclasses like in "node.subclassname".
686
687 You can also call the various attribute related methods on members of
688 the graph directly, for instance:
689
690 $node->set_attribute('label', 'my node');
691 $edge->set_attribute('color', 'red');
692 $group->set_attribute('fill', 'green');
693
694 set_attributes()
695 $graph->set_attributes( $class, $att );
696
697 Given a class name in $class and a hash of mappings between attribute
698 names and values in $att, will set all these attributes.
699
700 The class can be one of "graph", "edge", "node" or "group". The last
701 three can also have subclasses like in "node.subclassname".
702
703 Example:
704
705 $graph->set_attributes( 'node', { color => 'red', background => 'none' } );
706
707 del_attribute()
708 $graph->del_attribute('border');
709
710 Delete the attribute with the given name from the object.
711
712 You can also call the various attribute related methods on members of
713 the graph directly, for instance:
714
715 $node->del_attribute('label');
716 $edge->del_attribute('color');
717 $group->del_attribute('fill');
718
719 unquote_attribute()
720 # returns '"Hello World!"'
721 my $value = $self->unquote_attribute('node','label','"Hello World!"');
722 # returns 'red'
723 my $color = $self->unquote_attribute('node','color','"red"');
724
725 Return the attribute unquoted except for labels and titles, that is it
726 removes double quotes at the start and the end of the string, unless
727 these are escaped with a backslash.
728
729 border_attribute()
730 my $border = $graph->border_attribute();
731
732 Return the combined border attribute like "1px solid red" from the
733 border(style|color|width) attributes.
734
735 split_border_attributes()
736 my ($style,$width,$color) = $graph->split_border_attribute($border);
737
738 Split the border attribute (like "1px solid red") into the three
739 different parts.
740
741 quoted_comment()
742 my $cmt = $node->comment();
743
744 Comment of this object, quoted suitable as to be embedded into
745 HTML/SVG. Returns the empty string if this object doesn't have a
746 comment set.
747
748 flow()
749 my $flow = $graph->flow();
750
751 Returns the flow of the graph, as absolute number in degress.
752
753 source_nodes()
754 my @roots = $graph->source_nodes();
755
756 Returns all nodes that have only outgoing edges, e.g. are the root of a
757 tree, in no particular order.
758
759 Isolated nodes (no edges at all) will not be included, see
760 predecessorless_nodes() to get these, too.
761
762 In scalar context, returns the number of source nodes.
763
764 predecessorless_nodes()
765 my @roots = $graph->predecessorless_nodes();
766
767 Returns all nodes that have no incoming edges, regardless of whether
768 they have outgoing edges or not, in no particular order.
769
770 Isolated nodes (no edges at all) will be included in the list.
771
772 See also source_nodes().
773
774 In scalar context, returns the number of predecessorless nodes.
775
776 root_node()
777 my $root = $graph->root_node();
778
779 Return the root node as Graph::Easy::Node object, if it was set with
780 the 'root' attribute.
781
782 timeout()
783 print $graph->timeout(), " seconds timeout for layouts.\n";
784 $graph->timeout(12);
785
786 Get/set the timeout for layouts in seconds. If the layout process did
787 not finish after that time, it will be stopped and a warning will be
788 printed.
789
790 The default timeout is 5 seconds.
791
792 strict()
793 print "Graph has strict checking\n" if $graph->strict();
794 $graph->strict(undef); # disable strict attribute checks
795
796 Get/set the strict option. When set to a true value, all attribute
797 names and values will be strictly checked and unknown/invalid one will
798 be rejected.
799
800 This option is on by default.
801
802 type()
803 print "Graph is " . $graph->type() . "\n";
804
805 Returns the type of the graph as string, either "directed" or
806 "undirected".
807
808 layout()
809 $graph->layout();
810 $graph->layout( type => 'force', timeout => 60 );
811
812 Creates the internal structures to layout the graph.
813
814 This method will be called automatically when you call any of the
815 "as_FOO" methods or "output()" as described below.
816
817 The options are:
818
819 type the type of the layout, possible values:
820 'force' - force based layouter
821 'adhoc' - the default layouter
822 timeout timeout in seconds
823
824 See also: timeout().
825
826 output_format()
827 $graph->output_format('html');
828
829 Set the outputformat. One of 'html', 'ascii', 'graphviz', 'svg' or
830 'txt'. See also output().
831
832 output()
833 my $out = $graph->output();
834
835 Output the graph in the format set by "output_format()".
836
837 as_ascii()
838 print $graph->as_ascii();
839
840 Return the graph layout in ASCII art, in utf-8.
841
842 as_ascii_file()
843 print $graph->as_ascii_file();
844
845 Is an alias for as_ascii.
846
847 as_ascii_html()
848 print $graph->as_ascii_html();
849
850 Return the graph layout in ASCII art, suitable to be embedded into an
851 HTML page. Basically it wraps the output from as_ascii() into "<pre>
852 </pre>" and inserts real HTML links. The returned string is in utf-8.
853
854 as_boxart()
855 print $graph->as_box();
856
857 Return the graph layout as box drawing using Unicode characters (in
858 utf-8, as always).
859
860 as_boxart_file()
861 print $graph->as_boxart_file();
862
863 Is an alias for "as_box".
864
865 as_boxart_html()
866 print $graph->as_boxart_html();
867
868 Return the graph layout as box drawing using Unicode characters, as
869 chunk that can be embedded into an HTML page.
870
871 Basically it wraps the output from as_boxart() into "<pre> </pre>" and
872 inserts real HTML links. The returned string is in utf-8.
873
874 as_boxart_html_file()
875 print $graph->as_boxart_html_file();
876
877 Return the graph layout as box drawing using Unicode characters, as a
878 full HTML page complete with header and footer.
879
880 as_html()
881 print $graph->as_html();
882
883 Return the graph layout as HTML section. See css() to get the CSS
884 section to go with that HTML code. If you want a complete HTML page
885 then use as_html_file().
886
887 as_html_page()
888 print $graph->as_html_page();
889
890 Is an alias for "as_html_file".
891
892 as_html_file()
893 print $graph->as_html_file();
894
895 Return the graph layout as HTML complete with headers, CSS section and
896 footer. Can be viewed in the browser of your choice.
897
898 add_group()
899 my $group = $graph->add_group('Group name');
900
901 Add a group to the graph and return it as Graph::Easy::Group object.
902
903 group()
904 my $group = $graph->group('Name');
905
906 Returns the group with the name "Name" as Graph::Easy::Group object.
907
908 rename_group()
909 $group = $graph->rename_group($group, $new_name);
910
911 Changes the name of the given group. If the passed group is not part of
912 this graph or just a string, it will be added with the new name to this
913 graph.
914
915 If the group was part of another graph, it will be deleted there and
916 added to this graph with the new name, effectively moving the group
917 from the old to the new graph and renaming it at the same time.
918
919 groups()
920 my @groups = $graph->groups();
921
922 Returns the groups of the graph as Graph::Easy::Group objects, in
923 arbitrary order.
924
925 groups_within()
926 # equivalent to $graph->groups():
927 my @groups = $graph->groups_within(); # all
928 my @toplevel_groups = $graph->groups_within(0); # level 0 only
929
930 Return the groups that are inside this graph, up to the specified
931 level, in arbitrary order.
932
933 The default level is -1, indicating no bounds and thus all contained
934 groups are returned.
935
936 A level of 0 means only the direct children, and hence only the
937 toplevel groups will be returned. A level 1 means the toplevel groups
938 and their toplevel children, and so on.
939
940 anon_groups()
941 my $anon_groups = $graph->anon_groups();
942
943 In scalar context, returns the number of anon groups (aka
944 Graph::Easy::Group::Anon) the graph has.
945
946 In list context, returns all anon groups as objects, in arbitrary
947 order.
948
949 del_group()
950 $graph->del_group($name);
951
952 Delete the group with the given name.
953
954 edges(), edges_within()
955 my @edges = $graph->edges();
956
957 Returns the edges of the graph as Graph::Easy::Edge objects, in
958 arbitrary order.
959
960 edges_within() is an alias for "edges()".
961
962 is_simple_graph(), is_simple()
963 if ($graph->is_simple())
964 {
965 }
966
967 Returns true if the graph does not have multiedges, e.g. if it does not
968 have more than one edge going from any node to any other node or group.
969
970 Since this method has to look at all edges, it is costly in terms of
971 both CPU and memory.
972
973 is_directed()
974 if ($graph->is_directed())
975 {
976 }
977
978 Returns true if the graph is directed.
979
980 is_undirected()
981 if ($graph->is_undirected())
982 {
983 }
984
985 Returns true if the graph is undirected.
986
987 parent()
988 my $parent = $graph->parent();
989
990 Returns the parent graph, for graphs this is undef.
991
992 label()
993 my $label = $graph->label();
994
995 Returns the label of the graph.
996
997 title()
998 my $title = $graph->title();
999
1000 Returns the (mouseover) title of the graph.
1001
1002 link()
1003 my $link = $graph->link();
1004
1005 Return a potential link (for the graphs label), build from the
1006 attributes "linkbase" and "link" (or autolink). Returns '' if there is
1007 no link.
1008
1009 as_graphviz()
1010 print $graph->as_graphviz();
1011
1012 Return the graph as graphviz code, suitable to be feed to a program
1013 like "dot" etc.
1014
1015 as_graphviz_file()
1016 print $graph->as_graphviz_file();
1017
1018 Is an alias for as_graphviz().
1019
1020 angle()
1021 my $degrees = Graph::Easy->angle( 'south' );
1022 my $degrees = Graph::Easy->angle( 120 );
1023
1024 Check an angle for being valid and return a value between -359 and 359
1025 degrees. The special values "south", "north", "west", "east", "up" and
1026 "down" are also valid and converted to degrees.
1027
1028 nodes()
1029 my $nodes = $graph->nodes();
1030
1031 In scalar context, returns the number of nodes/vertices the graph has.
1032
1033 In list context, returns all nodes as objects, in arbitrary order.
1034
1035 anon_nodes()
1036 my $anon_nodes = $graph->anon_nodes();
1037
1038 In scalar context, returns the number of anon nodes (aka
1039 Graph::Easy::Node::Anon) the graph has.
1040
1041 In list context, returns all anon nodes as objects, in arbitrary order.
1042
1043 html_page_header()
1044 my $header = $graph->html_page_header();
1045 my $header = $graph->html_page_header($css);
1046
1047 Return the header of an HTML page. Used together with html_page_footer
1048 by as_html_page to construct a complete HTML page.
1049
1050 Takes an optional parameter with the CSS styles to be inserted into the
1051 header. If $css is not defined, embedds the result of "$self->css()".
1052
1053 html_page_footer()
1054 my $footer = $graph->html_page_footer();
1055
1056 Return the footer of an HTML page. Used together with html_page_header
1057 by as_html_page to construct a complete HTML page.
1058
1059 css()
1060 my $css = $graph->css();
1061
1062 Return CSS code for that graph. See as_html().
1063
1064 as_txt()
1065 print $graph->as_txt();
1066
1067 Return the graph as a normalized textual representation, that can be
1068 parsed with Graph::Easy::Parser back to the same graph.
1069
1070 This does not call layout() since the actual text representation is
1071 just a dump of the graph.
1072
1073 as_txt_file()
1074 print $graph->as_txt_file();
1075
1076 Is an alias for as_txt().
1077
1078 as_svg()
1079 print $graph->as_svg();
1080
1081 Return the graph as SVG (Scalable Vector Graphics), which can be
1082 embedded into HTML pages. You need to install Graph::Easy::As_svg first
1083 to make this work.
1084
1085 See also as_svg_file().
1086
1087 Note: You need Graph::Easy::As_svg installed for this to work!
1088
1089 as_svg_file()
1090 print $graph->as_svg_file();
1091
1092 Returns SVG just like "as_svg()", but this time as standalone SVG,
1093 suitable for storing it in a file and referencing it externally.
1094
1095 After calling "as_svg_file()" or "as_svg()", you can retrieve some SVG
1096 information, notable "width" and "height" via "svg_information".
1097
1098 Note: You need Graph::Easy::As_svg installed for this to work!
1099
1100 svg_information()
1101 my $info = $graph->svg_information();
1102
1103 print "Size: $info->{width}, $info->{height}\n";
1104
1105 Return information about the graph created by the last "as_svg()" or
1106 "as_svg_file()" call.
1107
1108 The following fields are set:
1109
1110 width width of the SVG in pixels
1111 height height of the SVG in pixels
1112
1113 Note: You need Graph::Easy::As_svg installed for this to work!
1114
1115 as_vcg()
1116 print $graph->as_vcg();
1117
1118 Return the graph as VCG text. VCG is a subset of GDL (Graph Description
1119 Language).
1120
1121 This does not call layout() since the actual text representation is
1122 just a dump of the graph.
1123
1124 as_vcg_file()
1125 print $graph->as_vcg_file();
1126
1127 Is an alias for as_vcg().
1128
1129 as_gdl()
1130 print $graph->as_gdl();
1131
1132 Return the graph as GDL (Graph Description Language) text. GDL is a
1133 superset of VCG.
1134
1135 This does not call layout() since the actual text representation is
1136 just a dump of the graph.
1137
1138 as_gdl_file()
1139 print $graph->as_gdl_file();
1140
1141 Is an alias for as_gdl().
1142
1143 as_graphml()
1144 print $graph->as_graphml();
1145
1146 Return the graph as a GraphML representation.
1147
1148 This does not call layout() since the actual text representation is
1149 just a dump of the graph.
1150
1151 The output contains only the set attributes, e.g. default attribute
1152 values are not specifically mentioned. The attribute names and values
1153 are the in the format that "Graph::Easy" defines.
1154
1155 as_graphml_file()
1156 print $graph->as_graphml_file();
1157
1158 Is an alias for as_graphml().
1159
1160 sorted_nodes()
1161 my $nodes =
1162 $graph->sorted_nodes( ); # default sort on 'id'
1163 my $nodes =
1164 $graph->sorted_nodes( 'name' ); # sort on 'name'
1165 my $nodes =
1166 $graph->sorted_nodes( 'layer', 'id' ); # sort on 'layer', then on 'id'
1167
1168 In scalar context, returns the number of nodes/vertices the graph has.
1169 In list context returns a list of all the node objects (as reference),
1170 sorted by their attribute(s) given as arguments. The default is 'id',
1171 e.g. their internal ID number, which amounts more or less to the order
1172 they have been inserted.
1173
1174 This routine will sort the nodes by their group first, so the requested
1175 sort order will be only valid if there are no groups or inside each
1176 group.
1177
1178 as_debug()
1179 print $graph->as_debug();
1180
1181 Return debugging information like version numbers of used modules, and
1182 a textual representation of the graph.
1183
1184 This does not call layout() since the actual text representation is
1185 more a dump of the graph, than a certain layout.
1186
1187 node()
1188 my $node = $graph->node('node name');
1189
1190 Return node by unique name (case sensitive). Returns undef if the node
1191 does not exist in the graph.
1192
1193 edge()
1194 my $edge = $graph->edge( $x, $y );
1195
1196 Returns the edge objects between nodes $x and $y. Both $x and $y can be
1197 either scalars with names or "Graph::Easy::Node" objects.
1198
1199 Returns undef if the edge does not yet exist.
1200
1201 In list context it will return all edges from $x to $y, in scalar
1202 context it will return only one (arbitrary) edge.
1203
1204 id()
1205 my $graph_id = $graph->id();
1206 $graph->id('123');
1207
1208 Returns the id of the graph. You can also set a new ID with this
1209 routine. The default is ''.
1210
1211 The graph's ID is used to generate unique CSS classes for each graph,
1212 in the case you want to have more than one graph in an HTML page.
1213
1214 seed()
1215 my $seed = $graph->seed();
1216 $graph->seed(2);
1217
1218 Get/set the random seed for the graph object. See randomize() for a
1219 method to set a random seed.
1220
1221 The seed is used to create random numbers for the layouter. For the
1222 same graph, the same seed will always lead to the same layout.
1223
1224 randomize()
1225 $graph->randomize();
1226
1227 Set a random seed for the graph object. See seed().
1228
1229 debug()
1230 my $debug = $graph->debug(); # get
1231 $graph->debug(1); # enable
1232 $graph->debug(0); # disable
1233
1234 Enable, disable or read out the debug status. When the debug status is
1235 true, additional debug messages will be printed on STDERR.
1236
1237 score()
1238 my $score = $graph->score();
1239
1240 Returns the score of the graph, or undef if layout() has not yet been
1241 called.
1242
1243 Higher scores are better, although you cannot compare scores for
1244 different graphs. The score should only be used to compare different
1245 layouts of the same graph against each other:
1246
1247 my $max = undef;
1248
1249 $graph->randomize();
1250 my $seed = $graph->seed();
1251
1252 $graph->layout();
1253 $max = $graph->score();
1254
1255 for (1..10)
1256 {
1257 $graph->randomize(); # select random seed
1258 $graph->layout(); # layout with that seed
1259 if ($graph->score() > $max)
1260 {
1261 $max = $graph->score(); # store the new max store
1262 $seed = $graph->seed(); # and it's seed
1263 }
1264 }
1265
1266 # redo the best layout
1267 if ($seed ne $graph->seed())
1268 {
1269 $graph->seed($seed);
1270 $graph->layout();
1271 }
1272 # output graph:
1273 print $graph->as_ascii(); # or as_html() etc
1274
1275 valid_attribute()
1276 my $graph = Graph::Easy->new();
1277 my $new_value =
1278 $graph->valid_attribute( $name, $value, $class );
1279
1280 if (ref($new_value) eq 'ARRAY' && @$new_value == 0)
1281 {
1282 # throw error
1283 die ("'$name' is not a valid attribute name for '$class'")
1284 if $self->{_warn_on_unused_attributes};
1285 }
1286 elsif (!defined $new_value)
1287 {
1288 # throw error
1289 die ("'$value' is no valid '$name' for '$class'");
1290 }
1291
1292 Deprecated, please use validate_attribute().
1293
1294 Check that a "$name,$value" pair is a valid attribute in class $class,
1295 and returns a new value.
1296
1297 It returns an array ref if the attribute name is invalid, and undef if
1298 the value is invalid.
1299
1300 The return value can differ from the passed in value, f.i.:
1301
1302 print $graph->valid_attribute( 'color', 'red' );
1303
1304 This would print '#ff0000';
1305
1306 validate_attribute()
1307 my $graph = Graph::Easy->new();
1308 my ($rc,$new_name, $new_value) =
1309 $graph->validate_attribute( $name, $value, $class );
1310
1311 Checks a given attribute name and value (or values, in case of a value
1312 like "red|green") for being valid. It returns a new attribute name (in
1313 case of "font-color" => "fontcolor") and either a single new attribute,
1314 or a list of attribute values as array ref.
1315
1316 If $rc is defined, it is the error number:
1317
1318 1 unknown attribute name
1319 2 invalid attribute value
1320 4 found multiple attributes, but these arent
1321 allowed at this place
1322
1323 color_as_hex()
1324 my $hexred = Graph::Easy->color_as_hex( 'red' );
1325 my $hexblue = Graph::Easy->color_as_hex( '#0000ff' );
1326 my $hexcyan = Graph::Easy->color_as_hex( '#f0f' );
1327 my $hexgreen = Graph::Easy->color_as_hex( 'rgb(0,255,0)' );
1328
1329 Takes a valid color name or definition (hex, short hex, or RGB) and
1330 returns the color in hex like "#ff00ff".
1331
1332 color_value($color_name, $color_scheme)
1333 my $color = Graph::Easy->color_name( 'red' ); # #ff0000
1334 print Graph::Easy->color_name( '#ff0000' ); # #ff0000
1335
1336 print Graph::Easy->color_name( 'snow', 'x11' );
1337
1338 Given a color name, returns the color in hex. See color_name for a list
1339 of possible values for the optional $color_scheme parameter.
1340
1341 color_name($color_value, $color_scheme)
1342 my $color = Graph::Easy->color_name( 'red' ); # red
1343 print Graph::Easy->color_name( '#ff0000' ); # red
1344
1345 print Graph::Easy->color_name( 'snow', 'x11' );
1346
1347 Takes a hex color value and returns the name of the color.
1348
1349 The optional parameter is the color scheme, where the following values
1350 are possible:
1351
1352 w3c (the default)
1353 x11 (what graphviz uses as default)
1354
1355 Plus the following ColorBrewer schemes are supported, see the online
1356 manual for examples and their usage:
1357
1358 accent3 accent4 accent5 accent6 accent7 accent8
1359
1360 blues3 blues4 blues5 blues6 blues7 blues8 blues9
1361
1362 brbg3 brbg4 brbg5 brbg6 brbg7 brbg8 brbg9 brbg10 brbg11
1363
1364 bugn3 bugn4 bugn5 bugn6 bugn7 bugn8 bugn9 bupu3 bupu4 bupu5 bupu6 bupu7
1365 bupu8 bupu9
1366
1367 dark23 dark24 dark25 dark26 dark27 dark28
1368
1369 gnbu3 gnbu4 gnbu5 gnbu6 gnbu7 gnbu8 gnbu9
1370
1371 greens3 greens4 greens5 greens6 greens7 greens8 greens9
1372
1373 greys3 greys4 greys5 greys6 greys7 greys8 greys9
1374
1375 oranges3 oranges4 oranges5 oranges6 oranges7 oranges8 oranges9
1376
1377 orrd3 orrd4 orrd5 orrd6 orrd7 orrd8 orrd9
1378
1379 paired3 paired4 paired5 paired6 paired7 paired8 paired9 paired10 paired11
1380 paired12
1381
1382 pastel13 pastel14 pastel15 pastel16 pastel17 pastel18 pastel19
1383
1384 pastel23 pastel24 pastel25 pastel26 pastel27 pastel28
1385
1386 piyg3 piyg4 piyg5 piyg6 piyg7 piyg8 piyg9 piyg10 piyg11
1387
1388 prgn3 prgn4 prgn5 prgn6 prgn7 prgn8 prgn9 prgn10 prgn11
1389
1390 pubu3 pubu4 pubu5 pubu6 pubu7 pubu8 pubu9
1391
1392 pubugn3 pubugn4 pubugn5 pubugn6 pubugn7 pubugn8 pubugn9
1393
1394 puor3 puor4 puor5 puor6 puor7 puor8 puor9 puor10 puor11
1395
1396 purd3 purd4 purd5 purd6 purd7 purd8 purd9
1397
1398 purples3 purples4 purples5 purples6 purples7 purples8 purples9
1399
1400 rdbu3 rdbu4 rdbu5 rdbu6 rdbu7 rdbu8 rdbu9 rdbu10 rdbu11
1401
1402 rdgy3 rdgy4 rdgy5 rdgy6 rdgy7 rdgy8 rdgy9
1403
1404 rdpu3 rdpu4 rdpu5 rdpu6 rdpu7 rdpu8 rdpu9 rdgy10 rdgy11
1405
1406 rdylbu3 rdylbu4 rdylbu5 rdylbu6 rdylbu7 rdylbu8 rdylbu9 rdylbu10 rdylbu11
1407
1408 rdylgn3 rdylgn4 rdylgn5 rdylgn6 rdylgn7 rdylgn8 rdylgn9 rdylgn10 rdylgn11
1409
1410 reds3 reds4 reds5 reds6 reds7 reds8 reds9
1411
1412 set13 set14 set15 set16 set17 set18 set19
1413
1414 set23 set24 set25 set26 set27 set28
1415
1416 set33 set34 set35 set36 set37 set38 set39 set310 set311 set312
1417
1418 spectral3 spectral4 spectral5 spectral6 spectral7 spectral8 spectral9
1419 spectral10 spectral11
1420
1421 ylgn3 ylgn4 ylgn5 ylgn6 ylgn7 ylgn8 ylgn9
1422
1423 ylgnbu3 ylgnbu4 ylgnbu5 ylgnbu6 ylgnbu7 ylgnbu8 ylgnbu9
1424
1425 ylorbr3 ylorbr4 ylorbr5 ylorbr6 ylorbr7 ylorbr8 ylorbr9
1426
1427 ylorrd3 ylorrd4 ylorrd5 ylorrd6 ylorrd7 ylorrd8 ylorrd9
1428
1429 color_names()
1430 my $names = Graph::Easy->color_names();
1431
1432 Return a hash with name => value mapping for all known colors.
1433
1434 text_style()
1435 if ($graph->text_style('bold, italic'))
1436 {
1437 ...
1438 }
1439
1440 Checks the given style list for being valid.
1441
1442 text_styles()
1443 my $styles = $graph->text_styles(); # or $edge->text_styles() etc.
1444
1445 if ($styles->{'italic'})
1446 {
1447 print 'is italic\n';
1448 }
1449
1450 Return a hash with the given text-style properties, aka 'underline',
1451 'bold' etc.
1452
1453 text_styles_as_css()
1454 my $styles = $graph->text_styles_as_css(); # or $edge->...() etc.
1455
1456 Return the text styles as a chunk of CSS styling that can be embedded
1457 into a " style="" " parameter.
1458
1459 use_class()
1460 $graph->use_class('node', 'Graph::Easy::MyNode');
1461
1462 Override the class to be used to constructs objects when calling
1463 "add_edge()", "add_group()" or "add_node()".
1464
1465 The first parameter can be one of the following:
1466
1467 node
1468 edge
1469 group
1470
1471 Please see the documentation about "use_class()" in
1472 "Graph::Easy::Parser" for examples and details.
1473
1474 animation_as_graph()
1475 my $graph_2 = $graph->animation_as_graph();
1476 print $graph_2->as_ascii();
1477
1478 Returns the animation of $graph as a graph describing the flow of the
1479 animation. Useful for debugging animation flows.
1480
1481 add_cycle()
1482 $graph->add_cycle('A','B','C'); # A -> B -> C -> A
1483
1484 Compatibility method for Graph, adds the edges between each node and
1485 back from the last node to the first. Returns the graph.
1486
1487 add_path()
1488 $graph->add_path('A','B','C'); # A -> B -> C
1489
1490 Compatibility method for Graph, adds the edges between each node.
1491 Returns the graph.
1492
1493 add_vertex()
1494 $graph->add_vertex('A');
1495
1496 Compatibility method for Graph, adds the node and returns the graph.
1497
1498 add_vertices()
1499 $graph->add_vertices('A','B');
1500
1501 Compatibility method for Graph, adds these nodes and returns the graph.
1502
1503 has_edge()
1504 $graph->has_edge('A','B');
1505
1506 Compatibility method for Graph, returns true if at least one edge
1507 between A and B exists.
1508
1509 vertices()
1510 Compatibility method for Graph, returns in scalar context the number of
1511 nodes this graph has, in list context a (arbitrarily sorted) list of
1512 node objects.
1513
1514 set_vertex_attribute()
1515 $graph->set_vertex_attribute( 'A', 'fill', '#deadff' );
1516
1517 Compatibility method for Graph, set the named vertex attribute.
1518
1519 Please note that this routine will only accept Graph::Easy attribute
1520 names and values. If you want to attach custom attributes, you need to
1521 start their name with 'x-':
1522
1523 $graph->set_vertex_attribute( 'A', 'x-foo', 'bar' );
1524
1525 get_vertex_attribute()
1526 my $fill = $graph->get_vertex_attribute( 'A', 'fill' );
1527
1528 Compatibility method for Graph, get the named vertex attribute.
1529
1530 Please note that this routine will only accept Graph::Easy attribute
1531 names. See set_vertex_attribute().
1532
1534 Exports nothing.
1535
1537 Graph, Graph::Convert, Graph::Easy::As_svg, Graph::Easy::Manual and
1538 Graph::Easy::Parser.
1539
1540 Related Projects
1541 Graph::Layout::Aesthetic, Graph and Text::Flowchart.
1542
1543 There is also an very old, unrelated project from ca. 1995, which does
1544 something similar. See
1545 <http://rw4.cs.uni-sb.de/users/sander/html/gsvcg1.html>.
1546
1547 Testcases and more examples under:
1548
1549 <http://bloodgate.com/perl/graph/>.
1550
1552 This module is now quite complete, but there are still some
1553 limitations. Hopefully further development will lift these.
1554
1555 Scoring
1556 Scoring is not yet implemented, each generated graph will be the same
1557 regardless of the random seed.
1558
1559 Layouter
1560 The layouter can not yet handle links between groups (or between a
1561 group and a node, or vice versa). These links will thus only appear in
1562 as_graphviz() or as_txt() output.
1563
1564 Paths
1565 No optimizations
1566 In complex graphs, non-optimal layout part like this one might
1567 appear:
1568
1569 +------+ +--------+
1570 | Bonn | --> | Berlin | --> ...
1571 +------+ +--------+
1572 ^
1573 |
1574 |
1575 +---------+ |
1576 | Kassel | ---+
1577 +---------+
1578
1579 A second-stage optimizer that simplifies these layouts is not yet
1580 implemented.
1581
1582 In addition the general placement/processing strategy as well as the
1583 local strategy might be improved.
1584
1585 attributes
1586 The following attributes are currently ignored by the layouter:
1587
1588 undirected graphs
1589 autosplit/autojoin for edges
1590 tail/head label/title/link for edges
1591
1592 groups
1593 The layouter is not fully recursive yet, so groups do not properly
1594 nest.
1595
1596 In addition, links to/from groups are missing, too.
1597
1598 Output formats
1599 Some output formats are not yet complete in their implementation.
1600 Please see the online manual at
1601 <http://bloodgate.com/perl/graph/manual> under "Output" for details.
1602
1604 This library is free software; you can redistribute it and/or modify it
1605 under the terms of the GPL 2.0 or a later version.
1606
1607 See the LICENSE file for a copy of the GPL.
1608
1609 This product includes color specifications and designs developed by
1610 Cynthia Brewer (http://colorbrewer.org/). See the LICENSE file for the
1611 full license text that applies to these color schemes.
1612
1614 The package was formerly known as "Graph::Simple". The name was changed
1615 for two reasons:
1616
1617 • In graph theory, a "simple" graph is a special type of graph. This
1618 software, however, supports more than simple graphs.
1619
1620 • Creating graphs should be easy even when the graphs are quite
1621 complex.
1622
1624 Copyright (C) 2004 - 2008 by Tels <http://bloodgate.com>
1625
1626perl v5.34.0 2022-01-21 Graph::Easy(3)