builder := RTGraphBuilder new.
builder nodes shape: (RTEllipse new size: 20).
builder edges
connectTo: [ :c | c subclasses ];
useInLayout;
shape: (RTLine new color: Color gray).
builder layout force
charge: -300;
length: 20.
builder addAll: Boolean allSuperclasses, Boolean withAllSubclasses.
builder build.
builder view
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
We give a repulsion of -300 to each node (which is what you want since nodes have to repulse each other), and you give a length of 20 pixel to each edge.
You end up with something like:
<Screen Shot 2014-11-11 at 11.01.43 AM.png>
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hello.
I’m trying to use Force based layout to position some elements. I expected to get the image like this.
<Screen Shot 2014-11-10 at 11.16.54.png>
<Screen Shot 2014-11-10 at 12.01.11 PM.png>
It looks like all elements attract instead of repel each other. Does somebody know why it is like that?
Best regards,
Natalia
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.chhttps://www.iam.unibe.ch/mailman/listinfo/moose-dev