Hello,
I am a bit puzzled by the behavior of Roassal2 using RTGraphBuilder. Inspired by the Agile Visualization Book, I tried some scripts, but I ran into some problems regarding edges.
I used this simple script to connect some random dots:
nodes := #(one two three four five). b := RTGraphBuilder new.
b edges color: Color red; connectFrom: [ :e | nodes atRandom ].
b nodes color: Color gray. b layout grid.
b addAll: nodes. b
It worked to draw the dots, but it didn't displayed any edge. The weird thing is that if I put integers or characters inside nodes, it works correctly.
Example -- this works:
nodes := #(1 2 3 4 5 6). b := RTGraphBuilder new.
b edges color: Color red; connectFrom: [ :e | nodes atRandom ].
b nodes color: Color gray. b layout grid.
b addAll: nodes. b
Am I doing something wrong?
Thanks, Tommaso
Hi Tommaso!
Well spotted! connectFrom: and connectTo: may return a simple object or a collection. This is handy to not have a method called connectFromAll: and connectToAll: (as we have in Mondrian). But String and Symbol are considered as collections.
Update Roassal2 and you will have the correct behavior
Cheers, Alexandre
Amazing, it works perfectly ;-)
Thanks a lot for the super-fast fix! Tommaso
On 30/10/14 20:40, Alexandre Bergel wrote:
Hi Tommaso!
Well spotted! connectFrom: and connectTo: may return a simple object or a collection. This is handy to not have a method called connectFromAll: and connectToAll: (as we have in Mondrian). But String and Symbol are considered as collections.
Update Roassal2 and you will have the correct behavior
Cheers, Alexandre