Hi
Working on a mixing layout. Something really nice.
But still have a problem.
What do we do when there are several elements with the same model ?
First, it causes troubles with look up, and so with edges...
And then for layout also.
Regards
Mathieu
Hi,
In the Mondrian API, you are encouraged not to have the same model in different nodes. In Roassal, you should not care much because you can look up the element directly.
But I do not understand why you see a problem with the layout. Could you elaborate?
In any case, I am so anxious to see a layout mixer :)
Cheers, Doru
On Wed, Jul 24, 2013 at 3:12 PM, mathieubmddehouck@mailoo.org wrote:
**
Hi
Working on a mixing layout. Something really nice.
But still have a problem.
What do we do when there are several elements with the same model ?
First, it causes troubles with look up, and so with edges...
And then for layout also.
Regards
Mathieu
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
There is no real problem with layouts, but since there are problems creating edges, then there are problems applying layouts.
I was thinking about how to apply mixing layout to multiple hierarchies when some are included in one another. But maybe that's not a real use-case.
Something like: Collection withAllSubclasses flatollect: [ :e | e withAllSubclasses ].
Mathieu
Hi
I found something interesting with several nodes having the same model.
I wanted to draw some kind of tree with classes and methods, then I made something like
Magnitude withAllSubclasses flatCollect: [ :e | e methodDict values ]
And what I noticed, is that compiledMethods>> = does not compare selector, but a bunch of other stuff, then when using lookup: Number>>*, Number>>+ , - and / are considered being the same model...
Maybe we should modify lookup: so that it also looks at the model name ?
Here is a use case where lookup: fails.
Regards
Mathieu
Hi,
I do not understand. It would be much easier is you pasted here the script you have :)
Doru
On Thu, Jul 25, 2013 at 11:24 AM, mathieubmddehouck@mailoo.org wrote:
**
Hi
I found something interesting with several nodes having the same model.
I wanted to draw some kind of tree with classes and methods, then I made something like
Magnitude withAllSubclasses flatCollect: [ :e | e methodDict values ]
And what I noticed, is that compiledMethods>> = does not compare selector, but a bunch of other stuff, then when using lookup: Number>>*, Number>>+ , - and / are considered being the same model...
Maybe we should modify lookup: so that it also looks at the model name ?
Here is a use case where lookup: fails.
Regards
Mathieu
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Try this:
"Source code: ROMondrianExample>>treeLayoutOn:" "Preambule. It includes the initialization. " | view rawView | rawView := ROView new. view := ROMondrianViewBuilder view: rawView. "-------------" "-------------"
view shape rectangle size: 20. view nodes: ( Magnitude withAllSubclasses flatCollect: [ :e | e methodDict values ]) . view edgesFrom: [ :e | [e superclass] on: Exception do: [ e methodClass ] ]. view layout: ROTreeLayout .
"view edges do: [ :e | e - ROLine ]."
"-------------" "-------------" "Below is the initiation of the menu and opening the visualization" ROEaselMorphic new populateMenuOn: view. view open
Regards
Mathieu
Ok maybe I have something.
Gofer it smalltalkhubUser: 'MathieuDehouck' project: 'RoassalAlgorithm'; package: 'RoassalAlgorithm'; load.
Then try :
"Source code: ROMondrianExample>>treeLayoutOn:" "Preambule. It includes the initialization. " | view rawView | rawView := ROView new. view := ROMondrianViewBuilder view: rawView. "-------------" "-------------"
view shape rectangle size: 45 ; color: Color green. view nodes: Magnitude withAllSubclasses. view edgesFrom: #superclass.
view shape rectangle size: 20; color: Color blue. view nodes: ( Magnitude withAllSubclasses flatCollect: [ :e | e methodDict values ] ) . "view edgesFrom: [ :e | [e superclass] on: Exception do: [ e methodClass ] ]." view layout: (ROMixingLayout withInner: (RORectanglePackingLayout new padding: 5) outer: RORadialTreeLayout groupBy: [ :e | e methodClass ] ).
"view edges do: [ :e | e - ROLine ]."
"-------------" "-------------" "Below is the initiation of the menu and opening the visualization" ROEaselMorphic new populateMenuOn: view. view open
Must bring you something like that the picture.
Regards
Mathieu
Where the class RORectanglePackingLayout is defined? I have the last version of Roassal; I have loaded the package RoassalAlgorithm. RORectanglePackingLayout is undefined.
Alexandre
On Jul 25, 2013, at 8:07 AM, mathieubmddehouck@mailoo.org wrote:
Ok maybe I have something.
Gofer it smalltalkhubUser: 'MathieuDehouck' project: 'RoassalAlgorithm'; package: 'RoassalAlgorithm'; load.
Then try :
"Source code: ROMondrianExample>>treeLayoutOn:" "Preambule. It includes the initialization. " | view rawView | rawView := ROView new. view := ROMondrianViewBuilder view: rawView. "-------------" "-------------"
view shape rectangle size: 45 ; color: Color green. view nodes: Magnitude withAllSubclasses. view edgesFrom: #superclass. view shape rectangle size: 20; color: Color blue. view nodes: ( Magnitude withAllSubclasses flatCollect: [ :e | e methodDict values ] ) . "view edgesFrom: [ :e | [e superclass] on: Exception do: [ e methodClass ] ]." view layout: (ROMixingLayout withInner: (RORectanglePackingLayout new padding: 5) outer: RORadialTreeLayout groupBy: [ :e | e methodClass ] ). "view edges do: [ :e | e - ROLine ]."
"-------------" "-------------" "Below is the initiation of the menu and opening the visualization" ROEaselMorphic new populateMenuOn: view. view open
Must bring you something like that the picture.
Regards
Mathieu
<mixing RadialTree with RectanglePacking.jpg>_______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
It is interesting. Even though, apparently you may want to use the classical nesting for this. The very first thing I've tried to do is to drag and drop a node, but nodes do not stay grouped when drag and dropping.
I do not understand how ROMixingLayout operates. Can you write some simple tests that are not about visualizing compile methods?
For example, I've tried this:
view shape rectangle color: Color red; size: 20. view nodes: (0 to: 21). view edgesFrom: [ :v | v \ 3 ].
view shape rectangle color: Color green; size: 20. view nodes: (100 to: 121).
view layout: (ROMixingLayout withInner: (ROGridLayout new) outer: ROTreeLayout new groupBy: [:v | v + 100 ]).
I get an error and I do not understand why.
Alexandre
On Jul 25, 2013, at 8:07 AM, mathieubmddehouck@mailoo.org wrote:
Ok maybe I have something.
Gofer it smalltalkhubUser: 'MathieuDehouck' project: 'RoassalAlgorithm'; package: 'RoassalAlgorithm'; load.
Then try :
"Source code: ROMondrianExample>>treeLayoutOn:" "Preambule. It includes the initialization. " | view rawView | rawView := ROView new. view := ROMondrianViewBuilder view: rawView. "-------------" "-------------"
view shape rectangle size: 45 ; color: Color green. view nodes: Magnitude withAllSubclasses. view edgesFrom: #superclass. view shape rectangle size: 20; color: Color blue. view nodes: ( Magnitude withAllSubclasses flatCollect: [ :e | e methodDict values ] ) . "view edgesFrom: [ :e | [e superclass] on: Exception do: [ e methodClass ] ]." view layout: (ROMixingLayout withInner: (RORectanglePackingLayout new padding: 5) outer: RORadialTreeLayout groupBy: [ :e | e methodClass ] ). "view edges do: [ :e | e - ROLine ]."
"-------------" "-------------" "Below is the initiation of the menu and opening the visualization" ROEaselMorphic new populateMenuOn: view. view open
Must bring you something like that the picture.
Regards
Mathieu
<mixing RadialTree with RectanglePacking.jpg>_______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Hi,
On Sun, Jul 28, 2013 at 11:36 PM, Alexandre Bergel alexandre.bergel@me.comwrote:
It is interesting. Even though, apparently you may want to use the classical nesting for this. The very first thing I've tried to do is to drag and drop a node, but nodes do not stay grouped when drag and dropping.
The whole point of this mechanism is precisely to not use nesting :). It's about laying out one flat graph by composing two existing layouts without the need of creating it explicitly.
The original idea was to offer a tree layout that is combined with a flow layout such that after a width, the next hierarchies are placed at a lower row.
I do not understand how ROMixingLayout operates. Can you write some simple tests that are not about visualizing compile methods?
Indeed, that would be good.
Doru
For example, I've tried this:
view shape rectangle color: Color red; size: 20. view nodes: (0 to: 21). view edgesFrom: [ :v | v \ 3 ].
view shape rectangle color: Color green; size: 20. view nodes: (100 to: 121).
view layout: (ROMixingLayout withInner: (ROGridLayout new) outer: ROTreeLayout new groupBy: [:v | v + 100 ]).
I get an error and I do not understand why.
Alexandre
On Jul 25, 2013, at 8:07 AM, mathieubmddehouck@mailoo.org wrote:
Ok maybe I have something.
Gofer it smalltalkhubUser: 'MathieuDehouck' project: 'RoassalAlgorithm'; package: 'RoassalAlgorithm'; load.
Then try :
"Source code: ROMondrianExample>>treeLayoutOn:" "Preambule. It includes the initialization. " | view rawView | rawView := ROView new. view := ROMondrianViewBuilder view: rawView. "-------------" "-------------"
view shape rectangle size: 45 ; color: Color green. view nodes: Magnitude withAllSubclasses. view edgesFrom: #superclass. view shape rectangle size: 20; color: Color blue. view nodes: ( Magnitude withAllSubclasses flatCollect: [ :e | e
methodDict values ] ) .
"view edgesFrom: [ :e | [e superclass] on: Exception do: [ e
methodClass ] ]."
view layout: (ROMixingLayout withInner: (RORectanglePackingLayout
new padding: 5) outer: RORadialTreeLayout groupBy: [ :e | e methodClass ] ).
"view edges do: [ :e | e - ROLine ]."
"-------------" "-------------" "Below is the initiation of the menu and opening the visualization" ROEaselMorphic new populateMenuOn: view. view open
Must bring you something like that the picture.
Regards
Mathieu
<mixing RadialTree with
RectanglePacking.jpg>_______________________________________________
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
I'll have a look at it. And will write a few examples.
I don't use nesting. And yes drag and drop doesn't apply to the whole group for now, but it can be done (i think).
Well the bug is due to a nil returned by elementFromModel, but i fixed my code, so it seems ok.
Then groupBy: aBlock aBlock must point to the "leader" of the group, I mean the element on which apply the outer layout in this case 100 must point to 0 and not 0 to 100, since 0 has edges and not 100. So change the + by a - is better.
In case the block returns nil or raise an exception, we use the model of the element, so we can pass a block which has sense only for the member of groups and not for the leader for example.
Mathieu
Le 28.07.2013 23:36, Alexandre Bergel a écrit :
It is interesting. Even though, apparently you may want to use the classical nesting for this. The very first thing I've tried to do is to drag and drop a node, but nodes do not stay grouped when drag and dropping.
I do not understand how ROMixingLayout operates. Can you write some simple tests that are not about visualizing compile methods?
For example, I've tried this:
view shape rectangle color: Color red; size: 20. view nodes: (0 to: 21). view edgesFrom: [ :v | v \ 3 ].
view shape rectangle color: Color green; size: 20. view nodes: (100 to: 121).
view layout: (ROMixingLayout withInner: (ROGridLayout new) outer: ROTreeLayout new groupBy: [:v | v + 100 ]).
I get an error and I do not understand why.
Alexandre
I do not understand what the following is supposed to do:
view shape rectangle size: 20. view nodes: ( Magnitude withAllSubclasses flatCollect: [ :e | e methodDict values ]) . view edgesFrom: [ :e | [e superclass] on: Exception do: [ e methodClass ] ]. view layout: ROTreeLayout .
Maybe you forgot to have before: view nodes: ( Magnitude withAllSubclasses).
?
Alexandre
On Jul 25, 2013, at 6:41 AM, mathieubmddehouck@mailoo.org wrote:
Try this:
"Source code: ROMondrianExample>>treeLayoutOn:" "Preambule. It includes the initialization. " | view rawView | rawView := ROView new. view := ROMondrianViewBuilder view: rawView. "-------------" "-------------"
view shape rectangle size: 20. view nodes: ( Magnitude withAllSubclasses flatCollect: [ :e | e methodDict values ]) . view edgesFrom: [ :e | [e superclass] on: Exception do: [ e methodClass ] ]. view layout: ROTreeLayout . "view edges do: [ :e | e - ROLine ]."
"-------------" "-------------" "Below is the initiation of the menu and opening the visualization" ROEaselMorphic new populateMenuOn: view. view open
Regards
Mathieu
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
This one was about to show that several methods (different names) are = and then look up fails when creating edges the proper way.
Le 28.07.2013 23:21, Alexandre Bergel a écrit :
I do not understand what the following is supposed to do:
view shape rectangle size: 20. view nodes: ( Magnitude withAllSubclasses flatCollect: [ :e | e methodDict values ]) . view edgesFrom: [ :e | [e superclass] on: Exception do: [ e methodClass ] ]. view layout: ROTreeLayout .
Maybe you forgot to have before: view nodes: ( Magnitude withAllSubclasses).
?
Alexandre