Selecting edges for coloring

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

Selecting edges for coloring

Usman Bhatti
Hello,

We are working on the visualization of plugins in Mondrian and we are trying to create some custom visu. Question: Is there anyway we can color a few edges in Mondrian according to some condition? That is, we are trying to describe a condition for coloring edges according to the plugin they target as illustrated by the bold line in the script below:

view shape rectangle
       width:  [:p | p outgoingFAMIXEclipsePluginImport size] ;
       height:  [:p | p incomingFAMIXEclipsePluginImport size] ;
       
       if: [ p | p name includesSubString: 'uml'] fillColor: Color blue.
view nodes: (eclipsePluginGroup select: [:p | p name includesSubString: 'papyrus']).

view shape arrowedLine
       if: [ :i | i target name = 'org.eclipse.papyrus.core'] fillColor: Color red.
view edges: (MooseModel root allModels first allWithType: FAMIXEclipsePluginImport) from: #source to: #target.

view dominanceTreeLayout .
 
thanx in advance,
Usman & Nicolas

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

Re: Selecting edges for coloring

Tudor Girba-2
Of course it is possible. Only if:color: is not implemented in LineShape.

So, at the moment, you can simply use:
   color: [:each | ... ifTrue: [Color blue] ifFalse: [Color lightGray ] ]

Doru


On Tue, Oct 4, 2011 at 11:34 AM, Usman Bhatti <[hidden email]> wrote:
Hello,

We are working on the visualization of plugins in Mondrian and we are trying to create some custom visu. Question: Is there anyway we can color a few edges in Mondrian according to some condition? That is, we are trying to describe a condition for coloring edges according to the plugin they target as illustrated by the bold line in the script below:

view shape rectangle
       width:  [:p | p outgoingFAMIXEclipsePluginImport size] ;
       height:  [:p | p incomingFAMIXEclipsePluginImport size] ;
       
       if: [ p | p name includesSubString: 'uml'] fillColor: Color blue.
view nodes: (eclipsePluginGroup select: [:p | p name includesSubString: 'papyrus']).

view shape arrowedLine
       if: [ :i | i target name = 'org.eclipse.papyrus.core'] fillColor: Color red.
view edges: (MooseModel root allModels first allWithType: FAMIXEclipsePluginImport) from: #source to: #target.

view dominanceTreeLayout .
 
thanx in advance,
Usman & Nicolas

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




--
--

"Every thing has its own flow"


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

Re: Selecting edges for coloring

Usman Bhatti
Ok thanx. It works.

On Tue, Oct 4, 2011 at 11:43 AM, Tudor Girba <[hidden email]> wrote:
Of course it is possible. Only if:color: is not implemented in LineShape.

So, at the moment, you can simply use:
   color: [:each | ... ifTrue: [Color blue] ifFalse: [Color lightGray ] ]

Doru


On Tue, Oct 4, 2011 at 11:34 AM, Usman Bhatti <[hidden email]> wrote:
Hello,

We are working on the visualization of plugins in Mondrian and we are trying to create some custom visu. Question: Is there anyway we can color a few edges in Mondrian according to some condition? That is, we are trying to describe a condition for coloring edges according to the plugin they target as illustrated by the bold line in the script below:

view shape rectangle
       width:  [:p | p outgoingFAMIXEclipsePluginImport size] ;
       height:  [:p | p incomingFAMIXEclipsePluginImport size] ;
       
       if: [ p | p name includesSubString: 'uml'] fillColor: Color blue.
view nodes: (eclipsePluginGroup select: [:p | p name includesSubString: 'papyrus']).

view shape arrowedLine
       if: [ :i | i target name = 'org.eclipse.papyrus.core'] fillColor: Color red.
view edges: (MooseModel root allModels first allWithType: FAMIXEclipsePluginImport) from: #source to: #target.

view dominanceTreeLayout .
 
thanx in advance,
Usman & Nicolas

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




--
--

"Every thing has its own flow"


_______________________________________________
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: Selecting edges for coloring

abergel
In reply to this post by Tudor Girba-2
I just committed a new version of Mondrian. Comment: "Added if:color: if:width: on MOLineShape"

You can now write:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
view shape rectangle size: 10.
view nodes: (1 to: 10).

view shape line
        if: [:v | v > 2 ] color: Color blue;
        if: [:v | v > 2 ] width: 10.
view edgesTo: [ :v | v * 2 ]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

By the way, would it be better to have [ :node1 :node2 | ... ] for events and if:* selectors for lines?
where node1 and node2 are the two extremities? If only a one arg block is provided, then only node2 is provided.
This is a wished feature for long already.

Cheers,
Alexandre


On 4 Oct 2011, at 06:43, Tudor Girba wrote:

> Of course it is possible. Only if:color: is not implemented in LineShape.
>
> So, at the moment, you can simply use:
>    color: [:each | ... ifTrue: [Color blue] ifFalse: [Color lightGray ] ]
>
> Doru
>
>
> On Tue, Oct 4, 2011 at 11:34 AM, Usman Bhatti <[hidden email]> wrote:
> Hello,
>
> We are working on the visualization of plugins in Mondrian and we are trying to create some custom visu. Question: Is there anyway we can color a few edges in Mondrian according to some condition? That is, we are trying to describe a condition for coloring edges according to the plugin they target as illustrated by the bold line in the script below:
>
> view shape rectangle
>        width:  [:p | p outgoingFAMIXEclipsePluginImport size] ;
>        height:  [:p | p incomingFAMIXEclipsePluginImport size] ;
>        
>        if: [ p | p name includesSubString: 'uml'] fillColor: Color blue.
> view nodes: (eclipsePluginGroup select: [:p | p name includesSubString: 'papyrus']).
>
> view shape arrowedLine
>        if: [ :i | i target name = 'org.eclipse.papyrus.core'] fillColor: Color red.
> view edges: (MooseModel root allModels first allWithType: FAMIXEclipsePluginImport) from: #source to: #target.
>
> view dominanceTreeLayout .
>  
> thanx in advance,
> Usman & Nicolas
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
>
>
> --
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
>
> _______________________________________________
> 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: Selecting edges for coloring

Tudor Girba-2
Cool.

It just looks like the test for the Mondrian examples brakes now for some reason.

Cheers,
Doru


On 4 Oct 2011, at 13:58, Alexandre Bergel wrote:

> I just committed a new version of Mondrian. Comment: "Added if:color: if:width: on MOLineShape"
>
> You can now write:
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> view shape rectangle size: 10.
> view nodes: (1 to: 10).
>
> view shape line
> if: [:v | v > 2 ] color: Color blue;
> if: [:v | v > 2 ] width: 10.
> view edgesTo: [ :v | v * 2 ]
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> By the way, would it be better to have [ :node1 :node2 | ... ] for events and if:* selectors for lines?
> where node1 and node2 are the two extremities? If only a one arg block is provided, then only node2 is provided.
> This is a wished feature for long already.
>
> Cheers,
> Alexandre
>
>
> On 4 Oct 2011, at 06:43, Tudor Girba wrote:
>
>> Of course it is possible. Only if:color: is not implemented in LineShape.
>>
>> So, at the moment, you can simply use:
>>   color: [:each | ... ifTrue: [Color blue] ifFalse: [Color lightGray ] ]
>>
>> Doru
>>
>>
>> On Tue, Oct 4, 2011 at 11:34 AM, Usman Bhatti <[hidden email]> wrote:
>> Hello,
>>
>> We are working on the visualization of plugins in Mondrian and we are trying to create some custom visu. Question: Is there anyway we can color a few edges in Mondrian according to some condition? That is, we are trying to describe a condition for coloring edges according to the plugin they target as illustrated by the bold line in the script below:
>>
>> view shape rectangle
>>       width:  [:p | p outgoingFAMIXEclipsePluginImport size] ;
>>       height:  [:p | p incomingFAMIXEclipsePluginImport size] ;
>>
>>       if: [ p | p name includesSubString: 'uml'] fillColor: Color blue.
>> view nodes: (eclipsePluginGroup select: [:p | p name includesSubString: 'papyrus']).
>>
>> view shape arrowedLine
>>       if: [ :i | i target name = 'org.eclipse.papyrus.core'] fillColor: Color red.
>> view edges: (MooseModel root allModels first allWithType: FAMIXEclipsePluginImport) from: #source to: #target.
>>
>> view dominanceTreeLayout .
>>
>> thanx in advance,
>> Usman & Nicolas
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>>
>>
>>
>> --
>> --
>> www.tudorgirba.com
>>
>> "Every thing has its own flow"
>>
>> _______________________________________________
>> 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

--
www.tudorgirba.com

"To utilize feedback, you first have to acquire it."


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

Re: Selecting edges for coloring

abergel
Strange. I cannot reproduce this on my machine.
Apparently, it has something to do with the font, which is probably unrelated to this new change.
For some reason, the font family is returned as a number, instead of a string.

Can you confirm this error is not a random error (by running the build again?)

Alexandre


On 4 Oct 2011, at 17:38, Tudor Girba wrote:

> Cool.
>
> It just looks like the test for the Mondrian examples brakes now for some reason.
>
> Cheers,
> Doru
>
>
> On 4 Oct 2011, at 13:58, Alexandre Bergel wrote:
>
>> I just committed a new version of Mondrian. Comment: "Added if:color: if:width: on MOLineShape"
>>
>> You can now write:
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> view shape rectangle size: 10.
>> view nodes: (1 to: 10).
>>
>> view shape line
>> if: [:v | v > 2 ] color: Color blue;
>> if: [:v | v > 2 ] width: 10.
>> view edgesTo: [ :v | v * 2 ]
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>> By the way, would it be better to have [ :node1 :node2 | ... ] for events and if:* selectors for lines?
>> where node1 and node2 are the two extremities? If only a one arg block is provided, then only node2 is provided.
>> This is a wished feature for long already.
>>
>> Cheers,
>> Alexandre
>>
>>
>> On 4 Oct 2011, at 06:43, Tudor Girba wrote:
>>
>>> Of course it is possible. Only if:color: is not implemented in LineShape.
>>>
>>> So, at the moment, you can simply use:
>>>  color: [:each | ... ifTrue: [Color blue] ifFalse: [Color lightGray ] ]
>>>
>>> Doru
>>>
>>>
>>> On Tue, Oct 4, 2011 at 11:34 AM, Usman Bhatti <[hidden email]> wrote:
>>> Hello,
>>>
>>> We are working on the visualization of plugins in Mondrian and we are trying to create some custom visu. Question: Is there anyway we can color a few edges in Mondrian according to some condition? That is, we are trying to describe a condition for coloring edges according to the plugin they target as illustrated by the bold line in the script below:
>>>
>>> view shape rectangle
>>>      width:  [:p | p outgoingFAMIXEclipsePluginImport size] ;
>>>      height:  [:p | p incomingFAMIXEclipsePluginImport size] ;
>>>
>>>      if: [ p | p name includesSubString: 'uml'] fillColor: Color blue.
>>> view nodes: (eclipsePluginGroup select: [:p | p name includesSubString: 'papyrus']).
>>>
>>> view shape arrowedLine
>>>      if: [ :i | i target name = 'org.eclipse.papyrus.core'] fillColor: Color red.
>>> view edges: (MooseModel root allModels first allWithType: FAMIXEclipsePluginImport) from: #source to: #target.
>>>
>>> view dominanceTreeLayout .
>>>
>>> thanx in advance,
>>> Usman & Nicolas
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>
>>>
>>>
>>>
>>> --
>>> --
>>> www.tudorgirba.com
>>>
>>> "Every thing has its own flow"
>>>
>>> _______________________________________________
>>> 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
>
> --
> www.tudorgirba.com
>
> "To utilize feedback, you first have to acquire it."
>
>
> _______________________________________________
> 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