Skip to content

Commit

Permalink
Fix #15. Use object IDs rather than labels to identify vertexs in DOT…
Browse files Browse the repository at this point in the history
… graph to ensure that distinct nodes that share a label are shown.
  • Loading branch information
louismrose committed Feb 11, 2015
1 parent e5ab99e commit 33206fe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/rgl/dot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,17 @@ def to_dot_graph(params = {})
edge_class = directed? ? DOT::DirectedEdge : DOT::Edge

each_vertex do |v|
name = v.to_s
graph << DOT::Node.new(
'name' => name,
'name' => v.object_id,
'fontsize' => fontsize,
'label' => name
'label' => v.to_s
)
end

each_edge do |u, v|
graph << edge_class.new(
'from' => u.to_s,
'to' => v.to_s,
'from' => u.object_id,
'to' => v.object_id,
'fontsize' => fontsize
)
end
Expand Down

0 comments on commit 33206fe

Please sign in to comment.