dTree icon indicating copy to clipboard operation
dTree copied to clipboard

How to add parent of a node?

Open kensplanet opened this issue 5 years ago • 5 comments

var node = [{
   class: "sexM"
   marriages: (2) [{…}, {…}]
   name: "Satoshi Nakomoto",
   parent: // Can I add this?
}]

dTree.init(node, FamilyTreeHelper.config);

kensplanet avatar Apr 28 '19 04:04 kensplanet

In short the tree is always defined top down, define from the first parent(s) and then all of their children and grand children.

ErikGartner avatar Apr 28 '19 20:04 ErikGartner

Children are definitely needed. But I think adding a parent can also be useful since I am interested in knowing both the ancestors and the descendants.

For example, I currently get this tree when I search for King Gustaf VI Adolf,

image

But when I search for Prince Gustaf Adolf, Duke of Västerbotten, I only get a tree like below,

image

I am also interested in knowing the ancestors of this person.

kensplanet avatar Apr 30 '19 19:04 kensplanet

@ErikGartner thank you so much for the awesome library.

I was using the library in one of my projects. I was wondering if I could add the parents of a spouse? Is there any way?

saqibameen avatar Sep 12 '19 06:09 saqibameen

Also looking for a way to achieve this. Will try to give it a go myself - see how it goes.

al3ks avatar Dec 26 '20 00:12 al3ks

Anyone has successfully achieved this ?

qanuj avatar Jan 27 '21 10:01 qanuj