Mondrian subviews and interactions

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

Mondrian subviews and interactions

Ben Coman
I am trying to combine interactions with subviews in Mondrian but it is
not working as expected. This is with a fresh Moose 4.6 downloaded today
plus ConfigurationOfMondrian (AlexandreBergel.345) and [
ConfigurationOfMondrian project lastVersion load ].

As a test case, from ( World > Moose > Mondrian Easel ) I combine:
    Examples > interaction > variation in node size
    Examples > subviews > simple
to produce the following example:

----8<-----
view nodes: (1 to: 5) forEach:
[:each |
    view interaction strongHighlightWhenOver: [ :v | v ].
    view shape rectangle withText; size: 20.
    view nodes: (1 to: each).
    view gridLayout
].
----8<-----

However executing this in Mondrian Easel you will notice that (taking
for example the third group) hovering over small squares 1 & 2 does not
highlight these and hovering over small square 3 highlights the large
square rather than its small square.

I get my expected/required behaviour by modifying
MOAnnouncer>>registerForEvent: forNodes: updateShape: updateLayout:
to replace...
            domainNodes := (aBlockOrSymbol moValue: ann element model).
            nodes := ann viewRenderer nodeForDomainValues: domainNodes.
by...
            nodes := OrderedCollection new add: ann element ; yourself.

...but I don't know what else that breaks or another way to get my
required behaviour.
How should I proceed?

cheers, -ben
_______________________________________________
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 subviews and interactions

Ben Coman
Ben Coman wrote:

> I am trying to combine interactions with subviews in Mondrian but it
> is not working as expected. This is with a fresh Moose 4.6 downloaded
> today plus ConfigurationOfMondrian (AlexandreBergel.345) and [
> ConfigurationOfMondrian project lastVersion load ].
>
> As a test case, from ( World > Moose > Mondrian Easel ) I combine:
>    Examples > interaction > variation in node size
>    Examples > subviews > simple
> to produce the following example:
>
> ----8<-----
> view nodes: (1 to: 5) forEach:
> [:each |  
>     view interaction strongHighlightWhenOver: [ :v | v ].  
>     view shape rectangle withText; size: 20.  
>     view nodes: (1 to: each).  
>     view gridLayout
> ].
> ----8<-----
> However executing this in Mondrian Easel you will notice that (taking
> for example the third group) hovering over small squares 1 & 2 does
> not highlight these and hovering over small square 3 highlights the
> large square rather than its small square.
>
> I get my expected/required behaviour by modifying
> MOAnnouncer>>registerForEvent: forNodes: updateShape: updateLayout:
> to replace...
>            domainNodes := (aBlockOrSymbol moValue: ann element model).
>            nodes := ann viewRenderer nodeForDomainValues: domainNodes.
> by...
>            nodes := OrderedCollection new add: ann element ; yourself.
>
> ...but I don't know what else that breaks or another way to get my
> required behaviour. How should I proceed?
>
> cheers, -ben
> _______________________________________________
A few additional side comments...

1. Before the above change, on the Mondrian tests TestRunner produces 37
run, 37 passes
and after the above change also produces 37 run, 37 passes.

2. Two other interesting variations of my test case that I had played with:
----8<-----
"This highlights the large square when hovering over it but turns off
when hovering over the small squares."
view interaction strongHighlightWhenOver: [ :v | v ].
view nodes: (1 to: 5) forEach:
[:each |
    view shape rectangle withText; size: 20.
    view nodes: (1 to: each).
    view gridLayout
].
----8<-----
"This highlights the large square when hovering over it and also when
hovering over the small squares."
view interaction strongHighlightWhenOver: [ :v | v ].
view nodes: (1 to: 5) forEach:
[:each |
    view interaction forward.
    view shape rectangle withText; size: 20.
    view nodes: (1 to: each).
    view gridLayout
].
----8<-----

3. If in my examples above, instead of...
    view interaction strongHighlightWhenOver: [ :v | v ]
you debug with...
    view interaction strongHighlightWhenOver: [ :v | self halt. v ]
then tracing through the line
    nodes := ann viewRenderer nodeForDomainValues: domainNodes.
produces 'MessageNotUnderstood: receiver of "nodeForDomainValues:" is nil'
where 'ann viewRenderer' returns nil.

cheers, -ben
_______________________________________________
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 subviews and interactions - method variable not initialised

Ben Coman
In reply to this post by Ben Coman
Just something else I bumped into....
MOAnnouncer>>registerForEvent: forNodes: updateNode: updateLayout:
seems to reference method variable 'domainNode' prior to it being set


Ben Coman wrote:

> I am trying to combine interactions with subviews in Mondrian but it
> is not working as expected. This is with a fresh Moose 4.6 downloaded
> today plus ConfigurationOfMondrian (AlexandreBergel.345) and [
> ConfigurationOfMondrian project lastVersion load ].
>
> As a test case, from ( World > Moose > Mondrian Easel ) I combine:
>    Examples > interaction > variation in node size
>    Examples > subviews > simple
> to produce the following example:
>
> ----8<----- view nodes: (1 to: 5) forEach: [:each |    view
> interaction strongHighlightWhenOver: [ :v | v ].    view shape
> rectangle withText; size: 20.    view nodes: (1 to: each).    view
> gridLayout ]. ----8<-----
> However executing this in Mondrian Easel you will notice that (taking
> for example the third group) hovering over small squares 1 & 2 does
> not highlight these and hovering over small square 3 highlights the
> large square rather than its small square.
>
> I get my expected/required behaviour by modifying
> MOAnnouncer>>registerForEvent: forNodes: updateShape: updateLayout:
> to replace...
>            domainNodes := (aBlockOrSymbol moValue: ann element model).
>            nodes := ann viewRenderer nodeForDomainValues: domainNodes.
> by...
>            nodes := OrderedCollection new add: ann element ; yourself.
>
> ...but I don't know what else that breaks or another way to get my
> required behaviour. How should I proceed?
>
> cheers, -ben
> _______________________________________________
> 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 subviews and interactions

Ben Coman
In reply to this post by Ben Coman
Ben Coman wrote:

> I am trying to combine interactions with subviews in Mondrian but it
> is not working as expected. This is with a fresh Moose 4.6 downloaded
> today plus ConfigurationOfMondrian (AlexandreBergel.345) and [
> ConfigurationOfMondrian project lastVersion load ].
>
> As a test case, from ( World > Moose > Mondrian Easel ) I combine:
>    Examples > interaction > variation in node size
>    Examples > subviews > simple
> to produce the following example:
>
> ----8<----- view nodes: (1 to: 5) forEach: [:each |    view
> interaction strongHighlightWhenOver: [ :v | v ].    view shape
> rectangle withText; size: 20.    view nodes: (1 to: each).    view
> gridLayout ]. ----8<-----
> However executing this in Mondrian Easel you will notice that (taking
> for example the third group) hovering over small squares 1 & 2 does
> not highlight these and hovering over small square 3 highlights the
> large square rather than its small square.
>
> I get my expected/required behaviour by modifying
> MOAnnouncer>>registerForEvent: forNodes: updateShape: updateLayout:
> to replace...
>            domainNodes := (aBlockOrSymbol moValue: ann element model).
>            nodes := ann viewRenderer nodeForDomainValues: domainNodes.
> by...
>            nodes := OrderedCollection new add: ann element ; yourself.
>
> ...but I don't know what else that breaks or another way to get my
> required behaviour. How should I proceed?
>
> cheers, -ben
An architectural question regarding the five methods starting
MOAnnouncer>>registerForEvent...
what is the difference in purpose between these with following in their
method name...
updateNode
updateShape
updateGraphNode

cheers, -ben

_______________________________________________
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 subviews and interactions

abergel
In reply to this post by Ben Coman
hi Ben,

I believe the following script in Roassal does what you expect:

-=-=-=-=-=-=-=-=-=-=-=-=
| view |
view := ROMondrianViewBuilder new.
view nodes: (1 to: 5) forEach: [:each |    
        view interaction highlightNodesWhenOver: [ :node | {node} ].    
        view shape rectangle withText; size: 20.    
        view nodes: (1 to: each).    
        view gridLayout ].
view open
-=-=-=-=-=-=-=-=-=-=-=-=

Cheers,
Alexandre

On 8 Apr 2012, at 12:41, Ben Coman wrote:

> I am trying to combine interactions with subviews in Mondrian but it is not working as expected. This is with a fresh Moose 4.6 downloaded today plus ConfigurationOfMondrian (AlexandreBergel.345) and [ ConfigurationOfMondrian project lastVersion load ].
>
> As a test case, from ( World > Moose > Mondrian Easel ) I combine:
>   Examples > interaction > variation in node size
>   Examples > subviews > simple
> to produce the following example:
>
> ----8<----- view nodes: (1 to: 5) forEach: [:each |    view interaction strongHighlightWhenOver: [ :v | v ].    view shape rectangle withText; size: 20.    view nodes: (1 to: each).    view gridLayout ]. ----8<-----
> However executing this in Mondrian Easel you will notice that (taking for example the third group) hovering over small squares 1 & 2 does not highlight these and hovering over small square 3 highlights the large square rather than its small square.
>
> I get my expected/required behaviour by modifying MOAnnouncer>>registerForEvent: forNodes: updateShape: updateLayout:
> to replace...
>           domainNodes := (aBlockOrSymbol moValue: ann element model).
>           nodes := ann viewRenderer nodeForDomainValues: domainNodes.
> by...
>           nodes := OrderedCollection new add: ann element ; yourself.
>
> ...but I don't know what else that breaks or another way to get my required behaviour. How should I proceed?
>
> cheers, -ben
> _______________________________________________
> 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