[fun] Nice animation

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

[fun] Nice animation

abergel
Hi All,

In the last version of Roassal, you can enjoy a nice animation:

https://dl.dropboxusercontent.com/u/31543901/online/ForceBasedLayout2.mov

Here is the script
-=-=-=-=-=-=-=-=-=-=-=-=
| v es anim edges |
v := RTView new.
v @ RTDraggableView.

es := RTEllipse new elementsOn: RTObject withAllSubclasses.
v addAll: es.
RTMetricNormalizer new
        elements: es;
        normalizeSize: #numberOfLinesOfCode min: 5 max: 30 using: [:vv | vv sqrt * 5 ];
        normalizeColor: #numberOfMethods using: { Color green . Color red };
        alphaColor: 0.3.
         
anim := RTSpringLayoutStepping new view: v.
v addAnimation: anim.

v addMenu: ''add edges'' callback: [
        edges := RTEdgeBuilder new
                view: v;
                objects: RTObject withAllSubclasses from: #superclass.
        anim addEdges: edges ].

v addMenu: ''remove edges'' callback: [
        v edges do: #remove.
        anim removeAllEdges.
        v signalUpdate ].
v open.
-=-=-=-=-=-=-=-=-=-=-=-=

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: [fun] Nice animation

abergel
Here is the right version of the script:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| v es anim edges |
v := RTView new.
v @ RTDraggableView.

es := RTEllipse new elementsOn: RTObject withAllSubclasses.
v addAll: es.
RTMetricNormalizer new
        elements: es;
        normalizeSize: #numberOfLinesOfCode min: 5 max: 30 using: [:vv | vv sqrt * 5 ];
        normalizeColor: #numberOfMethods using: { Color green . Color red };
        alphaColor: 0.3.
         
anim := RTSpringLayoutStepping new view: v.
v addAnimation: anim.

v addMenu: 'add edges' callback: [
        edges := RTEdgeBuilder new
                view: v;
                objects: RTObject withAllSubclasses from: #superclass.
        anim addEdges: edges ].

v addMenu: 'remove edges' callback: [
        v edges do: #remove.
        anim removeAllEdges.
        v signalUpdate ].
v
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Oct 14, 2014, at 10:49 AM, Alexandre Bergel <[hidden email]> wrote:

> Hi All,
>
> In the last version of Roassal, you can enjoy a nice animation:
>
> https://dl.dropboxusercontent.com/u/31543901/online/ForceBasedLayout2.mov
>
> Here is the script
> -=-=-=-=-=-=-=-=-=-=-=-=
> | v es anim edges |
> v := RTView new.
> v @ RTDraggableView.
>
> es := RTEllipse new elementsOn: RTObject withAllSubclasses.
> v addAll: es.
> RTMetricNormalizer new
> elements: es;
> normalizeSize: #numberOfLinesOfCode min: 5 max: 30 using: [:vv | vv sqrt * 5 ];
> normalizeColor: #numberOfMethods using: { Color green . Color red };
> alphaColor: 0.3.
>
> anim := RTSpringLayoutStepping new view: v.
> v addAnimation: anim.
>
> v addMenu: ''add edges'' callback: [
> edges := RTEdgeBuilder new
> view: v;
> objects: RTObject withAllSubclasses from: #superclass.
> anim addEdges: edges ].
>
> v addMenu: ''remove edges'' callback: [
> v edges do: #remove.
> anim removeAllEdges.
> v signalUpdate ].
> v open.
> -=-=-=-=-=-=-=-=-=-=-=-=
>
> 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: [fun] Nice animation

Tudor Girba-2
Very nice indeed! :)

Doru

On Tue, Oct 14, 2014 at 4:55 PM, Alexandre Bergel <[hidden email]> wrote:
Here is the right version of the script:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| v es anim edges |
v := RTView new.
v @ RTDraggableView.

es := RTEllipse new elementsOn: RTObject withAllSubclasses.
v addAll: es.
RTMetricNormalizer new
        elements: es;
        normalizeSize: #numberOfLinesOfCode min: 5 max: 30 using: [:vv | vv sqrt * 5 ];
        normalizeColor: #numberOfMethods using: { Color green . Color red };
        alphaColor: 0.3.

anim := RTSpringLayoutStepping new view: v.
v addAnimation: anim.

v addMenu: 'add edges' callback: [
        edges := RTEdgeBuilder new
                view: v;
                objects: RTObject withAllSubclasses from: #superclass.
        anim addEdges: edges ].

v addMenu: 'remove edges' callback: [
        v edges do: #remove.
        anim removeAllEdges.
        v signalUpdate ].
v
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Oct 14, 2014, at 10:49 AM, Alexandre Bergel <[hidden email]> wrote:

> Hi All,
>
> In the last version of Roassal, you can enjoy a nice animation:
>
> https://dl.dropboxusercontent.com/u/31543901/online/ForceBasedLayout2.mov
>
> Here is the script
> -=-=-=-=-=-=-=-=-=-=-=-=
> | v es anim edges |
> v := RTView new.
> v @ RTDraggableView.
>
> es := RTEllipse new elementsOn: RTObject withAllSubclasses.
> v addAll: es.
> RTMetricNormalizer new
>       elements: es;
>       normalizeSize: #numberOfLinesOfCode min: 5 max: 30 using: [:vv | vv sqrt * 5 ];
>       normalizeColor: #numberOfMethods using: { Color green . Color red };
>       alphaColor: 0.3.
>
> anim := RTSpringLayoutStepping new view: v.
> v addAnimation: anim.
>
> v addMenu: ''add edges'' callback: [
>       edges := RTEdgeBuilder new
>               view: v;
>               objects: RTObject withAllSubclasses from: #superclass.
>       anim addEdges: edges ].
>
> v addMenu: ''remove edges'' callback: [
>       v edges do: #remove.
>       anim removeAllEdges.
>       v signalUpdate ].
> v open.
> -=-=-=-=-=-=-=-=-=-=-=-=
>
> 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



--

"Every thing has its own flow"

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