Mondrian: the coordinates of an edge

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

Mondrian: the coordinates of an edge

Veronica Isabel Uquillas Gomez
Hi,

I have an inconvenient with the positions in which edges are being drawn.  Attached a screenshot to explain what is happening.

My visualization displays at the beginning all the edges (grey), and then when interacting with a node, its edges change color.
However, when drawing the edges in another color (green/red) some appear in a different location (see the red one).  
For me this creates confusion as it seems to be a different edge (i know that when drawing it's a different object but i think it should appear in the same location as most of them do).

I thought that it was related with the type of line (arrowed) but in fact the same happens with a simple line or in a different layout.
This case in particular uses the dominance tree layout.

Now I am wondering if that is a bug of the layout or of the edge's drawing itself.  And, if this can be fixed..

Best Regards,
Veronica







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

edges-positions.png (44K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mondrian: the coordinates of an edge

abergel
I will look into it this weekend

Alexandre



Le 3 déc. 2011 à 17:46, Veronica Isabel Uquillas Gomez <[hidden email]> a écrit :

> Hi,
>
> I have an inconvenient with the positions in which edges are being drawn.  Attached a screenshot to explain what is happening.
>
> My visualization displays at the beginning all the edges (grey), and then when interacting with a node, its edges change color.
> However, when drawing the edges in another color (green/red) some appear in a different location (see the red one).  
> For me this creates confusion as it seems to be a different edge (i know that when drawing it's a different object but i think it should appear in the same location as most of them do).
>
> I thought that it was related with the type of line (arrowed) but in fact the same happens with a simple line or in a different layout.
> This case in particular uses the dominance tree layout.
>
> Now I am wondering if that is a bug of the layout or of the edge's drawing itself.  And, if this can be fixed..
>
> Best Regards,
> Veronica
>
>
> <edges-positions.png>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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

Re: Mondrian: the coordinates of an edge

abergel
In reply to this post by Veronica Isabel Uquillas Gomez
Hi Veronica,

I need to have more detail. I cannot reproduce the problem. How do you update the edges?


Consider the following example (you need to update Mondrian to see it working, I fixed a bug, which raised an exception). Just do it in an Easel:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Example on updating shape color. Moving the mouse about a node turn the edges to used classes red. "

| classes edges getDepOfAClass classesAndTheirOutgoingEdges |

"Return the list of classes that are dependent from aClass"
getDepOfAClass := [ :aClass |
        | b |
        b := Set new.
        aClass methods do: [:m | b addAll: ((m allLiterals select: [:l | (l isKindOf: Association) and: [ l value isBehavior ]]) collect: #value) ].
        b ].

"We select all the classes of Mondrian"
classes := (Smalltalk globals select: #isBehavior) select: [:c | c name beginsWith: 'MO' ].
view shape rectangle width: #numberOfAttributes; height: #numberOfMethods.
view interaction action: #inspect.
view interaction
        on: MOMouseEnter do: [ :ann |
                (classesAndTheirOutgoingEdges at: ann model) do: [:e | e copyShapeAndDo: [:s | s color: Color red ]].
                 ];
        on: MOMouseLeave do: [ :ann |
                (classesAndTheirOutgoingEdges at: ann model) do: [:e | e copyShapeAndDo: [:s | s color: Color lightGray ]].
                 ].
view nodes: classes.
 
view shape: (MOOrthoVerticalLineShape new color: Color black).
edges := view edgesFrom: #superclass.
view treeLayout userDefinedEdges: edges.

view shape line color: Color veryLightGray.

classesAndTheirOutgoingEdges := Dictionary new.
classes do: [:cls |
        classesAndTheirOutgoingEdges at: cls put: (view edge: cls from: #yourself toAll:  [:c | getDepOfAClass value: c ])
].
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Cheers,
Alexandre


On 3 Dec 2011, at 17:46, Veronica Isabel Uquillas Gomez wrote:

> Hi,
>
> I have an inconvenient with the positions in which edges are being drawn.  Attached a screenshot to explain what is happening.
>
> My visualization displays at the beginning all the edges (grey), and then when interacting with a node, its edges change color.
> However, when drawing the edges in another color (green/red) some appear in a different location (see the red one).  
> For me this creates confusion as it seems to be a different edge (i know that when drawing it's a different object but i think it should appear in the same location as most of them do).
>
> I thought that it was related with the type of line (arrowed) but in fact the same happens with a simple line or in a different layout.
> This case in particular uses the dominance tree layout.
>
> Now I am wondering if that is a bug of the layout or of the edge's drawing itself.  And, if this can be fixed..
>
> Best Regards,
> Veronica
>
>
> <edges-positions.png>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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





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

Re: Mondrian: the coordinates of an edge

Veronica Isabel Uquillas Gomez
Hi Alex,

I could not find an example of how to update the edges, so initially I drew all the edges and then I was simulating an update by using:

        view interaction
                whenClickingUpdateNode: [ :enode |
                        self viewEdgesOfDelta: enode with: outgoingDeltas with: incomingDeltas on: view ]
                whenClickingBackUpdateNode: [ :enode |
                        self resetEdgesOn: view ]
                withLayoutUpdate: false.

But this was drawing new edges and some of them in a different position of the original.

Based on your example I created my edges only once and then I reuse them when changing color... I works perfectly :D

Thank you very much!!

Btw, I am curious about this:
        view treeLayout userDefinedEdges: edges.

What is it exactly? after that you draw more edges... does it to ensure the tree layout based on the initial edges?

Cheers,
Veronica


On 04 Dec 2011, at 15:15, Alexandre Bergel wrote:

> Hi Veronica,
>
> I need to have more detail. I cannot reproduce the problem. How do you update the edges?
>
>
> Consider the following example (you need to update Mondrian to see it working, I fixed a bug, which raised an exception). Just do it in an Easel:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> "Example on updating shape color. Moving the mouse about a node turn the edges to used classes red. "
>
> | classes edges getDepOfAClass classesAndTheirOutgoingEdges |
>
> "Return the list of classes that are dependent from aClass"
> getDepOfAClass := [ :aClass |
> | b |
> b := Set new.
> aClass methods do: [:m | b addAll: ((m allLiterals select: [:l | (l isKindOf: Association) and: [ l value isBehavior ]]) collect: #value) ].
> b ].
>
> "We select all the classes of Mondrian"
> classes := (Smalltalk globals select: #isBehavior) select: [:c | c name beginsWith: 'MO' ].
> view shape rectangle width: #numberOfAttributes; height: #numberOfMethods.
> view interaction action: #inspect.
> view interaction
> on: MOMouseEnter do: [ :ann |
> (classesAndTheirOutgoingEdges at: ann model) do: [:e | e copyShapeAndDo: [:s | s color: Color red ]].
> ];
> on: MOMouseLeave do: [ :ann |
> (classesAndTheirOutgoingEdges at: ann model) do: [:e | e copyShapeAndDo: [:s | s color: Color lightGray ]].
> ].
> view nodes: classes.
>
> view shape: (MOOrthoVerticalLineShape new color: Color black).
> edges := view edgesFrom: #superclass.
> view treeLayout userDefinedEdges: edges.
>
> view shape line color: Color veryLightGray.
>
> classesAndTheirOutgoingEdges := Dictionary new.
> classes do: [:cls |
> classesAndTheirOutgoingEdges at: cls put: (view edge: cls from: #yourself toAll:  [:c | getDepOfAClass value: c ])
> ].
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
> Cheers,
> Alexandre
>
>
> On 3 Dec 2011, at 17:46, Veronica Isabel Uquillas Gomez wrote:
>
>> Hi,
>>
>> I have an inconvenient with the positions in which edges are being drawn.  Attached a screenshot to explain what is happening.
>>
>> My visualization displays at the beginning all the edges (grey), and then when interacting with a node, its edges change color.
>> However, when drawing the edges in another color (green/red) some appear in a different location (see the red one).  
>> For me this creates confusion as it seems to be a different edge (i know that when drawing it's a different object but i think it should appear in the same location as most of them do).
>>
>> I thought that it was related with the type of line (arrowed) but in fact the same happens with a simple line or in a different layout.
>> This case in particular uses the dominance tree layout.
>>
>> Now I am wondering if that is a bug of the layout or of the edge's drawing itself.  And, if this can be fixed..
>>
>> Best Regards,
>> Veronica
>>
>>
>> <edges-positions.png>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


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

Re: Mondrian: the coordinates of an edge

Tudor Girba-2
Hi,

On 4 Dec 2011, at 23:07, Veronica Isabel Uquillas Gomez wrote:

> Hi Alex,
>
> I could not find an example of how to update the edges, so initially I drew all the edges and then I was simulating an update by using:
>
> view interaction
> whenClickingUpdateNode: [ :enode |
> self viewEdgesOfDelta: enode with: outgoingDeltas with: incomingDeltas on: view ]
> whenClickingBackUpdateNode: [ :enode |
> self resetEdgesOn: view ]
> withLayoutUpdate: false.
>
> But this was drawing new edges and some of them in a different position of the original.
>
> Based on your example I created my edges only once and then I reuse them when changing color... I works perfectly :D
>
> Thank you very much!!
>
> Btw, I am curious about this:
> view treeLayout userDefinedEdges: edges.
>
> What is it exactly? after that you draw more edges... does it to ensure the tree layout based on the initial edges?

This tells the layout to only take into account the specified edges. For example, if you want to show a class hierarchy tree and on top show some other relationships, you can tell the view to only layout according to the inheritance edges and not the others.

Cheers,
Doru



> Cheers,
> Veronica
>
>
> On 04 Dec 2011, at 15:15, Alexandre Bergel wrote:
>
>> Hi Veronica,
>>
>> I need to have more detail. I cannot reproduce the problem. How do you update the edges?
>>
>>
>> Consider the following example (you need to update Mondrian to see it working, I fixed a bug, which raised an exception). Just do it in an Easel:
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> "Example on updating shape color. Moving the mouse about a node turn the edges to used classes red. "
>>
>> | classes edges getDepOfAClass classesAndTheirOutgoingEdges |
>>
>> "Return the list of classes that are dependent from aClass"
>> getDepOfAClass := [ :aClass |
>> | b |
>> b := Set new.
>> aClass methods do: [:m | b addAll: ((m allLiterals select: [:l | (l isKindOf: Association) and: [ l value isBehavior ]]) collect: #value) ].
>> b ].
>>
>> "We select all the classes of Mondrian"
>> classes := (Smalltalk globals select: #isBehavior) select: [:c | c name beginsWith: 'MO' ].
>> view shape rectangle width: #numberOfAttributes; height: #numberOfMethods.
>> view interaction action: #inspect.
>> view interaction
>> on: MOMouseEnter do: [ :ann |
>> (classesAndTheirOutgoingEdges at: ann model) do: [:e | e copyShapeAndDo: [:s | s color: Color red ]].
>> ];
>> on: MOMouseLeave do: [ :ann |
>> (classesAndTheirOutgoingEdges at: ann model) do: [:e | e copyShapeAndDo: [:s | s color: Color lightGray ]].
>> ].
>> view nodes: classes.
>>
>> view shape: (MOOrthoVerticalLineShape new color: Color black).
>> edges := view edgesFrom: #superclass.
>> view treeLayout userDefinedEdges: edges.
>>
>> view shape line color: Color veryLightGray.
>>
>> classesAndTheirOutgoingEdges := Dictionary new.
>> classes do: [:cls |
>> classesAndTheirOutgoingEdges at: cls put: (view edge: cls from: #yourself toAll:  [:c | getDepOfAClass value: c ])
>> ].
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>>
>> Cheers,
>> Alexandre
>>
>>
>> On 3 Dec 2011, at 17:46, Veronica Isabel Uquillas Gomez wrote:
>>
>>> Hi,
>>>
>>> I have an inconvenient with the positions in which edges are being drawn.  Attached a screenshot to explain what is happening.
>>>
>>> My visualization displays at the beginning all the edges (grey), and then when interacting with a node, its edges change color.
>>> However, when drawing the edges in another color (green/red) some appear in a different location (see the red one).  
>>> For me this creates confusion as it seems to be a different edge (i know that when drawing it's a different object but i think it should appear in the same location as most of them do).
>>>
>>> I thought that it was related with the type of line (arrowed) but in fact the same happens with a simple line or in a different layout.
>>> This case in particular uses the dominance tree layout.
>>>
>>> Now I am wondering if that is a bug of the layout or of the edge's drawing itself.  And, if this can be fixed..
>>>
>>> Best Regards,
>>> Veronica
>>>
>>>
>>> <edges-positions.png>
>>>
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"To lead is not to demand things, it is to make them happen."




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

Re: Mondrian: the coordinates of an edge

abergel
In reply to this post by Veronica Isabel Uquillas Gomez
> Btw, I am curious about this:
> view treeLayout userDefinedEdges: edges.
>
> What is it exactly? after that you draw more edges... does it to ensure the tree layout based on the initial edges?

It simply says with edges should be tacken into account when doing the layout.

Alexandre

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





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