Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jplindstrom (594)

jplindstrom
  (email not shown publicly)

Journal of jplindstrom (594)

Sunday August 26, 2007
06:23 PM

use Graph::Easy;

[ #34229 ]

And the cool module of the day is Graph::Easy (live demo) by Tels++.

It's kinda like GraphViz, but it also supports various text-mode output formats.

That's very cool if you want to render a graph of, let's say an inheritance hierarchy in, let's say Emacs. Which I do.

Widen your browser window and take a look at this fairly complicated graph that it managed to deal with (ancestors of the class CatalystX::FeedMe::View::Atom (found at the bottom)).

     .................................
     :        Class::Accessor        :
     :...............................:
       ^
       |
       |
     .................................
  +> :     Class::Accessor::Fast     : <-----+
  |  :...............................:       |
  |    ^                                     |
  |    |                                     |
  |    |                                     |
  |  .................................       |
  |  :    Catalyst::AttrContainer    : ------+---------------------------+
  |  :...............................:       |                           |
  |    ^                                     |                           |
  |    |                                     |                           |
  |    |                                     |                           v
  |  .................................     .......................     ............................
  +- :        Catalyst::Base         : --> : Catalyst::Component : --> : Class::Data::Inheritable :
     :...............................:     :.....................:     :..........................:
       ^
       |
       |
     .................................
     :   Catalyst::View::Atom::XML   :
     :...............................:
       ^
       |
       |
     .................................
     : CatalystX::FeedMe::View::Atom :
     :...............................:

It can even handle groups of nodes (with bounding boxes) and things I thought would be really weird in text-only.

The graph that I display in Emacs is actually quite a bit more compact than the output above. I munged the text a bit to make it fit in the Message window (all upwards arrows are removed since that's the most common inheritance relationship).

     [ Class::Accessor               ]
  +> [ Class::Accessor::Fast         ] <-----+
  |  [ Catalyst::AttrContainer       ] ------+---------------------------+
  |    |                                     |                           v
  +- [ Catalyst::Base                ] --> [ Catalyst::Component ] --> [ Class::Data::Inheritable ]
     [ Catalyst::View::Atom::XML     ]
     [ CatalystX::FeedMe::View::Atom ]

Hopefully that's about the most complicated structure I'll have to visualize.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • besides Graph::Easy and GraphViz are also the projects asymptote and GLE. GLE seems to be able to produce very complicated stuff, I haven't tried it yet but I will.

    cheers --stephan