Sha256: ed9900cac0b57bc83dfd83dc0f6ad8a0f665d8ec81f8366ee5134448fc5e4cf0

Contents?: true

Size: 1.48 KB

Versions: 2

Compression:

Stored size: 1.48 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

== 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")

== INSTALLATION

  sudo gem install ruby-graphviz

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

== 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.3 README.rdoc
ruby-graphviz-0.9.2 README.rdoc