I have this script. The problem is that when there are duplicate entities on my canvas, edges are constructed for only one of them.
|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.
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))].
Question: how to deal with duplicate entities in Roassal? May be this occurs seldom in reality?