Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing/misplaced children of remarried parents #24

Open
Phen-Ro opened this issue Jun 25, 2024 · 1 comment
Open

Missing/misplaced children of remarried parents #24

Phen-Ro opened this issue Jun 25, 2024 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@Phen-Ro
Copy link

Phen-Ro commented Jun 25, 2024

I found a rendering issue with situations regarding children of one side of a couple or children of a parent with multiple spouse. In all of the following examples, the rootId is "Mother".

This can be imagined as a story of a divorced couple with a child, where the mother remarries, and the child's father is removed from the family tree.

Standard unit, renders correctly:

[
  { "id": "Mother", "gender": "female", "spouses": [{ "id": "Father", "type": "divorced" }], "siblings": [], "parents": [], "children": [{ "id": "Child", "type": "blood" }] },
  { "id": "Father", "gender": "male", "spouses": [{ "id": "Mother", "type": "divorced" }], "siblings": [], "parents": [], "children": [{ "id": "Child", "type": "blood" }] },
  { "id": "Child", "gender": "male", "spouses": [], "siblings": [], "parents": [{ "id": "Mother", "type": "blood" }, { "id": "Father", "type": "blood" }], "children": [] }
]

Actual & Expected:

[Mother]---[Father]
         |
      [Child]

When the mother remarries, the child is now linked only to the father:

[
  { "id": "Mother", "gender": "female", "spouses": [{ "id": "Father", "type": "divorced" }, { "id": "Husband", "type": "married" }], "siblings": [], "parents": [], "children": [{ "id": "Child", "type": "blood" }] },
  { "id": "Father", "gender": "male", "spouses": [{ "id": "Mother", "type": "divorced" }], "siblings": [], "parents": [], "children": [{ "id": "Child", "type": "blood" }] },
  { "id": "Husband", "gender": "male", "spouses": [{ "id": "Mother", "type": "married" }], "siblings": [], "parents": [], "children": [] },
  { "id": "Child", "gender": "male", "spouses": [], "siblings": [], "parents": [{ "id": "Mother", "type": "blood" }, { "id": "Father", "type": "blood" }], "children": [] }
]

Actual:

[Father]---[Mother]---[Husband]
   |
[Child]

Expected:

[Father]---[Mother]---[Husband]
         |
      [Child]

If the father is removed, the child disappears:

[
  { "id": "Mother", "gender": "female", "spouses": [{ "id": "Husband", "type": "married" }], "siblings": [], "parents": [], "children": [{ "id": "Child", "type": "blood" }] },
  { "id": "Husband", "gender": "male", "spouses": [{ "id": "Mother", "type": "married" }], "siblings": [], "parents": [], "children": [] },
  { "id": "Child", "gender": "male", "spouses": [], "siblings": [], "parents": [{ "id": "Mother", "type": "blood" }], "children": [] }
]

Actual:

[Mother]---[Husband]

Expected:

[Mother]---[Husband]
   |
[Child]

When the 2nd husband is removed, the child reappears:

[
  { "id": "Mother", "gender": "female", "spouses": [{ "id": "Husband", "type": "married" }], "siblings": [], "parents": [], "children": [{ "id": "Child", "type": "blood" }] },
  { "id": "Child", "gender": "male", "spouses": [], "siblings": [], "parents": [{ "id": "Mother", "type": "blood" }], "children": [] }
]

Actual & Expected:

[Mother]
   |
[Child]

Here's a similar situation, the one that got me investigating this. This is a single mother of one who (re)marries and has another kid with the new guy:

[
  { "id": "Mother", "gender": "female", "spouses": [{ "id": "New Guy", "type": "married" }], "siblings": [], "parents": [], "children": [{ "id": "First Child", "type": "blood" }, { "id": "New Baby", "type": "blood" }] },
  { "id": "New Guy", "gender": "male", "spouses": [{ "id": "Mother", "type": "married" }], "siblings": [], "parents": [], "children": [{ "id": "New Baby", "type": "blood" }] },
  { "id": "First Child", "gender": "male", "spouses": [], "siblings": [{ "id": "New Baby", "type": "half" }], "parents": [{ "id": "Mother", "type": "blood" }], "children": [] },
  { "id": "New Baby", "gender": "female", "spouses": [], "siblings": [{ "id": "First Child", "type": "half" }], "parents": [{ "id": "Mother", "type": "blood" }, { "id": "New Guy", "type": "blood" }], "children": [] }
]

Actual:

[Mother]---[New Guy]
         |
     [New Baby]

Expected:

  [Mother]---[New Guy]
    |      |
 [Child] [New Baby]

Are my expectations off, or is the code?

If it is the code, I have a feeling it has to do with createChildUnitsFunc and/or getSpouseNodesFunc. I haven't been able to dig too far into it, but it seems that the way Units are created pushes out children that aren't the full offspring of the computed parents, and parents who are couples aren't offered to createChildUnits as potential single parents. Or something like that. I'll see if I can do more research, but no promises. This might be related to #12.

@SanichKotikov
Copy link
Owner

Hi. All the actual renders look as intended at the beginning. But this dosn't mean it can't be changed.

Yes, it's inside createFamilyFunc > getChildUnitsFunc > createChildUnitsFunc.

@SanichKotikov SanichKotikov added enhancement New feature or request question Further information is requested labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants