Odd line in GenogramLayout Sample with specific data

Like several others I have been extending the Genogram sample for our project here. I was working with multiple partners and consanguineous relationships, when I noticed some strange behavior for the parent to child link. It had an unnecessary bend.

Unable to fix, I tried the same data on the Genogram Sample to see what I had done wrong, and I was able to get the same behavior, a strange bend in the line going into Father node:

Here is the data I used:

array = [
      { key: 0, n: "Father", s: "M", m:7, f:8, ux: 4, a: ["C", "F", "K"] },
      { key: 1, n: "Mother", s: "F", m:9, f:10, vir: [0, 5], a: ["B", "H", "K"] },
      { key: 5, n: "Mother's Spouse", s: "M", a: ["C"] },
      { key: 6, n: "Maternal Halfbrother", s: "M", m: 1, f: 5, a: ["C"] },
      { key: 4, n: "Claire", s: "F", m: 1, f: 0, a: ["C"] },
      { key: 12, n: "Baby", s: "F", m: 4, f: 0, a: ["C"] },
      { key: 13, n: "Baby2", s: "F", m: 4, f: 0, a: ["C"] },
      // ancestors
      { key: 7, n: "Paternal Grandfather", s: "M", m: -33, f: -32, ux: 8, a: ["A", "S"] },
      { key: 8, n: "Paternal Grandmother", s: "F", a: ["E", "S"] },

Some other oddities: If I remove the code block to straighten out positioning of only-child nodes, the bend on the line going into the Father node goes away;
If I specifically comment out this call:

var overlaps = layout.diagram.findObjectsIn(newbnds, function(x) { return x.part; }, function(p) { return p !== v.node; }, true);

the bend goes away.

Side note: while I was playing with the only-child positioning, I noticed that the actual bounds of the mnode changes following that findObjectsIn call:

  • Before findObjectsIn call:

    mnode.toString(): “Node#1411(-12)”
    v.node.toString(): “Node#1297(6)”
    mnode.actualBounds.toString(): “Rect(179.5,130.60000000000002,1,1)”
    v.node.actualBounds.toString() “Rect(168.5,251.20000000000005,63,70.6)”

  • And after:

    mnode.toString(): “Node#1411(-12)”
    v.node.toString(): “Node#1297(6)”
    mnode.actualBounds.toString(): “Rect(241.25,151.10000000000002,1,1)”
    v.node.actualBounds.toString(): “Rect(168.5,251.20000000000005,63,70.6)”

Here is a codepen demonstrating the issue (but the same effect can be seen by just using the sample page, breaking at setupDiagram and setting the array to the above data.

I should preface this by saying that the GenogramLayout does not do a good job when fathers marry their own children. But I’m not sure what would be good.

Yes, that is very odd. I’ll look into it.

Were you able to find out more information about this issue? Thank you.

I did look into it, but I didn’t discover the reason, and then I got swamped by more messages. Sorry. We’re intending to implement a completely new GenogramLayout. But that’s still off in the future.

I suppose you could set isRouting: false on your instance of GenogramLayout.

I hate to ask, but did we make any progress with the revamped Genogram layout?

BTW went live with the current one in Ohio and are discussing with other States.

Sorry, but not yet. We’ve been busy with getting out version 2.0, which should be coming out very soon.

So about that revamped Genogram layout…

Is it still being pursued?

Yes. Alas, after two separate attempts, I find that the results are still not good enough. Sorry. But I am certain we will try again.