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

About the Family-tree model #767

Open
xgocn opened this issue Jan 16, 2025 · 3 comments
Open

About the Family-tree model #767

xgocn opened this issue Jan 16, 2025 · 3 comments

Comments

@xgocn
Copy link

xgocn commented Jan 16, 2025

I try to set a person node who married twice(two outsiders),the charts seems unreasonable

@xgocn
Copy link
Author

xgocn commented Jan 21, 2025

and I have some thought about family-tree:

Suggestions for Improving the Family-tree Model:

Optimization of Data Structure
A family tree is a model with continuously growing data and an infinite total set, making it unsuitable to store child node IDs within parent nodes. Instead, it is recommended to adopt a structure where child nodes carry parent node IDs. This design better aligns with the dynamic nature of family trees and supports modern data query technologies like GraphQL.

Handling Multiple Parent Relationships
In some cases, a child node may have multiple parent pairs (e.g., biological parents and adoptive parents). To accommodate this complexity, it is suggested to clearly designate a "primary parent" within the child node’s parent ID field. This allows for prioritization based on cultural or legal requirements.

Support for Multiple Spouses and Child-Parent Marriage Association
The current model does not adequately handle scenarios involving multiple marriages or concurrent spouses (e.g., polygamy or polyandry). It is recommended to extend the model to support multiple spouse relationships and ensure that children can be clearly associated with a specific spouse pair. For example, a field could be added to child nodes to explicitly link them to a particular marital relationship (e.g., marriage ID or spouse pair ID), ensuring accurate representation of complex family structures and bloodlines.

@dabeng
Copy link
Owner

dabeng commented Feb 9, 2025

Hi @xgocn I have created a Demo for you -- https://codepen.io/dabeng-the-styleful/pen/KwKPzYO. I think this demo can illustrate enough detailed teach points of Family Tree.

Image Image

@dabeng
Copy link
Owner

dabeng commented Feb 9, 2025

In fact, you can always append custom properties(like the "gender", "adopted", "ex" mentioned above) in your own datasource, then feel free to build up the family tree based on these ultra properties provided by yourself.

Image

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

No branches or pull requests

2 participants