mondrian issue with nested elements and global edges

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

mondrian issue with nested elements and global edges

Tudor Girba-2
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."


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

Re: mondrian issue with nested elements and global edges

Tudor Girba-2
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 <[hidden email]> 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
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: mondrian issue with nested elements and global edges

abergel
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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


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

Re: mondrian issue with nested elements and global edges

Tudor Girba-2
Hi,

I expect to see a “tree" inside each top node.

Doru



> On Jul 21, 2017, at 8:40 PM, Alexandre Bergel <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
>> [hidden email]
>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> 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
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: mondrian issue with nested elements and global edges

abergel
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 <[hidden email]> wrote:

Hi,

I expect to see a “tree" inside each top node.

Doru



On Jul 21, 2017, at 8:40 PM, Alexandre Bergel <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
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
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


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

Re: mondrian issue with nested elements and global edges

Tudor Girba-2
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:


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 <[hidden email]> 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 <[hidden email]> wrote:

Hi,

I expect to see a “tree" inside each top node.

Doru



On Jul 21, 2017, at 8:40 PM, Alexandre Bergel <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
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
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev

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

--
www.tudorgirba.com
www.feenk.com

"Value is always contextual."





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

Re: mondrian issue with nested elements and global edges

abergel
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> I expect to see a “tree" inside each top node.
>>>
>>> Doru
>>>
>>>
>>>
>>>> On Jul 21, 2017, at 8:40 PM, Alexandre Bergel <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
>>>>> [hidden email]
>>>>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>>>>
>>>> _______________________________________________
>>>> Moose-dev mailing list
>>>> [hidden email]
>>>> 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
>>> [hidden email]
>>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "Value is always contextual."
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



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

Re: mondrian issue with nested elements and global edges

Tudor Girba-2
Hi,

> On Jul 27, 2017, at 1:21 AM, Alexandre Bergel <[hidden email]> wrote:
>
> 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.

The issue with the creation of edges is not difficult: instead of traversing only the children, we simply traverse deeply all children of the current scope. This worked in two versions of Mondrian.

Nevertheless, the main issue I reported related to the application of layouts inside the nested objects.


> 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
> -=-=-=-=-=-=-=-=-=-=

Exactly what it does right now. You start looking in the scope you defined edges in, and find the nodes.

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

It really is not magic at all. It is declarative :). For example, in the same realm, you also do not get an error when one of the nodes does not exist because the intention is to provide a declarative way of building graphs. But, the main issue at hand is how to apply layouts, given that layouts are eager and they get applied when we encounter the layout instruction, and not at the end. Any ideas here?

Cheers,
Doru


> Alexandre
>
>
>> On Jul 22, 2017, at 3:03 AM, Tudor Girba <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I expect to see a “tree" inside each top node.
>>>>
>>>> Doru
>>>>
>>>>
>>>>
>>>>> On Jul 21, 2017, at 8:40 PM, Alexandre Bergel <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
>>>>>> [hidden email]
>>>>>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>>>>>
>>>>> _______________________________________________
>>>>> Moose-dev mailing list
>>>>> [hidden email]
>>>>> 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
>>>> [hidden email]
>>>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>>
>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "Value is always contextual."
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
www.tudorgirba.com
www.feenk.com

"We are all great at making mistakes."








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