-
Notifications
You must be signed in to change notification settings - Fork 21
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 change the number of generations rendered? #1
Comments
@trydalch I'm not sure what exactly do you mean. Can you sketch an example? |
Here's my data set.
|
@trydalch sorry, but I don't understand what is the question. Do you want to render limited count of children at the bottom? So, in that case you have to do it by your self, with your custom render function/component. |
@SanichKotikov Sorry for not being clear. I've built my own components, they're rendering. Also, I'm using v 1.3.3 (I just saw you updated a couple days ago) The problem I have is that the relatives-tree library is truncating the data I pass it. Here's an example tree from my app (actual data obfuscated/removed). The root node is in green. What I would like is to set the bottom left node (# 8) as the root node, and still show the whole tree. This shows how #8 and #23 are related through a common ancestor. But when I select # 8 as the root node, this is the resulting tree: At some point in the pipeline, it truncates the tree. This library only returns a subset of the nodes found in the raw data. Note, the raw data did not change between the generation of the two trees. All that changed was which node was selected as the root. How can I get the full tree to display, regardless of which node is the root? |
@trydalch no it's clear, thx.
There is no way to do this (at least for now) with current package. That's how it has been designed, and it 'renders' only parents for parent direction of root node, and children for children direction. But, if the package can't 'show' some nodes, it will add |
Thanks for being responsive. Appreciate it. I did see the option to have a clickable button for subtrees. I'll look into it. Ideally though, I would like to be able to see the entire relationship at once. What would it take to add this functionality? How would you recommend implementing this functionality? I've forked your repo. I'm open to contributing. |
That makes a lot more sense now. Seems like it would be valuable parameterize it and give the option to render all nodes (and ignore collisions) for the time being. Just a boolean or something as one of the options that can be passed in. |
I have the same problem (. And I try to understend what i can change to show full tree |
I have the same problem.
Did you find the solution? |
I'm also interested to show the full tree. Can we help to find a solution? |
After trying to implement by myself an algorithm to be able to render the full tree I reached a point quite similar to @SanichKotikov previous comments. There are some constraints that I think are impossible to overcome if you try to render this graph. If you want to keep partners together, siblings at the same level + not willing to have relation lines that cross themselves there is no solution. I think that you end up doing some graph theory 😅 https://en.wikipedia.org/wiki/Crossing_number_(graph_theory) It is sad to reach this point, because I wanted for a long time to print a family tree on paper as a gift for a family member, but I don't know how to move forward. |
I'm building a relationship finder on react native that renders trees that can go back generations. I've patterned after your react-family-tree repository (and react-family-tree-example).
I'm running into difficulty where it only renders 1/2 of the tall tree (only the rootId side).
How can I get it to show the other side?
The text was updated successfully, but these errors were encountered: