New circle layouts in Roassal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

New circle layouts in Roassal

abergel
Hi!

Daniel has worked on additional circle layouts, which are now included in Roassal.
We now have RTEquidistantCircleLayout and RTWeightedCircleLayout in addition to RTCircleLayout and RTCenteredCircleLayout

Consider this small script:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 20 do: [ :i |
aux sizeElement: i*4+5.
view add: (aux elementOn: i) ].
RTCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=
It produces the output:

There are two recurrent problems with this rendering:
- circles are not centered
- circles overlaps and this overlap can be avoided since there is spaces between the small circles. The layout does not consider the size of the elements

RTEquidistantCircleLayout and RTWeightedCircleLayout  address these problems.

In the script above, replacing RTCircleLayout by RTWeightedCircleLayout produces the following:

The space is allocated to each element according to its size.

A variation of this situation may be seen with the following:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTWeightedCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

The script produces 

It may happens however that you want always the same space between the elements. You should therefore use RTEquidistantCircleLayout as in:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTEquidistantCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

It produces the following:

The work of Daniel may be found in Roassal2.
Thanks Daniel!

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: New circle layouts in Roassal

Tudor Girba-2
Beautiful!

Doru


On Thu, Jul 3, 2014 at 8:27 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

Daniel has worked on additional circle layouts, which are now included in Roassal.
We now have RTEquidistantCircleLayout and RTWeightedCircleLayout in addition to RTCircleLayout and RTCenteredCircleLayout

Consider this small script:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 20 do: [ :i |
aux sizeElement: i*4+5.
view add: (aux elementOn: i) ].
RTCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=
It produces the output:

There are two recurrent problems with this rendering:
- circles are not centered
- circles overlaps and this overlap can be avoided since there is spaces between the small circles. The layout does not consider the size of the elements

RTEquidistantCircleLayout and RTWeightedCircleLayout  address these problems.

In the script above, replacing RTCircleLayout by RTWeightedCircleLayout produces the following:

The space is allocated to each element according to its size.

A variation of this situation may be seen with the following:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTWeightedCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

The script produces 

It may happens however that you want always the same space between the elements. You should therefore use RTEquidistantCircleLayout as in:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTEquidistantCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

It produces the following:

The work of Daniel may be found in Roassal2.
Thanks Daniel!

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: New circle layouts in Roassal

abergel
I like the fact that we are caring more and more about what may look like as details. But this easily sum up and are really important.

Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 3, 2014, at 4:13 PM, Tudor Girba <[hidden email]> wrote:

Beautiful!

Doru


On Thu, Jul 3, 2014 at 8:27 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

Daniel has worked on additional circle layouts, which are now included in Roassal.
We now have RTEquidistantCircleLayout and RTWeightedCircleLayout in addition to RTCircleLayout and RTCenteredCircleLayout

Consider this small script:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 20 do: [ :i |
aux sizeElement: i*4+5.
view add: (aux elementOn: i) ].
RTCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=
It produces the output:
<Screen Shot 2014-07-03 at 2.14.59 PM.png>

There are two recurrent problems with this rendering:
- circles are not centered
- circles overlaps and this overlap can be avoided since there is spaces between the small circles. The layout does not consider the size of the elements

RTEquidistantCircleLayout and RTWeightedCircleLayout  address these problems.

In the script above, replacing RTCircleLayout by RTWeightedCircleLayout produces the following:
<Screen Shot 2014-07-03 at 2.17.20 PM.png>

The space is allocated to each element according to its size.

A variation of this situation may be seen with the following:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTWeightedCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

The script produces 
<Screen Shot 2014-07-03 at 2.20.07 PM.png>

It may happens however that you want always the same space between the elements. You should therefore use RTEquidistantCircleLayout as in:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTEquidistantCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

It produces the following:
<Screen Shot 2014-07-03 at 2.20.18 PM.png>

The work of Daniel may be found in Roassal2.
Thanks Daniel!

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: New circle layouts in Roassal

Richard Wettel-3
very cool!
Ricky


On Thu, Jul 3, 2014 at 11:29 PM, Alexandre Bergel <[hidden email]> wrote:
I like the fact that we are caring more and more about what may look like as details. But this easily sum up and are really important.

Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 3, 2014, at 4:13 PM, Tudor Girba <[hidden email]> wrote:

Beautiful!

Doru


On Thu, Jul 3, 2014 at 8:27 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

Daniel has worked on additional circle layouts, which are now included in Roassal.
We now have RTEquidistantCircleLayout and RTWeightedCircleLayout in addition to RTCircleLayout and RTCenteredCircleLayout

Consider this small script:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 20 do: [ :i |
aux sizeElement: i*4+5.
view add: (aux elementOn: i) ].
RTCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=
It produces the output:
<Screen Shot 2014-07-03 at 2.14.59 PM.png>

There are two recurrent problems with this rendering:
- circles are not centered
- circles overlaps and this overlap can be avoided since there is spaces between the small circles. The layout does not consider the size of the elements

RTEquidistantCircleLayout and RTWeightedCircleLayout  address these problems.

In the script above, replacing RTCircleLayout by RTWeightedCircleLayout produces the following:
<Screen Shot 2014-07-03 at 2.17.20 PM.png>

The space is allocated to each element according to its size.

A variation of this situation may be seen with the following:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTWeightedCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

The script produces 
<Screen Shot 2014-07-03 at 2.20.07 PM.png>

It may happens however that you want always the same space between the elements. You should therefore use RTEquidistantCircleLayout as in:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTEquidistantCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

It produces the following:
<Screen Shot 2014-07-03 at 2.20.18 PM.png>

The work of Daniel may be found in Roassal2.
Thanks Daniel!

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: New circle layouts in Roassal

Usman Bhatti
In reply to this post by abergel
Hi Alex,

Thanks for the work on improving the layouts.

I'm confronted with a problem with RTClusterLayout. 

|elements view interval centerElement|
view := RTView new.
interval := (2 to: 4).
elements := ((RTEllipse new color: Color red; size: [:each | each + 30]) + (RTLabel new text: 'very very very long names')) elementsOn: interval asOrderedCollection.
centerElement := ((RTEllipse new color: Color green; size: [:each | each + 30]) + (RTLabel new text: 'Center Node')) elementOn: 1.
elements add: centerElement.
elements @ RTDraggable.
view addAll: elements.
interval do: [:each | view add: (RTEdge from: (view elementFromModel: 1) to: (view elementFromModel: each)) + (RTLine new color: Color purple) ].
view edges do: [ :each | each trachelShape pushBack ].
(RTClusterLayout new horizontalGap: 200) on: view elements.
view open

With fewer nodes, I get the problem where nodes overlap the center node:
Inline image 2

It works well when I have much more nodes:

Inline image 3



Any idea how can i fix this problem?
thanx.
usman


On Thu, Jul 3, 2014 at 8:27 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

Daniel has worked on additional circle layouts, which are now included in Roassal.
We now have RTEquidistantCircleLayout and RTWeightedCircleLayout in addition to RTCircleLayout and RTCenteredCircleLayout

Consider this small script:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 20 do: [ :i |
aux sizeElement: i*4+5.
view add: (aux elementOn: i) ].
RTCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=
It produces the output:

There are two recurrent problems with this rendering:
- circles are not centered
- circles overlaps and this overlap can be avoided since there is spaces between the small circles. The layout does not consider the size of the elements

RTEquidistantCircleLayout and RTWeightedCircleLayout  address these problems.

In the script above, replacing RTCircleLayout by RTWeightedCircleLayout produces the following:

The space is allocated to each element according to its size.

A variation of this situation may be seen with the following:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTWeightedCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

The script produces 

It may happens however that you want always the same space between the elements. You should therefore use RTEquidistantCircleLayout as in:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTEquidistantCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

It produces the following:

The work of Daniel may be found in Roassal2.
Thanks Daniel!

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: New circle layouts in Roassal

abergel
Hi Usman,

An immediate solution, is to have a particular case with only a few nodes.
I will have a look at this in a couple of days.

Alexandre


On Jul 7, 2014, at 10:45 AM, Usman Bhatti <[hidden email]> wrote:

> Hi Alex,
>
> Thanks for the work on improving the layouts.
>
> I'm confronted with a problem with RTClusterLayout.
>
> |elements view interval centerElement|
> view := RTView new.
> interval := (2 to: 4).
> elements := ((RTEllipse new color: Color red; size: [:each | each + 30]) + (RTLabel new text: 'very very very long names')) elementsOn: interval asOrderedCollection.
> centerElement := ((RTEllipse new color: Color green; size: [:each | each + 30]) + (RTLabel new text: 'Center Node')) elementOn: 1.
> elements add: centerElement.
> elements @ RTDraggable.
> view addAll: elements.
> interval do: [:each | view add: (RTEdge from: (view elementFromModel: 1) to: (view elementFromModel: each)) + (RTLine new color: Color purple) ].
> view edges do: [ :each | each trachelShape pushBack ].
> (RTClusterLayout new horizontalGap: 200) on: view elements.
> view open
>
> With fewer nodes, I get the problem where nodes overlap the center node:
> <Screen Shot 2014-07-07 at 10.41.59 AM.png>
>
> It works well when I have much more nodes:
>
> <Screen Shot 2014-07-07 at 10.43.16 AM.png>
>
>
>
> Any idea how can i fix this problem?
> thanx.
> usman
>
>
> On Thu, Jul 3, 2014 at 8:27 PM, Alexandre Bergel <[hidden email]> wrote:
> Hi!
>
> Daniel has worked on additional circle layouts, which are now included in Roassal.
> We now have RTEquidistantCircleLayout and RTWeightedCircleLayout in addition to RTCircleLayout and RTCenteredCircleLayout
>
> Consider this small script:
> =-=-==-=-==-=-==-=-=
> | view aux |
> view := RTView new.
> aux := RTEllipse new.
> aux color: Color red.
> 1 to: 20 do: [ :i |
> aux sizeElement: i*4+5.
> view add: (aux elementOn: i) ].
> RTCircleLayout
> new
> initialRadius: 150;
> on: view elements.
> view open
> =-=-==-=-==-=-==-=-=
> It produces the output:
> <Screen Shot 2014-07-03 at 2.14.59 PM.png>
>
> There are two recurrent problems with this rendering:
> - circles are not centered
> - circles overlaps and this overlap can be avoided since there is spaces between the small circles. The layout does not consider the size of the elements
>
> RTEquidistantCircleLayout and RTWeightedCircleLayout  address these problems.
>
> In the script above, replacing RTCircleLayout by RTWeightedCircleLayout produces the following:
> <Screen Shot 2014-07-03 at 2.17.20 PM.png>
>
> The space is allocated to each element according to its size.
>
> A variation of this situation may be seen with the following:
> =-=-==-=-==-=-==-=-=
> | view aux |
> view := RTView new.
> aux := RTEllipse new.
> aux color: Color red.
> 1 to: 10 do: [ :i |
> aux sizeElement: i*10+5.
> view add: (aux elementOn: i) ].
> RTWeightedCircleLayout
> new
> initialRadius: 150;
> on: view elements.
> view open
> =-=-==-=-==-=-==-=-=
>
> The script produces
> <Screen Shot 2014-07-03 at 2.20.07 PM.png>
>
> It may happens however that you want always the same space between the elements. You should therefore use RTEquidistantCircleLayout as in:
> =-=-==-=-==-=-==-=-=
> | view aux |
> view := RTView new.
> aux := RTEllipse new.
> aux color: Color red.
> 1 to: 10 do: [ :i |
> aux sizeElement: i*10+5.
> view add: (aux elementOn: i) ].
> RTEquidistantCircleLayout
> new
> initialRadius: 150;
> on: view elements.
> view open
> =-=-==-=-==-=-==-=-=
>
> It produces the following:
> <Screen Shot 2014-07-03 at 2.20.18 PM.png>
>
> The work of Daniel may be found in Roassal2.
> Thanks Daniel!
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: New circle layouts in Roassal

abergel
In reply to this post by Usman Bhatti
At the end, I did not have time to look at this deeply. Best is to have a particular case when you have few nodes.

Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 7, 2014, at 4:45 AM, Usman Bhatti <[hidden email]> wrote:

Hi Alex,

Thanks for the work on improving the layouts.

I'm confronted with a problem with RTClusterLayout. 

|elements view interval centerElement|
view := RTView new.
interval := (2 to: 4).
elements := ((RTEllipse new color: Color red; size: [:each | each + 30]) + (RTLabel new text: 'very very very long names')) elementsOn: interval asOrderedCollection.
centerElement := ((RTEllipse new color: Color green; size: [:each | each + 30]) + (RTLabel new text: 'Center Node')) elementOn: 1.
elements add: centerElement.
elements @ RTDraggable.
view addAll: elements.
interval do: [:each | view add: (RTEdge from: (view elementFromModel: 1) to: (view elementFromModel: each)) + (RTLine new color: Color purple) ].
view edges do: [ :each | each trachelShape pushBack ].
(RTClusterLayout new horizontalGap: 200) on: view elements.
view open

With fewer nodes, I get the problem where nodes overlap the center node:
<Screen Shot 2014-07-07 at 10.41.59 AM.png>

It works well when I have much more nodes:

<Screen Shot 2014-07-07 at 10.43.16 AM.png>



Any idea how can i fix this problem?
thanx.
usman


On Thu, Jul 3, 2014 at 8:27 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

Daniel has worked on additional circle layouts, which are now included in Roassal.
We now have RTEquidistantCircleLayout and RTWeightedCircleLayout in addition to RTCircleLayout and RTCenteredCircleLayout

Consider this small script:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 20 do: [ :i |
aux sizeElement: i*4+5.
view add: (aux elementOn: i) ].
RTCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=
It produces the output:
<Screen Shot 2014-07-03 at 2.14.59 PM.png>

There are two recurrent problems with this rendering:
- circles are not centered
- circles overlaps and this overlap can be avoided since there is spaces between the small circles. The layout does not consider the size of the elements

RTEquidistantCircleLayout and RTWeightedCircleLayout  address these problems.

In the script above, replacing RTCircleLayout by RTWeightedCircleLayout produces the following:
<Screen Shot 2014-07-03 at 2.17.20 PM.png>

The space is allocated to each element according to its size.

A variation of this situation may be seen with the following:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTWeightedCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

The script produces 
<Screen Shot 2014-07-03 at 2.20.07 PM.png>

It may happens however that you want always the same space between the elements. You should therefore use RTEquidistantCircleLayout as in:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTEquidistantCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

It produces the following:
<Screen Shot 2014-07-03 at 2.20.18 PM.png>

The work of Daniel may be found in Roassal2.
Thanks Daniel!

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: New circle layouts in Roassal

Usman Bhatti



On Wed, Aug 13, 2014 at 2:52 AM, Alexandre Bergel <[hidden email]> wrote:
At the end, I did not have time to look at this deeply. Best is to have a particular case when you have few nodes.

No problem, I can adjust this in my visualization.

Thanks for looking into it.

usman
 

Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 7, 2014, at 4:45 AM, Usman Bhatti <[hidden email]> wrote:

Hi Alex,

Thanks for the work on improving the layouts.

I'm confronted with a problem with RTClusterLayout. 

|elements view interval centerElement|
view := RTView new.
interval := (2 to: 4).
elements := ((RTEllipse new color: Color red; size: [:each | each + 30]) + (RTLabel new text: 'very very very long names')) elementsOn: interval asOrderedCollection.
centerElement := ((RTEllipse new color: Color green; size: [:each | each + 30]) + (RTLabel new text: 'Center Node')) elementOn: 1.
elements add: centerElement.
elements @ RTDraggable.
view addAll: elements.
interval do: [:each | view add: (RTEdge from: (view elementFromModel: 1) to: (view elementFromModel: each)) + (RTLine new color: Color purple) ].
view edges do: [ :each | each trachelShape pushBack ].
(RTClusterLayout new horizontalGap: 200) on: view elements.
view open

With fewer nodes, I get the problem where nodes overlap the center node:
<Screen Shot 2014-07-07 at 10.41.59 AM.png>

It works well when I have much more nodes:

<Screen Shot 2014-07-07 at 10.43.16 AM.png>



Any idea how can i fix this problem?
thanx.
usman


On Thu, Jul 3, 2014 at 8:27 PM, Alexandre Bergel <[hidden email]> wrote:
Hi!

Daniel has worked on additional circle layouts, which are now included in Roassal.
We now have RTEquidistantCircleLayout and RTWeightedCircleLayout in addition to RTCircleLayout and RTCenteredCircleLayout

Consider this small script:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 20 do: [ :i |
aux sizeElement: i*4+5.
view add: (aux elementOn: i) ].
RTCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=
It produces the output:
<Screen Shot 2014-07-03 at 2.14.59 PM.png>

There are two recurrent problems with this rendering:
- circles are not centered
- circles overlaps and this overlap can be avoided since there is spaces between the small circles. The layout does not consider the size of the elements

RTEquidistantCircleLayout and RTWeightedCircleLayout  address these problems.

In the script above, replacing RTCircleLayout by RTWeightedCircleLayout produces the following:
<Screen Shot 2014-07-03 at 2.17.20 PM.png>

The space is allocated to each element according to its size.

A variation of this situation may be seen with the following:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTWeightedCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

The script produces 
<Screen Shot 2014-07-03 at 2.20.07 PM.png>

It may happens however that you want always the same space between the elements. You should therefore use RTEquidistantCircleLayout as in:
=-=-==-=-==-=-==-=-=
| view aux |
view := RTView new.
aux := RTEllipse new.
aux color: Color red.
1 to: 10 do: [ :i |
aux sizeElement: i*10+5.
view add: (aux elementOn: i) ].
RTEquidistantCircleLayout 
new 
initialRadius: 150;
on: view elements.
view open
=-=-==-=-==-=-==-=-=

It produces the following:
<Screen Shot 2014-07-03 at 2.20.18 PM.png>

The work of Daniel may be found in Roassal2.
Thanks Daniel!

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev