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 _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
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 <[hidden email]> 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 > [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 |
Hi, I know that objects: depends on fromObjects: and toObjects:, but this is still not enough. fromObjects: and toObjects: are meant to filter the resulting nodes. However, the first use case that we need to support when specifying edges is to provide the objects that you want to traverse. These objects are not necessarily part of the node objects. Consider this: a := FAMIXClass new name: 'A'. b := FAMIXClass new name: 'B'. i := FAMIXInheritance new superclass: a; subclass: b. view := RTMondrian new. view nodes: { a . b }. view edges object: i; connectFrom: #superclass to: #subclass. view With the current API, there is no way to make this work. We need to separate the specification of objects to be traversed from the filtering mechanism. Cheers, Doru On Tue, Sep 22, 2015 at 5:14 PM, Alexandre Bergel <[hidden email]> wrote: Hi Doru, _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Oh! Well spotted!
> a := FAMIXClass new name: 'A'. > b := FAMIXClass new name: 'B'. > i := FAMIXInheritance new > superclass: a; > subclass: b. > view := RTMondrian new. > view nodes: { a . b }. > view edges object: i; connectFrom: #superclass to: #subclass. > view > > With the current API, there is no way to make this work. We need to separate the specification of objects to be traversed from the filtering mechanism. What could it be then? Something like: -=-=-=-=-=-=-=-=-= view edges searchObjectFrom: i; connectFrom: #superclass to: #subclass -=-=-=-=-=-=-=-=-= I do not like the name #searchObjectFrom: but I do not see any better now. That should be easy to implement… Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
I would do it like this: view edges connect: aCollection from: [ ... ] to: [ ... ] Doru On Tue, Sep 22, 2015 at 10:41 PM, Alexandre Bergel <[hidden email]> wrote: Oh! Well spotted! _______________________________________________ Moose-dev mailing list [hidden email] https://www.iam.unibe.ch/mailman/listinfo/moose-dev |
Free forum by Nabble | Edit this page |