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.
50 stars 16 forks source link

Not showing Parents if mid and fid are not linked together using pid #38

Closed azlanali076 closed 6 months ago

azlanali076 commented 1 year ago

If we have a node of id 1 and it has a mother id 2 and father id 3 we are creating nodes like

[
{
id: 1,
name: 'Child',
mid: 2,
fid: 3
},
{
id: 2,
name: 'Mother'
},
{
id: 3,
name: 'Father'
}
]

upon clicking on child node in tree to expand parents its crashing the whole tree

ZornitsaPesheva commented 1 year ago

This is what you should have:

[
        {
            id: 1,
            name: 'Child',
            mid: 2,
            fid: 3
        },
        {
            id: 2,
            pids: [3],
            name: 'Mother'
        },
        {
            id: 3,
            pids: [2],
            name: 'Father'
        }
]
azlanali076 commented 1 year ago

@ZornitsaPesheva i know but what if for some reason i cannot pass pids

ZornitsaPesheva commented 1 year ago

You should pass pids to the family tree js. It cannot work without pids.