Hello,
> I have this script. The problem is that when there are duplicate entities on my canvas, edges are constructed for only one of them.Well.. This is a limitation of the Mondrian DLS. We had this issue before with Mondrian.
>
> |myView entity otherEntities |
> myView := ROMondrianViewBuilder new.
> entity := 1.
> otherEntities := #(2 2 3 3 4 4).
> myView shape rectangle withoutBorder.
> myView node: #entity forIt: [
> myView nodes: otherEntities forEach: [:each |
> myView shape label.
> myView node: each name].
> ].
> myView shape rectangle withoutBorder.
> myView node: #otherEntities forIt: [
> myView shape rectangle.
> myView node: entity
> ].
> myView shape line color: Color red; width: 1.
> myView edges: otherEntities from: #yourself to: entity.
>
> myView verticalLineLayout center.
> myView open.
Since nodes are looked up with edges:from:to:, then you should not have more than one candidate, else how the engine can guess which one to use?
You could do:
> The edges to all the entities can be drawn using this script which is a bit inelegant.
>
> ((myView raw elementsSuchThat: [:each | each model name includesSubString: 'other']) first elements)
> do: [:each | myView raw add: (myView buildEdgeFrom: each to: (myView lookup: entity))].
-=-=-=-=-=-=-=-=-=-=-=-=
|myView entity otherEntities nodes endNode lineShape |
myView := ROMondrianViewBuilder new.nodes := myView nodes: otherEntities forEach: [:each |
entity := 1.
otherEntities := #(2 2 3 3 4 4).
myView shape rectangle withoutBorder.
myView node: #entity forIt: [
myView shape label.endNode := myView node: entity
myView node: each name ].
].
myView shape rectangle withoutBorder.
myView node: #otherEntities forIt: [
myView shape rectangle.
].
myView raw addAll: (ROEdge linesFor: (nodes collect: [ :n | n -> endNode ])).
-=-=-=-=-=-=-=-=-=-=-=-=
myView verticalLineLayout center.
myView open.
I think I've answered to your question. Let me know if not.
> Question: how to deal with duplicate entities in Roassal?
It does not happen very often in practice. I think Jannik had such a problem.
> May be this occurs seldom in reality?
Cheers,
Alexandre
>
> regards,
> Usman
> _______________________________________________
> 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