Sha256: 05f274994bbc251a9a24d50f24b495dee5bb1a5981ebb2ad344ea6ca1666ebac

Contents?: true

Size: 1.98 KB

Versions: 2

Compression:

Stored size: 1.98 KB

Contents

= Ruby/GraphViz

Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Gregoire Lejeune

* Doc : http://rdoc.info/projects/glejeune/Ruby-Graphviz
* Sources : http://github.com/glejeune/Ruby-Graphviz
* Continuous Integration : http://runcoderun.com/glejeune/Ruby-Graphviz

== DESCRIPTION

Interface to the GraphViz graphing tool

== SYNOPSIS

A basic example

  require 'graphviz'

  # Create a new graph
  g = GraphViz.new( :G, :type => :digraph )

  # Create two nodes
  hello = g.add_node( "Hello" )
  world = g.add_node( "World" )

  # Create an edge between the two nodes
  g.add_edge( hello, world )

  # Generate output image
  g.output( :png => "hello_world.png" )
  
The same but with a block

  require 'graphviz'

  GraphViz::new( :G, :type => :digraph ) { |g|
    g.world( :label => "World" ) << g.hello( :label => "Hello" )
  }.output( :png => "hello_world.png" )

Create a graph from a file 

  require 'graphviz'

  # In this example, hello.dot is :
  #   digraph G {Hello->World;}

  GraphViz.parse( "hello.dot", :path => "/usr/local/bin" ) { |g|
    g.get_node("Hello") { |n|
      n[:label] = "Bonjour"
    }
    g.get_node("World") { |n|
      n[:label] = "Le Monde"
    }
  }.output(:png => "sample.png")

Ruby/GraphViz also include :

* ruby2gv, a simple tool that's allow you to create a dependency graph from a ruby script. Example : http://drp.ly/dShaZ

	ruby2gv -Tpng -oruby2gv.png ruby2gv

* gem2gv, a tools that's allow you to create a dependency graph between gems. Example : http://drp.ly/dSj9Y

	gem2gv -Tpng -oruby-graphviz.png ruby-graphviz

== INSTALLATION

  sudo gem install ruby-graphviz

You also need to install GraphViz[http://www.graphviz.org] and Treetop[http://treetop.rubyforge.org/]

On *Windows* you also need to install win32-open3. This is not an absolute requirement.

== LICENCE

Ruby/GraphViz is freely distributable according to the terms of the
GNU General Public License (see the file 'COPYING').

This program is distributed without any warranty. See the file
'COPYING' for details.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-graphviz-0.9.9 README.rdoc
ruby-graphviz-0.9.8 README.rdoc