🕷 software projects

by ryan davis



sitemap

graph

Easiest and cleanest graphviz api EVER.

Graph is a type of hash that outputs in graphviz’s dot format. It comes with a command-line interface that is easily pluggable.

It ships with plugins to graph dependencies and status of installed rubygems, rake tasks, homebrew ports, mac ports, and freebsd ports, coloring leaf nodes blue, outdated nodes red, and outdated leaf nodes purple (red+blue).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
digraph do
  # many ways to access/create edges and nodes
  edge "a", "b"
  self["b"]["c"]
  node("c") >> "a"

  square   << node("a")
  triangle << node("b")

  red   << node("a") << edge("a", "b")
  green << node("b") << edge("b", "c")
  blue  << node("c") << edge("c", "a")

  save "simple_example", "png"
end

Get The Code

If you just want to use graph, you can install it via RubyGems:
gem install graph
Fork me on GitHub If you want to hack on graph, clone it from GitHub:
git clone git://github.com/seattlerb/graph

Latest Activity