Stef,
view edges: collection from: block1 to: block2
tries to create a edge for "each" element in the "collection" between the nodes that have the following entities behind: - block1 value: each - block2 value: each
I say it tries because if the nodes are not found, the edge will not get created.
Cheers, Doru
On 15 Jun 2011, at 20:40, Alexandre Bergel wrote:
The reason of "edges: nodes from: b1 to: b2" is to produce as much edges as there are nodes. For each node, an edge is created by evaluating b1 and b2 against the node.
what do you mean by "by evaluating b1 and b2 against the node"
The code: view edges: (1 to: 3) from: #yourself to: [ :v | v * v] is equivalent to: view edgesFromAssociations: {1 -> 1 . 1 -> 4 . 1 -> 9}
Alexandre
Now when I do that the original shapes (squares inside squares) that I have turn into a single one and I do not understand why.
The interaction in Mondrian works well, but I agree this is a bit rough to use. The following:
view interaction whenEnteringUpdateNode: [:node | view edges: {node} from: #yourself toAll: #sureReferencingClasses.]. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= means that when you enter the node, you replace everything under the node with some edges. You therefore discard the classes in it.
ah I could not get it then. Indeed the api sucks then
I propose two versions of your code. A long (and ugly one), and a much nicer one, but which does a slightly different thing:
thanks I will have a look.
The script draw edges between a packages and classes.
view interaction whenEnteringUpdateNode: [:node | view shape rectangle fillColor: Color orange; height: 7; width: 7. view nodes: node classes. view gridLayout gapSize: 2. view edges: {node} from: #yourself toAll: #sureReferencingClasses ]
whenLeavingUpdateNode: [:node | view shape rectangle fillColor: Color orange; height: 7; width: 7. view nodes: node classes. view gridLayout gapSize: 2 ] withLayoutUpdate: true. view nodes: model allPackages forEach: [:pack | view shape rectangle fillColor: Color orange; height: 7; width: 7. view nodes: pack classes. view gridLayout gapSize: 2. ].
view gridLayout.
This version draws edges between classes
view nodes: model allPackages forEach: [:pack | view shape rectangle fillColor: Color orange; height: 7; width: 7. view interaction whenEnteringUpdateNode: [:node | view edges: {node} from: #yourself toAll: #sureReferencingClasses ]. view nodes: pack classes. view gridLayout gapSize: 2. ].
view gridLayout.
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
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
-- www.tudorgirba.com
"From an abstract enough point of view, any two things are similar."