Warning: Can't synchronize with the repository (Unsupported version control system "darcs": Can't find an appropriate component, maybe the corresponding plugin was not enabled? ). Look in the Trac log for more information.

DotR - Ruby wrapper for the 'dot' utility

DotR is a tiny library that makes it easy to construct directed graphs in a variety of graphic formats using the ‘dot’ utility from the Graphviz suite of programs. It supports subgraphs and full style attributes for graphs, nodes and connections (aka "edges").

In order to use DotR you must have  Graphviz installed. See the  Graphviz site for installation instructions and examples of the output that is possible.

Example

d = DotR::Digraph.new do |g|
  g.node('node1') do |n|
    n.label = "MyLabel"
    n.fontsize="8"
  end
  g.node('node2', :label => 'SecondNode') do |n|
    n.connection('node1', :label => 'relates to')
  end
end

File.open('diagram.png', 'w') { |f| f.write(d.diagram(:png)) }

Contacting the author

See the  Sanity, Inc. front page for contact information.

Getting it

Official releases are available in Gem form via  Rubyforge, and can be installed with a simple gem install dotr.

To get the latest version, use  git to access the master repository or download a snapshot tarball. See:  http://git.sanityinc.com/?p=dotr.git