My question was less about compositing and more about ROCircleLayout, so I've split my response into two posts. 

I think the main problem I had was that the ROCircleLayout was determining its radius based only on the number of elements and not the size of the elements. So I've come up with a different approach - not quite finished but thought I'd share it now for some feedback.  Using the same example from my original post.

Existing ROCircleLayout>>doExecute resulting in [1] is due to this...
    radius := elements size * self scaleFactor.
(btw could you change rad to radius anyway - for a while it confused be thinking this was a variable about radians)

I found changing to the following gave a better result [2]
    targetCircumference  := 0.
    elements do: [ :el | targetCircumference := targetCircumference + el bounds extent r ].
    radius := targetCircumference / 2 / Float pi.

However using 3 or 2 instead of 10 in the third line of that example still has overlaps [3] [4], so I was wondering what your thoughts were.  Perhaps a fudge factor at those lower element counts.  Also, probably this only works for elements that have the same bounds.  With a mix of small and large elements some will probably still overlap - so I am thinking next of a more dynamic circle - that evens out the space between nodes and grows or shrinks the circumference as needed - leading into a force based one, that shifts connected elements around the circle to be closer to more connected elements.

cheers -ben

[1] ROCircleLayout-original-10nodes.png
[2] ROCircleLayout-sumCircumference-10nodes.png
[3] ROCircleLayout-sumCircumference-3nodes.png
[4] ROCircleLayout-sumCircumference-2nodes.png

Alexandre Bergel wrote:
Hi Ben,

Currently no. We definitely need a better way to specific layouts and their composition. However this will take time before we have this. 

How would you like to specific the layout?

Cheers,
Alexandre


On Aug 30, 2012, at 6:10 PM, Ben Coman <btc@openInWorld.com> wrote:

  
I have been looking at the ROExample "Nesting" examples and expanded #nesting2 with another level as shown in the code below, such that there is the outer view, middle "#1" nodes and inner "#2" nodes. However the initial state of this has much of the middle node1 and inner node2 nodes overlapping. 
How can these be made for the circle layout to leave spacing between the middle node1 nodes?

cheers -ben

--------------------
  | view nodes1 |
  view := ROView new.
  view add: (ROElement sprite addAll: (nodes1 := ROElement spritesOn: (1 to: 10))).
  nodes1 do: [:n | n addShape: ROLabel].
  nodes1 do:
  [     :node1 |
      ( (node1 model) *100+1 to: (node1 model)*100+5 ) do:
      [    :x |
          node1 add: ( (ROElement spriteOn: x) addShape: ROLabel).
      ].
  ROGridLayout on: node1 elements.
  ].

  ROCircleLayout on: nodes1.
  view openInWindow.
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev