Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Graph::Easy 0.71

    Download button

    No screenshots available
    Downloads: 371  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Tels | More programs
    Perl Artistic License / FREE
    January 25th, 2012, 16:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Graph::Easy description

    Convert or render graphs (as ASCII, HTML, SVG or via Graphviz)

    Graph::Easy is a Perl module that lets you generate graphs consisting of various shaped nodes connected by edges (with optional labels).

    SYNOPSIS

     use Graph::Easy;
     
     my $graph = Graph::Easy->new();

     # make a fresh copy of the graph
     my $new_graph = $graph->copy();

     $graph->add_edge ('Bonn', 'Berlin');

     # will not add it, since it already exists
     $graph->add_edge_once ('Bonn', 'Berlin');

     print $graph->as_ascii( ); # prints:

     # +------+ +--------+
     # | Bonn | --> | Berlin |
     # +------+ +--------+

     #####################################################
     # alternatively, let Graph::Easy parse some text:

     my $graph = Graph::Easy->new( '[Bonn] -> [Berlin]' );

     #####################################################
     # slightly more verbose way:

     my $graph = Graph::Easy->new();

     my $bonn = $graph->add_node('Bonn');
     $bonn->set_attribute('border', 'solid 1px black')

     my $berlin = $graph->add_node('Berlin');

     $graph->add_edge ($bonn, $berlin);

     print $graph->as_ascii( );

     # You can use plain scalars as node names and for the edge label:
     $graph->add_edge ('Berlin', 'Frankfurt', 'via train');

     # adding edges with attributes:

     my $edge = Graph::Easy::Edge->new();
     $edge->set_attributes( {
     label => 'train',
     style => 'dotted',
     color => 'red',
     } );

     # now with the optional edge object
     $graph->add_edge ($bonn, $berlin, $edge);

     # raw HTML section
     print $graph->as_html( );

     # complete HTML page (with CSS)
     print $graph->as_html_file( );

     # Other possibilities:

     # SVG (possible after you installed Graph::Easy::As_svg):
     print $graph->as_svg( );

     # Graphviz:
     my $graphviz = $graph->as_graphviz();
     open $DOT, '|dot -Tpng -o graph.png' or die ("Cannot open pipe to dot: $!");
     print $DOT $graphviz;
     close $DOT;

     # Please see also the command line utility 'graph-easy'


    It can read and write graphs in a varity of formats, as well as render them via its own grid-based layouter.

    Since the layouter works on a grid (manhattan layout), the output is most usefull for flow charts, network diagrams, or hierarchy trees.


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    render graphs | Perl module | shaped nodes | ASCII | HTML | SVG

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM