Hi Doru,
You are raising an interesting topic here. #objects: set the from objects and to the objects. These can be manually set using: #fromObjects: and #toObjects:
If you wish to restrict the target or the source, then you need to use #fromObjects: or #toObjects:
Here are some examples:
-=-=-=-=-=-=-=-=-=
view := RTMondrian new.
view shape label.
view nodes: { 1 . 2 }.
view edges fromObjects: { 1 }; connectTo: [ :x | x + 1 ].
view
-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=
view := RTMondrian new.
view shape label.
view nodes: { 1 . 2 }.
view edges toObjects: { 1 }; connectFrom: [ :x | x + 1 ].
view
-=-=-=-=-=-=-=-=-=
However, one part that is clearly insufficient is the way nodes are lookedup along the nesting hierarchy. Consider:
-=-=-=-=-=-=-=-=-=
view := RTMondrian new.
view nodes: { 1 . 2 } forEach: [ :aValue |
view nodes: {1 . 2}.
view edges toObjects: { 1 }; connectFrom: [ :x | x + 1 ].
view layout verticalLine ].
view
-=-=-=-=-=-=-=-=-=
This does not gives a meaningful result. However, I could not find any representative example of this beside toy examples with numbers.
Cheers,
Alexandre
> _______________________________________________
> On Sep 20, 2015, at 5:39 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
>
> Hi,
>
> Consider this script:
>
> view := RTMondrian new.
> view shape label.
> view nodes: { 1 . 2 }.
> view edges objects: { 1 }; connectFrom: [ :x | x + 1 ].
> view
>
> The expectation is to create 2 nodes and an edge between them. However, the script does not create any edges.
>
> The reason is that the collection that is passed to objects: is also used to search the source and target nodes. This is a problem, because this type of filtering is rarely needed.
>
> I believe we should keep objects: to only denote the input set of objects that need to be iterated in order to produce the edges. And, if needed, we can add another selector specifically only for filtering (like restrictEdgeSourceToObjects: / restrictEdgeTargetToObjects: ).
>
> What do you think?
>
> Cheers,
> Doru
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
> Moose-dev mailing list
> Moose-dev@iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev