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


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."