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

Duplicate nodes in the family tree #10

Closed frankbracq closed 3 years ago

frankbracq commented 3 years ago

Hello Sanich

I'm getting duplicate nodes with attached family Json data. Third generation descendants of brother and sister got married and this translate into tree_0.png.

I'm wondering if we could get version without duplicates like in tree_2.png?

Thank you in advance for your reply

tree_0

tree_0

tree_2

tree_2

Family Json data:

[ { "id": "1d15387b-15b1-493e-b43e-ed82d8acdb3a", "email": "fbracq@eventstory.live", "root": "0", "fname": null, "lname": null, "full_name": null, "birth": null, "death": null, "gender": null, "biography": null, "albums": null, "changed": "1610716680", "parents": [], "children": [], "siblings": [], "spouses": [], "tags": [], "images": [] }, { "id": "a26c58ff-d748-4398-9f91-0f3281fb903a", "email": "fran-ois.gochon@no.email", "root": "0", "fname": "François", "lname": "Gochon", "full_name": "François Gochon", "birth": null, "death": null, "gender": "male", "biography": "lorem ipsum...", "albums": null, "changed": "1616687079", "parents": [], "children": [ { "id": "8d5599ba-4086-4a6d-9bf5-339164b4c2c2", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "14fee90c-5835-4517-a90c-6914d6bd872d", "type": "married" } ], "tags": [], "images": [] }, { "id": "14fee90c-5835-4517-a90c-6914d6bd872d", "email": "marie.le-roy@no.email", "root": "0", "fname": "Marie", "lname": "Le Roy", "full_name": "Marie Le Roy", "birth": null, "death": null, "gender": "female", "biography": "lorem ipsum...", "albums": null, "changed": "1616687079", "parents": [], "children": [ { "id": "8d5599ba-4086-4a6d-9bf5-339164b4c2c2", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "a26c58ff-d748-4398-9f91-0f3281fb903a", "type": "married" } ], "tags": [], "images": [] }, { "id": "8d5599ba-4086-4a6d-9bf5-339164b4c2c2", "email": "pierre.gochon@no.email", "root": "1", "fname": "Pierre", "lname": "Gochon", "full_name": "Pierre Gochon", "birth": null, "death": null, "gender": "male", "biography": "lorem ipsum...", "albums": null, "changed": "1616687982", "parents": [ { "id": "a26c58ff-d748-4398-9f91-0f3281fb903a", "type": "blood" }, { "id": "14fee90c-5835-4517-a90c-6914d6bd872d", "type": "blood" } ], "children": [ { "id": "07a936be-80f5-4c09-9ebb-694d688b2449", "type": "blood" }, { "id": "d539f160-3971-4b3d-baf7-b93096862d6b", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "a53e9be4-8278-4659-a1f1-dbffb4ef8642", "type": "married" } ], "tags": [], "images": [] }, { "id": "a53e9be4-8278-4659-a1f1-dbffb4ef8642", "email": "madeleine.brissart@no.email", "root": "0", "fname": "Madeleine", "lname": "Brissart", "full_name": "Madeleine Brissart", "birth": null, "death": null, "gender": "female", "biography": "lorem ipsum...", "albums": null, "changed": "1616687151", "parents": [], "children": [ { "id": "07a936be-80f5-4c09-9ebb-694d688b2449", "type": "blood" }, { "id": "d539f160-3971-4b3d-baf7-b93096862d6b", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "8d5599ba-4086-4a6d-9bf5-339164b4c2c2", "type": "married" } ], "tags": [], "images": [] }, { "id": "43ade73c-61a2-44b8-a4db-1c281fdecb49", "email": "jean.clement1@no.email", "root": "0", "fname": "Jean", "lname": "Clement", "full_name": "Jean Clement", "birth": null, "death": null, "gender": "male", "biography": null, "albums": null, "changed": "1616687213", "parents": [], "children": [ { "id": "d24320ba-2ed5-48dc-9845-11951369bfc8", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "d539f160-3971-4b3d-baf7-b93096862d6b", "type": "married" } ], "tags": [], "images": [] }, { "id": "d539f160-3971-4b3d-baf7-b93096862d6b", "email": "marie.gochon@no.email", "root": "0", "fname": "Marie", "lname": "Gochon", "full_name": "Marie Gochon", "birth": null, "death": null, "gender": "female", "biography": "lorem ipsum...", "albums": null, "changed": "1616687213", "parents": [ { "id": "8d5599ba-4086-4a6d-9bf5-339164b4c2c2", "type": "blood" }, { "id": "a53e9be4-8278-4659-a1f1-dbffb4ef8642", "type": "blood" } ], "children": [ { "id": "d24320ba-2ed5-48dc-9845-11951369bfc8", "type": "blood" } ], "siblings": [ { "id": "07a936be-80f5-4c09-9ebb-694d688b2449", "type": "blood" } ], "spouses": [ { "id": "43ade73c-61a2-44b8-a4db-1c281fdecb49", "type": "married" } ], "tags": [], "images": [] }, { "id": "d24320ba-2ed5-48dc-9845-11951369bfc8", "email": "marie-therese.clement1@no.email", "root": "0", "fname": "Marie Therese", "lname": "Clement", "full_name": "Marie Therese Clement", "birth": null, "death": null, "gender": "female", "biography": "lorem ipsum...", "albums": null, "changed": "1616687286", "parents": [ { "id": "43ade73c-61a2-44b8-a4db-1c281fdecb49", "type": "blood" }, { "id": "d539f160-3971-4b3d-baf7-b93096862d6b", "type": "blood" } ], "children": [ { "id": "9fbf8084-2eb6-4d54-b22d-fd4402574224", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "baf11800-e3bd-409c-9e98-9a213394026a", "type": "married" } ], "tags": [], "images": [] }, { "id": "baf11800-e3bd-409c-9e98-9a213394026a", "email": "valentin.carniaux1@no.email", "root": "0", "fname": "Valentin", "lname": "Carniaux", "full_name": "Valentin Carniaux", "birth": null, "death": null, "gender": "male", "biography": null, "albums": null, "changed": "1616687286", "parents": [], "children": [ { "id": "9fbf8084-2eb6-4d54-b22d-fd4402574224", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "d24320ba-2ed5-48dc-9845-11951369bfc8", "type": "married" } ], "tags": [], "images": [] }, { "id": "9fbf8084-2eb6-4d54-b22d-fd4402574224", "email": "hubert.carniaux1@no.email", "root": "0", "fname": "Hubert", "lname": "Carniaux", "full_name": "Hubert Carniaux", "birth": null, "death": null, "gender": "male", "biography": "lorem ipsum...", "albums": null, "changed": "1616687370", "parents": [ { "id": "baf11800-e3bd-409c-9e98-9a213394026a", "type": "blood" }, { "id": "d24320ba-2ed5-48dc-9845-11951369bfc8", "type": "blood" } ], "children": [ { "id": "8bc11dae-a85f-4ded-83a0-8d6afcb425a8", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "a6bbcaee-906b-4fed-9e98-0cf561e8daf4", "type": "married" } ], "tags": [], "images": [] }, { "id": "a6bbcaee-906b-4fed-9e98-0cf561e8daf4", "email": "marie-anne.pietton1@no.email", "root": "0", "fname": "Marie Anne", "lname": "Pietton", "full_name": "Marie Anne Pietton", "birth": null, "death": null, "gender": "female", "biography": null, "albums": null, "changed": "1616687370", "parents": [], "children": [ { "id": "8bc11dae-a85f-4ded-83a0-8d6afcb425a8", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "9fbf8084-2eb6-4d54-b22d-fd4402574224", "type": "married" } ], "tags": [], "images": [] }, { "id": "8bc11dae-a85f-4ded-83a0-8d6afcb425a8", "email": "marie-anne-.carniaux@no.email", "root": "0", "fname": "Marie Anne ", "lname": "Carniaux", "full_name": "Marie Anne Carniaux", "birth": null, "death": null, "gender": "female", "biography": "lorem ipsum...", "albums": null, "changed": "1616687370", "parents": [ { "id": "9fbf8084-2eb6-4d54-b22d-fd4402574224", "type": "blood" }, { "id": "a6bbcaee-906b-4fed-9e98-0cf561e8daf4", "type": "blood" } ], "children": [ { "id": "7a1c7a7e-9fa7-4727-8731-301bab60572e", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "9863cb1e-1d39-4d1d-bbea-74113ab12853", "type": "married" } ], "tags": [], "images": [] }, { "id": "9863cb1e-1d39-4d1d-bbea-74113ab12853", "email": "antoine.proisy1@no.email", "root": "0", "fname": "Antoine", "lname": "Proisy", "full_name": "Antoine Proisy", "birth": null, "death": null, "gender": "male", "biography": null, "albums": null, "changed": "1616687370", "parents": [], "children": [ { "id": "7a1c7a7e-9fa7-4727-8731-301bab60572e", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "8bc11dae-a85f-4ded-83a0-8d6afcb425a8", "type": "married" } ], "tags": [], "images": [] }, { "id": "7a1c7a7e-9fa7-4727-8731-301bab60572e", "email": "cyprien.proisy1@no.email", "root": "0", "fname": "Cyprien", "lname": "Proisy", "full_name": "Cyprien Proisy", "birth": null, "death": null, "gender": "male", "biography": "lorem ipsum...", "albums": null, "changed": "1616687911", "parents": [ { "id": "9863cb1e-1d39-4d1d-bbea-74113ab12853", "type": "blood" }, { "id": "8bc11dae-a85f-4ded-83a0-8d6afcb425a8", "type": "blood" } ], "children": [], "siblings": [], "spouses": [ { "id": "e24e3195-42b4-49b8-8a4b-fe0e007e3324", "type": "married" } ], "tags": [], "images": [] }, { "id": "e24e3195-42b4-49b8-8a4b-fe0e007e3324", "email": "josephine.gochon1@no.email", "root": "0", "fname": "Josephine", "lname": "Gochon", "full_name": "Josephine Gochon", "birth": null, "death": null, "gender": "female", "biography": "lorem ipsum...", "albums": null, "changed": "1616581783", "parents": [ { "id": "8cd864a4-2a61-4d79-9134-a1592c48c922", "type": "blood" }, { "id": "d70fa6ca-2b54-4a99-96e5-efd3d800dcf0", "type": "blood" } ], "children": [], "siblings": [], "spouses": [ { "id": "7a1c7a7e-9fa7-4727-8731-301bab60572e", "type": "married" } ], "tags": [], "images": [] }, { "id": "07a936be-80f5-4c09-9ebb-694d688b2449", "email": "gerard.gochon@no.email", "root": "0", "fname": "Gerard", "lname": "Gochon", "full_name": "Gerard Gochon", "birth": null, "death": null, "gender": "male", "biography": "lorem ipsum...", "albums": null, "changed": "1616687151", "parents": [ { "id": "8d5599ba-4086-4a6d-9bf5-339164b4c2c2", "type": "blood" }, { "id": "a53e9be4-8278-4659-a1f1-dbffb4ef8642", "type": "blood" } ], "children": [ { "id": "e848d300-2bbe-4052-8e22-adb2030e07df", "type": "blood" } ], "siblings": [ { "id": "d539f160-3971-4b3d-baf7-b93096862d6b", "type": "blood" } ], "spouses": [ { "id": "7c8771e6-cb42-4a24-96fc-ab074d2ddf08", "type": "married" } ], "tags": [], "images": [] }, { "id": "7c8771e6-cb42-4a24-96fc-ab074d2ddf08", "email": "marie-.lantier@no.email", "root": "0", "fname": "Marie ", "lname": "Lantier", "full_name": "Marie Lantier", "birth": null, "death": null, "gender": "female", "biography": null, "albums": null, "changed": "1616686879", "parents": [], "children": [ { "id": "e848d300-2bbe-4052-8e22-adb2030e07df", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "07a936be-80f5-4c09-9ebb-694d688b2449", "type": "married" } ], "tags": [], "images": [] }, { "id": "e848d300-2bbe-4052-8e22-adb2030e07df", "email": "nicolas.gauchon@no.email", "root": "0", "fname": "Nicolas", "lname": "Gochon", "full_name": "Nicolas Gochon", "birth": null, "death": null, "gender": "male", "biography": "lorem ipsum...", "albums": null, "changed": "1616685014", "parents": [ { "id": "07a936be-80f5-4c09-9ebb-694d688b2449", "type": "blood" }, { "id": "7c8771e6-cb42-4a24-96fc-ab074d2ddf08", "type": "blood" } ], "children": [ { "id": "8cd864a4-2a61-4d79-9134-a1592c48c922", "type": "blood" } ], "siblings": [], "spouses": [], "tags": [], "images": [] }, { "id": "8cd864a4-2a61-4d79-9134-a1592c48c922", "email": "jean-baptiste.gochon1@no.email", "root": "0", "fname": "Jean-Baptiste", "lname": "Gochon", "full_name": "Jean-Baptiste Gochon", "birth": null, "death": null, "gender": "male", "biography": "lorem ipsum...", "albums": null, "changed": "1616685014", "parents": [ { "id": "e848d300-2bbe-4052-8e22-adb2030e07df", "type": "blood" } ], "children": [ { "id": "e24e3195-42b4-49b8-8a4b-fe0e007e3324", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "d70fa6ca-2b54-4a99-96e5-efd3d800dcf0", "type": "married" } ], "tags": [], "images": [] }, { "id": "d70fa6ca-2b54-4a99-96e5-efd3d800dcf0", "email": "catherine.tricot1@no.email", "root": "0", "fname": "Catherine", "lname": "Tricot", "full_name": "Catherine Tricot", "birth": null, "death": null, "gender": "female", "biography": null, "albums": null, "changed": "1616581992", "parents": [], "children": [ { "id": "e24e3195-42b4-49b8-8a4b-fe0e007e3324", "type": "blood" } ], "siblings": [], "spouses": [ { "id": "8cd864a4-2a61-4d79-9134-a1592c48c922", "type": "married" } ], "tags": [], "images": [] } ]

SanichKotikov commented 3 years ago

The library does not support circular relation.

frankbracq commented 3 years ago

Good to know! Thanks