SanichKotikov / relatives-tree

A tiny library for calculating specific JSON data to family tree nodes and connectors 🌳
https://sanichkotikov.github.io/react-family-tree-example/
MIT License
45 stars 21 forks source link

2nd wife child not showing in tree when wife is deleted #12

Open harishdev22531 opened 3 years ago

harishdev22531 commented 3 years ago

Hi,

I have an problem to show child node on tree.

Here is my Json:

[ { "id": 1316, "Name": "Harish Kumar1", "Sex": "Male", "children": [], "parents": [ { "id": 1517, "type": "blood" }, { "id": 1518, "type": "blood" } ], "siblings": [], "spouses": [] }, { "id": 1517, "Name": "Father", "Sex": "Male", "children": [ { "id": 1316, "type": "blood" } ], "parents": [ { "id": 1519, "type": "blood" }, { "id": 1520, "type": "blood" } ], "siblings": [], "spouses": [ { "id": 1518, "type": "married" } ] }, { "id": 1518, "Name": "Mother", "Sex": "Female", "children": [ { "id": 1316, "type": "blood" } ], "parents": [], "siblings": [], "spouses": [ { "id": 1517, "type": "married" } ] }, { "id": 1519, "Name": "GF", "Sex": "Male", "children": [ { "id": 1517, "type": "blood" }, { "id": 1522, "type": "blood" } ], "parents": [], "siblings": [], "spouses": [ { "id": 1520, "type": "blood" } ] }, { "id": 1520, "Name": "GM", "Sex": "Female", "children": [ { "id": 1517, "type": "blood" } ], "parents": [], "siblings": [], "spouses": [ { "id": 1519, "type": "married" } ] }, { "id": 1522, "Name": "Uncle", "children": [], "parents": [ { "id": 1519, "type": "blood" } ], "siblings": [], "spouses": [] } ]

Node with name Uncle is not showing on tree under node GF.

Can anyone help me with this? OnPaste 20210817-141746

SanichKotikov commented 2 months ago

The library has some limitations, so everything looks as expected. If rootId is 1519 or 1520 then it related to https://github.com/SanichKotikov/relatives-tree/issues/24