SanichKotikov / react-family-tree-example

FamilyTree demo
https://sanichkotikov.github.io/react-family-tree-example/
36 stars 24 forks source link

Issue in showing more than one wife. #2

Open ankushsingh opened 4 years ago

SanichKotikov commented 4 years ago

@ankushsingh hi. Current version of https://github.com/SanichKotikov/relatives-tree does not support multiple current spouses, but you can avoid that using 'divorced' type:

[
  {
    "id": "js2RsE5sr",
    "gender": "male",
    "parents": [],
    "siblings": [],
    "spouses": [
      { "id": "pdRwdtR54", "type": "married" },
      { "id": "tdRwdtR54", "type": "divorced" }
    ],
    "children": []
  },
  {
    "id": "pdRwdtR54",
    "gender": "female",
    "parents": [],
    "siblings": [],
    "spouses": [{ "id": "js2RsE5sr", "type": "married" }],
    "children": []
  },
  {
    "id": "tdRwdtR54",
    "gender": "female",
    "parents": [],
    "siblings": [],
    "spouses": [{ "id": "js2RsE5sr", "type": "divorced" }],
    "children": []
  }
]

Note: This might works with some bugs, especially if you try to render tree without parents.

ankushsingh commented 4 years ago

Yes you are right but this is not a good solution..as someone might have more than one spouse..1,2,3,..... And at the same time need to differentiate children from each spouse.