edges attach point issues with tree layout

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

edges attach point issues with tree layout

Tudor Girba-2
Hi,

I have a tree layout scene and I am trying to add on top other edges that do not affect the layout and that should have a centered attach point. However, the edges are still being drawn from bottom to top, like the rest of the edges from the tree layout.

I think this is a bug. What do you think?

Here is the example:

view := RTMondrian new.
view shape label.
view nodes: (1 to: 10).
edges := view edges connectFrom: [ :x | x//2 ].
view layout tree userDefinedEdges: edges.
view shape arrowedLine color: Color red; centeredAttachPoint.
view edges source: {3->2 . 9->7} connectFrom: #key to: #value.
view

http://ws.stfx.eu/QX0KW6F3QYC0

Cheers,
Doru

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

"Quality cannot be an afterthought."

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

Re: edges attach point issues with tree layout

Peter Uhnak
Hi,

the problem is that LayoutBuilder (not the layout itself) changes the attach points in RTLayoutBuilder>>tree .

I think there is some deeper issue with attach points, because RTTreeLayout will override attach points to RTVertialAttachPoint by default. So it's applied twice, but differently. I also think that changing (by default!) attach points in Layouting algorithms is violation of responsibility, but I thought in relation to Mondrian having some good-enough defaults probably makes sense.

In any case, a solution can be to do the opposite of what you've done --- specify what edges should NOT be used in the layout, e.g.:

view := RTMondrian new.
view shape label.
view nodes: (1 to: 10).
view edges connectFrom: [ :x | x//2 ].
view layout tree.
view shape arrowedLine color: Color red; centeredAttachPoint.
view edges notUseInLayout source: {3->2 . 9->7} connectFrom: #key to: #value.
view


On Fri, Jan 13, 2017 at 07:34:39AM +0100, Tudor Girba wrote:

> Hi,
>
> I have a tree layout scene and I am trying to add on top other edges that do not affect the layout and that should have a centered attach point. However, the edges are still being drawn from bottom to top, like the rest of the edges from the tree layout.
>
> I think this is a bug. What do you think?
>
> Here is the example:
>
> view := RTMondrian new.
> view shape label.
> view nodes: (1 to: 10).
> edges := view edges connectFrom: [ :x | x//2 ].
> view layout tree userDefinedEdges: edges.
> view shape arrowedLine color: Color red; centeredAttachPoint.
> view edges source: {3->2 . 9->7} connectFrom: #key to: #value.
> view
>
> http://ws.stfx.eu/QX0KW6F3QYC0
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "Quality cannot be an afterthought."
>
> _______________________________________________
> 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: edges attach point issues with tree layout

abergel
Hi Peter and Doru,

This is a nice spot. I fixed the problem of double attach point assignment, which was causing the behavior spotted by Doru. Try version 1505 of Roassal2 please.

Cheers,
Alexandre


> On Jan 13, 2017, at 7:43 AM, Peter Uhnak <[hidden email]> wrote:
>
> Hi,
>
> the problem is that LayoutBuilder (not the layout itself) changes the attach points in RTLayoutBuilder>>tree .
>
> I think there is some deeper issue with attach points, because RTTreeLayout will override attach points to RTVertialAttachPoint by default. So it's applied twice, but differently. I also think that changing (by default!) attach points in Layouting algorithms is violation of responsibility, but I thought in relation to Mondrian having some good-enough defaults probably makes sense.
>
> In any case, a solution can be to do the opposite of what you've done --- specify what edges should NOT be used in the layout, e.g.:
>
> view := RTMondrian new.
> view shape label.
> view nodes: (1 to: 10).
> view edges connectFrom: [ :x | x//2 ].
> view layout tree.
> view shape arrowedLine color: Color red; centeredAttachPoint.
> view edges notUseInLayout source: {3->2 . 9->7} connectFrom: #key to: #value.
> view
>
>
> On Fri, Jan 13, 2017 at 07:34:39AM +0100, Tudor Girba wrote:
>> Hi,
>>
>> I have a tree layout scene and I am trying to add on top other edges that do not affect the layout and that should have a centered attach point. However, the edges are still being drawn from bottom to top, like the rest of the edges from the tree layout.
>>
>> I think this is a bug. What do you think?
>>
>> Here is the example:
>>
>> view := RTMondrian new.
>> view shape label.
>> view nodes: (1 to: 10).
>> edges := view edges connectFrom: [ :x | x//2 ].
>> view layout tree userDefinedEdges: edges.
>> view shape arrowedLine color: Color red; centeredAttachPoint.
>> view edges source: {3->2 . 9->7} connectFrom: #key to: #value.
>> view
>>
>> http://ws.stfx.eu/QX0KW6F3QYC0
>>
>> Cheers,
>> Doru
>>
>> --
>> www.tudorgirba.com
>> www.feenk.com
>>
>> "Quality cannot be an afterthought."
>>
>> _______________________________________________
>> 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

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



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