Rectangle packing

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

Rectangle packing

MathieuDehouck

Hi

 

There is a new layout for packing rectangle nodes.

 

Gofer new
    smalltalkhubUser: '' project: 'RoassalAlgorithm';
    package: 'Roassal-New';
    load

 

---------------------------------------------------------------------------------------------------

"Source code: ROMondrianExample>>miniMapOn:"
"Preambule. It includes the initialization. "
| view rawView |
rawView := ROView new.
view := ROMondrianViewBuilder view: rawView.
"-------------"
"-------------"
    
    view shape rectangle
        width:  [ :cls | cls numberOfVariables * 5 ];  
        height: #numberOfMethods;
        color: (Color r: 0 g: 1 b: 1 ).

    view nodes: Collection withAllSubclasses.

    "1 to: view nodes size by: 2 do: [ :ea ||i e| e := view nodes at: ea.
                                                         i := e width.
                                                        e width: e height.
                                                        e height: i.
                                                        e extent: e width @ e height ] ."

    view layout:(( RORectanglePacking new)ratioWidth: 2 height: 1; padding: 3).

"-------------"
"-------------"
"Below is the initiation of the menu and opening the visualization"
ROEaselMorphic new populateMenuOn: view.
view open.
------------------------------------------------------------------------------------------------------

 

Try it and give me feedback, please.

Regards

Mathieu

 

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

Re: Rectangle packing

stephane ducasse
picture? :)
the internet connection here is so bad (I'm at dinard in a castle).

Stef
On May 24, 2013, at 1:15 PM, [hidden email] wrote:

Hi

 

There is a new layout for packing rectangle nodes.

 

Gofer new
    smalltalkhubUser: '' project: 'RoassalAlgorithm';
    package: 'Roassal-New';
    load

 

---------------------------------------------------------------------------------------------------

"Source code: ROMondrianExample>>miniMapOn:"
"Preambule. It includes the initialization. "
| view rawView |
rawView := ROView new.
view := ROMondrianViewBuilder view: rawView.
"-------------"
"-------------"
    
    view shape rectangle
        width:  [ :cls | cls numberOfVariables * 5 ];  
        height: #numberOfMethods;
        color: (Color r: 0 g: 1 b: 1 ).

    view nodes: Collection withAllSubclasses.

    "1 to: view nodes size by: 2 do: [ :ea ||i e| e := view nodes at: ea.
                                                         i := e width.
                                                        e width: e height.
                                                        e height: i.
                                                        e extent: e width @ e height ] ."

    view layout:(( RORectanglePacking new)ratioWidth: 2 height: 1; padding: 3).

"-------------"
"-------------"
"Below is the initiation of the menu and opening the visualization"
ROEaselMorphic new populateMenuOn: view.
view open.
------------------------------------------------------------------------------------------------------

 

Try it and give me feedback, please.

Regards

Mathieu

 
_______________________________________________
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: Rectangle packing

abergel
In reply to this post by MathieuDehouck
I guess the correct incantation to load the code is

Gofer it 
   smalltalkhubUser: 'MathieuDehouck' project: 'RoassalAlgorithm';
   package: 'Roassal-New';
   load.

A screenshot:


Can you comments the methods?
#ratioWidth:height:
#padding:

This is a very compact layout. Excellent!

Cheers,
Alexandre


On May 24, 2013, at 7:15 AM, [hidden email] wrote:

Hi

 
There is a new layout for packing rectangle nodes.

 
Gofer new 
    smalltalkhubUser: '' project: 'RoassalAlgorithm';
    package: 'Roassal-New';
    load

 
---------------------------------------------------------------------------------------------------

"Source code: ROMondrianExample>>miniMapOn:"
"Preambule. It includes the initialization. "
| view rawView |
rawView := ROView new.
view := ROMondrianViewBuilder view: rawView.
"-------------"
"-------------"
    
    view shape rectangle 
        width:  [ :cls | cls numberOfVariables * 5 ];  
        height: #numberOfMethods;
        color: (Color r: 0 g: 1 b: 1 ).

    view nodes: Collection withAllSubclasses.

    "1 to: view nodes size by: 2 do: [ :ea ||i e| e := view nodes at: ea.
                                                         i := e width.
                                                        e width: e height.
                                                        e height: i.
                                                        e extent: e width @ e height ] ."

    view layout:(( RORectanglePacking new)ratioWidth: 2 height: 1; padding: 3).

"-------------"
"-------------"
"Below is the initiation of the menu and opening the visualization"
ROEaselMorphic new populateMenuOn: view.
view open.
------------------------------------------------------------------------------------------------------

 
Try it and give me feedback, please.

Regards

Mathieu

 
_______________________________________________
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: Rectangle packing

Tudor Girba-2
Nice indeed!

Doru

--

"Every thing has its own flow."

On 27.05.2013, at 15:24, Alexandre Bergel <[hidden email]> wrote:

I guess the correct incantation to load the code is

Gofer it 
   smalltalkhubUser: 'MathieuDehouck' project: 'RoassalAlgorithm';
   package: 'Roassal-New';
   load.

A screenshot:

<Screen Shot 2013-05-27 at 9.21.14 AM.png>

Can you comments the methods?
#ratioWidth:height:
#padding:

This is a very compact layout. Excellent!

Cheers,
Alexandre


On May 24, 2013, at 7:15 AM, [hidden email] wrote:

Hi

 
There is a new layout for packing rectangle nodes.

 
Gofer new 
    smalltalkhubUser: '' project: 'RoassalAlgorithm';
    package: 'Roassal-New';
    load

 
---------------------------------------------------------------------------------------------------

"Source code: ROMondrianExample>>miniMapOn:"
"Preambule. It includes the initialization. "
| view rawView |
rawView := ROView new.
view := ROMondrianViewBuilder view: rawView.
"-------------"
"-------------"
    
    view shape rectangle 
        width:  [ :cls | cls numberOfVariables * 5 ];  
        height: #numberOfMethods;
        color: (Color r: 0 g: 1 b: 1 ).

    view nodes: Collection withAllSubclasses.

    "1 to: view nodes size by: 2 do: [ :ea ||i e| e := view nodes at: ea.
                                                         i := e width.
                                                        e width: e height.
                                                        e height: i.
                                                        e extent: e width @ e height ] ."

    view layout:(( RORectanglePacking new)ratioWidth: 2 height: 1; padding: 3).

"-------------"
"-------------"
"Below is the initiation of the menu and opening the visualization"
ROEaselMorphic new populateMenuOn: view.
view open.
------------------------------------------------------------------------------------------------------

 
Try it and give me feedback, please.

Regards

Mathieu

 
_______________________________________________
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

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

Re: Rectangle packing

stephane ducasse
In reply to this post by abergel

>> Gofer it
>>    smalltalkhubUser: 'MathieuDehouck' project: 'RoassalAlgorithm';
>>    package: 'Roassal-New';
>>    load.


> Can you comments the methods?
> #ratioWidth:height:
> #padding:


> This is a very compact layout. Excellent!

Yes :)
What would be good is to be able to say that the largest nodes can be
computed using log: so that we can control that we are not completely dependent
of the large node.

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