BALKANGraph / FamilyTreeJS

Build family tree app with BALKAN FamilyTreeJS library. Family Tree also called a genealogy or a pedigree chart, is a chart representing family relationships in a conventional tree structure.
55 stars 16 forks source link

Bug #6

Closed marcelomoraesaguiar closed 1 year ago

marcelomoraesaguiar commented 2 years ago

I used the link https://code.balkan.app/family-tree-js/royal-family-tree#JS to reproduce the problem.

Data causing the problem: chart.load( [ { id:5, fid:3, mid:4, name:"te te", gender:"male" }, { id:3, pids:[4], fid:1, mid:2, name:"tui tui", gender:"male" }, { id:4, pids:[3], fid:1, mid:2, name:"toi toi", gender:"female" }, { id:1, pids:[2], name:"Cuquinha", gender:"male" }, { id:2, pids:[1], name:"Pipoquinha", gender:"female" } ]); error: Uncaught RangeError: Maximum call stack size exceeded


With the data below it works normally: chart.load( [ { id:5, fid:3, mid:4, name:"te te", gender:"male" }, { id:3, pids:[4], fid:1, mid:2, name:"tui tui", gender:"male" }, { id:4, pids:[3], name:"toi toi", gender:"female" }, { id:1, pids:[2], name:"Cuquinha", gender:"male" }, { id:2, pids:[1], name:"Pipoquinha", gender:"female" } ]);

Apparently the problem is the incest relationship between ids 3 and 4.

ZornitsaPesheva commented 2 years ago

As these two nodes are partners, they can't have the same parents: { id:3, pids:[4], fid:1, mid:2, name:"tui tui", gender:"male" }, { id:4, pids:[3], fid:1, mid:2, name:"toi toi", gender:"female" },

marcelomoraesaguiar commented 2 years ago

Too bad, because this sort of thing happens in the animal kingdom.

ZornitsaPesheva commented 2 years ago

You could try to use clinks for such connection. You can make them straight and change the styles.