Skip to content

Commit

Permalink
Use graph instead of subgraph.
Browse files Browse the repository at this point in the history
Otherwise dot reports this error:

..............Error: graph.dot:1: syntax error near line 1
context:  >>> subgraph <<<  RGL__AdjacencyGraph {
  • Loading branch information
monora committed Aug 7, 2011
1 parent 62e5e26 commit 1a2ef4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rgl/dot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ module RGL

module Graph

# Return a RGL::DOT::Digraph for directed graphs or a DOT::Subgraph for an
# Return a RGL::DOT::Digraph for directed graphs or a DOT::Graph for an
# undirected Graph. _params_ can contain any graph property specified in
# rdot.rb.

def to_dot_graph (params = {})
params['name'] ||= self.class.name.gsub(/:/,'_')
fontsize = params['fontsize'] ? params['fontsize'] : '8'
graph = (directed? ? DOT::Digraph : DOT::Subgraph).new(params)
graph = (directed? ? DOT::Digraph : DOT::Graph).new(params)
edge_class = directed? ? DOT::DirectedEdge : DOT::Edge
each_vertex do |v|
name = v.to_s
Expand Down

0 comments on commit 1a2ef4b

Please sign in to comment.