I’m developing twin and identical twin nodes in VueJS based Genogram.
I read a topic in this forum (Mixing orthogonal and normal linking) and tried implementing it. It works perfectly for twin nodes, but not for identical twin nodes.
For some reason you haven’t set it up so that GenogramLayout recognizes that Twin C and Twin D are children of Bob and Barbara. That’s why they are in the wrong layer.
How did you want identical twins to be drawn? If it’s just a different appearance for the horizontal link connecting the label nodes of the parent links, that can be set when you add that unmodeled Link.
The horizontal link between two twin nodes are generated correctly but the auto layout doesn’t work (shown in my first post) when I run setup identical twin function, so I have to rearrange it manually. That function runs after marriages and parents setup.
This is the original genogram with no identical twin, perfect layout.
There’s something wrong with how you are adding the identical twin Link, but I cannot tell what from the limited information you have given. Your code for adding a Twin Link looks OK to me, but perhaps you are calling it wrong.
If you set up your diagram as in the last screenshot, and then you execute the code to add a Twin Link between C & D, what happens?
If you set up your diagram as in the last screenshot, and then you execute the code to add a Twin Link between C & D, what happens?
The identical twin link is properly created like second image.
Let’s put aside the auto layout problem, I have another question about identical twin.
I created a checkbox button form to enable identical twin.
I’m trying to remove this link but I can’t since it’s not stored in nodeDataArray nor linkDataArray.
Could you help me to solve this problem ? Thank you very much.
At the time the checkbox is cleared or the RemoveTwin button is pressed, are there two or more nodes selected, so that you know which Nodes are supposed to be twins/triplets/quadruplets/quintuplets?
For each such Node, find its parent Link and get its label Node (if any). Any Twin Link will be connected with such label Nodes.
var T1 = ...
var T2 = ...
if (!T1 || !T2) return;
var TPL1 = T1.findTreeParentLink();
var TPL2 = T2.findTreeParentLink();
if (!TPL1 || !TPL2) return;
var TLN1 = TPL1.labelNodes.first();
var TLN2 = TPL2.labelNodes.first();
if (!TLN1 || !TLN2) return;
var TL = TLN1.findLinksBetween(TLN2).first();
if (TL) {
myDiagram.commit(function(diag) {
diag.remove(TL);
}, "removed Twin Link");
}