Horst Duchene
10/6/2004 10:02:00 PM
Ralf Müller wrote:
> Moin Moin,
> i'm usung the Ruby Graph Library (rgl.sourceforge.net) to scan function
> libraries. If function A is used in function B, i add an edge to the
> Graph from B to A.
> To indicate, that a function isn't used in any other function, i would
> just like to add a single knode without any edge.
> I tried 'add_vertex' but no vertices are shown by dotty.
>
> Anybody, who can enlight me ?
>
This is a bug in rgl/dot.rb. If you use the latest CVS-Version (1.4), you
should see isolated nodes. See this sample irb session:
irb(main):001:0> require 'rgl/dot'
irb(main):002:0> require 'rgl/adjacency'
irb(main):003:0> dg = RGL::DirectedAdjacencyGraph.new
#<RGL::DirectedAdjacencyGraph:0x402de28c @vertice_dict={},
@edgelist_class=Set>
irb(main):004:0> dg.add_vertex 1
#<Set:0x402d9d54 @store={}>
irb(main):072:0> dg.print_dotted_on
digraph RGL__DirectedAdjacencyGraph {
label = "RGL__DirectedAdjacencyGraph"
"1" [
fontsize = 8,
label = "1"
]
}
# You see the isolated vertex in DOT formatted output. Therefore dotty
should display it also:
irb(main):073:0> dg.dotty
Cheers
Horst