I think you’re not setting up the Nodes and Links correctly. Notice that in the Genogram sample, there’s a setupDiagram
function that you call to create the appropriate Nodes and Links.
I tried the following family:
setupDiagram(myDiagram, [
{ key: 0, n: "husband", s: "M", ux: [1, 2, 3] },
{ key: 1, n: "wife 1", s: "F" },
{ key: 2, n: "wife 2", s: "F" },
{ key: 3, n: "wife 3", s: "F" },
{ key: 11, n: "child 1 1", s: "M", f: 0, m: 1 },
{ key: 12, n: "child 1 2", s: "M", f: 0, m: 1 },
{ key: 21, n: "child 2 1", s: "F", f: 0, m: 2 },
{ key: 22, n: "child 2 2", s: "F", f: 0, m: 2 },
{ key: 31, n: "child 3 1", s: "F", f: 0, m: 3 },
{ key: 32, n: "child 3 2", s: "M", f: 0, m: 3 }
]);
I got back these results:
Oh, wait – there was one change I made. I set the Link.routing on the Marriage Links to be AvoidsNodes:
myDiagram.linkTemplateMap.add("Marriage", // for marriage relationships
$(go.Link, { selectable: false, routing: go.Link.AvoidsNodes },
$(go.Shape, { strokeWidth: 2, stroke: "darkgreen" })
));
If I move one of the parent nodes around, I can see that the relationships are maintained visually. (But a new layout is not performed.)