Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add parent of a node? #89

Open
kensplanet opened this issue Apr 28, 2019 · 5 comments
Open

How to add parent of a node? #89

kensplanet opened this issue Apr 28, 2019 · 5 comments
Labels

Comments

@kensplanet
Copy link

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

dTree.init(node, FamilyTreeHelper.config);

@ErikGartner
Copy link
Owner

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

@kensplanet
Copy link
Author

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.

@saqibameen
Copy link

@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?

@al3ks
Copy link

al3ks commented Dec 26, 2020

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

@qanuj
Copy link

qanuj commented Jan 27, 2021

Anyone has successfully achieved this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants