Sha256: 2bc9fbcbd4e789c608b5854e7dec5e7dfd1e462b709449821771bf7c99739695
Contents?: true
Size: 1.57 KB
Versions: 4
Compression:
Stored size: 1.57 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/] 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
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
ruby-graphviz-0.9.7 | README.rdoc |
ruby-graphviz-0.9.6 | README.rdoc |
ruby-graphviz-0.9.5 | README.rdoc |
ruby-graphviz-0.9.4 | README.rdoc |