I understand your request, but I have no easy to fix this as the semantics is not clear to me. It seems that the source:connectFrom:… looks for any elements, and not only the one defined in the current scope. Using the semantics you describes, what the following script should display?
-=-=-=-=-=-=-=-=-=-= b := RTMondrian new. b nodes: #(1 2) forEach: [ :i | b nodes: #(1 2). b layout verticalLine ].
b shape line color: Color blue; withShorterDistanceAttachPoint. b edges connectFrom: 1 to: 2. b -=-=-=-=-=-=-=-=-=-=
I feel we are reaching the limit of what Mondrian is aiming to solve. In the script above, I would expect the behavior we have currently. If "b edges connectFrom: 1 to: 2.” would somehow inject some edges within the outer nodes, then this feel really magic and rather counter intuitive.
Alexandre
On Jul 22, 2017, at 3:03 AM, Tudor Girba tudor@tudorgirba.com wrote:
Hi,
I think there is a misunderstanding.
I want to be able to have hierarchies inside each container node, but by defining the edges once for the overall graph. So, the graph would look almost like in the picture below, but without the shifting:
<Playground-mondrian-issue.png>
For example, I want to show classes grouped in packages, and show inheritance, too. Right now, I have to do it like this:
packages := { 'Glamour-Core' asPackage . 'Glamour-Presentations' asPackage }. view := RTMondrian new. view shape rectangle fillColor: Color yellow. nodes := view nodes: packages forEach: [ :pack | view nodes: pack definedClasses. view edges source: pack definedClasses connectFrom: #superclass to: #yourself. view layout tree ]. classesWithInheritanceBetweenPackages := (packages flatCollect: #definedClasses) select: [ :each | each isClass and: [each package ~= each superclass package] ] thenCollect: [ :each | each -> each superclass ]. view edges source: classesWithInheritanceBetweenPackages connectFrom: [ :x | x value ] to: [ :x | x key ]. view
This means that I explicitly have to pick the edges that I want to draw in the different contexts: once to draw only the local edges, and once to draw only the non-local edges. If layouts would be applied lazily, I could simply do this:
packages := { 'Glamour-Core' asPackage . 'Glamour-Presentations' asPackage }. view := RTMondrian new. view shape rectangle fillColor: Color yellow. nodes := view nodes: packages forEach: [ :pack | view nodes: pack definedClasses. view layout tree ]. view edges source: (packages flatCollect: #definedClasses) connectFrom: [ :x | x superclass ] to: [ :x | x ]. view
As this is not possible now, I was thinking of still constructing the graph in the simplified form by defining edges once, but then we apply the layout later inside each container node, which is still cumbersome.
Cheers, Doru
On Jul 21, 2017, at 8:53 PM, Alexandre Bergel alexandre.bergel@me.com wrote:
Using nodes that belongs to different parent nodes? Well… I do not know how to do this.
Alexandre
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Jul 21, 2017, at 2:41 PM, Tudor Girba tudor@tudorgirba.com wrote:
Hi,
I expect to see a “tree" inside each top node.
Doru
On Jul 21, 2017, at 8:40 PM, Alexandre Bergel alexandre.bergel@me.com wrote:
Hi Doru,
Nesting is indeed a weak point of currently version of Roassal.
Future version of Roassal will ease this.
Try this script:
view := RTMondrian new. view shape rectangle fillColor: Color yellow. nodes := view nodes: { { 1 . 2 } . { 11 . 12 } } forEach: [ :col | view nodes: col ]. view edges source: { 1 . 11 } connectFrom: [ :x | x ] to: [ :x | x + 1 ]. view edges source: { 1 . 2 } connectFrom: [ :x | x ] to: [ :x | x + 10 ]. nodes do: [ :each | RTNest new layout: RTTreeLayout new; centerOn: each elements: each nestedElements ]. view -=-=-=-=-=-=-=-=-=-=-=-=
I am not completely sure to understand what the result should be. What do you expect?
Alexandre
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Jul 21, 2017, at 6:45 AM, Tudor Girba tudor@tudorgirba.com wrote:
Hi,
Actually, my script does not work because the nested nodes are shifted internally.
So, now I do not know any solution for my issue. Any ideas?
The issue is visible when we give the root elements a color:
view := RTMondrian new. view shape rectangle fillColor: Color yellow. nodes := view nodes: { { 1 . 2 } . { 11 . 12 } } forEach: [ :col | view nodes: col ]. view edges source: { 1 . 11 } connectFrom: [ :x | x ] to: [ :x | x + 1 ]. view edges source: { 1 . 2 } connectFrom: [ :x | x ] to: [ :x | x + 10 ]. nodes do: [ :each | RTNest new layout: RTTreeLayout new; on: each nest: each nestedElements ]. view
<Playground-mondrian-issue.png>
Cheers, Doru
On Jul 21, 2017, at 12:42 PM, Tudor Girba tudor@tudorgirba.com wrote:
Hi,
I am trying to use Mondrian for a case in which I have nested elements and crosscutting edges. The issue is that I only found a cumbersome way to specify the layout.
Here is an example:
view := RTMondrian new. view shape rectangle fillColor: Color transparent. nodes := view nodes: { { 1 . 2 } . { 11 . 12 } } forEach: [ :col | view nodes: col ]. view edges source: { 1 . 11 } connectFrom: [ :x | x ] to: [ :x | x + 1 ]. view edges source: { 1 . 2 } connectFrom: [ :x | x ] to: [ :x | x + 10 ]. nodes do: [ :each | RTNest new layout: RTTreeLayout new; on: each nest: each nestedElements ]. view
With bold I have showed the code necessary for applying the layout. In previous versions of Roassal/Mondrian, layouts were applied lazily, after the graph was constructed. This allowed us to write something like this:
view := RTMondrian new. view shape rectangle fillColor: Color transparent. view nodes: { { 1 . 2 } . { 11 . 12 } } forEach: [ :col | view nodes: col. view layout tree ]. view edges source: { 1 . 11 } connectFrom: [ :x | x ] to: [ :x | x + 1 ]. view edges source: { 1 . 2 } connectFrom: [ :x | x ] to: [ :x | x + 10 ]. view
Did I miss something or is this the only way supported currently?
Cheers, Doru
-- www.tudorgirba.com www.feenk.com
"To utilize feedback, you first have to acquire it."
-- www.tudorgirba.com www.feenk.com
"Yesterday is a fact. Tomorrow is a possibility. Today is a challenge."
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
-- www.tudorgirba.com www.feenk.com
"Innovation comes in the least expected form. That is, if it is expected, it already happened."
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
-- www.tudorgirba.com www.feenk.com
"Value is always contextual."
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev