Ruby Graph Library -- add a single knode

R

Ralf Müller

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 ?

Thanks
ralf
 
H

Horst Duchene

Ralf said:
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
 
H

Hal Fulton

Ralf said:
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.

I don't know that lib and so can't help you...

But I'm very interesting in this project of yours. I have a few thousand
lines of spaghetti code that I'd like to untangle by discovering all the
relationships.

Is this something you're going to release?


Hal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top