Permalink
Browse files

Add documentation for subgraph functionality

darcs-hash:20070211141819-96723-1827ef60bc25fddc5761bbda21338fdbab5d58dc.gz
  • Loading branch information...
1 parent 6a43a3e commit 35a70a37ae1d45a98dc690d323cb320ee1adaad7 @purcell committed Feb 11, 2007
Showing with 11 additions and 1 deletion.
  1. +11 −1 lib/dotr.rb
View
@@ -57,7 +57,7 @@ def node(name, style={}, &block)
end
# Create a connection in the graph between two nodes with the given names.
- # If a block is provided # it will be called with the connection as a parameter,
+ # If a block is provided it will be called with the connection as a parameter,
# for convenient specification of styles.
#
# Nodes with the given names are implicitly created if they have not
@@ -68,6 +68,16 @@ def connection(from_node_name, to_node_name, style={}, &block)
end
end
+ # Create a subgraph of the same type, which can have distinct formatting
+ # and its own nodes.
+ #
+ # Example:
+ #
+ # d = DotR::Digraph.new('myname') do |g|
+ # g.subgraph('subg', :color => "lightgrey") do |s|
+ # s.connection("foo", "bar")
+ # end
+ # end
def subgraph(name, style={}, &block)
@subgraphs << self.class.new(name, style, &block)
end

0 comments on commit 35a70a3

Please sign in to comment.