Open curtisdelicata opened 6 years ago
Did you find any way to add parents of spouses?
Sorry, I don't have the time to work on new features for dTree. Feel free to make a pull request if you have a good solution :)
@curtisdelicata @aroraank Did you find any solution?
No, unfortunately I don't have time right now to add new features to dTree. If you implement the feature be sure to make a pull request!
@ErikGartner can you give me some direction in implementing this feature?
The problem with implementing parent support is that dTree uses d3 as its underlying layout engine. Therefore the family tree can't have multiple roots as would be required.
So as I see it you have to writing a custom layout algorithm.
I was thinking on the same grounds. That's gonna take a lot of time.
Is there any way we can build separate tree for the parents of spouse and connect the nodes?
You could build separate trees but then you still have to do some calculation for where to lay them out without overlapping which is the tricky part.
I would start with experimenting by building multiple trees in the same SVG and then figuring out how to align them. And then calling the function in dTree to connect the nodes between the trees.
I know I'm being vague but there are many steps to solve this problem which require some serious thought and unfortunately I do not the time required to give better guidance.
Best of luck!
That makes sense. There's a lot to figure out to make it work. If I come up with a solution will definitely share with you. Thanks
Hey, maybe this will help you.
I used dTree to build my own family tree. But I also wanted to be able to show the parents of the spouses. So I wrote a little converter that converts a family graph data structure to a tree structure with the selected root node. https://www.npmjs.com/package/graphtodtreeconverter
You can find the usage of the converter in this example https://stammbaum.georg-braun.de/ Spouses with parent information are highlighted with a red border. A left click on the node will change the family tree to "another" tree.
@velox1992 Very cool solution and also good for making large graphs manageable!
@ErikGartner how about considering parents as children and drawing accordingly, but then rotating them upward?
Then you would impose the same restriction on the children instead of the parents.
Does this support showing the parents of spouses? I've got it working with Vue for default data but unsure of the JSON?