donatso / family-chart

family tree visualization built on top of d3
MIT License
179 stars 63 forks source link

Performance issues on large dataset #4

Closed bobokeke0 closed 2 years ago

bobokeke0 commented 2 years ago

Is there a way to handle rendering a very large family tree? It seem to choke and the interaction is very very slow.

bobokeke0 commented 2 years ago

maybe there's a way to render portions of the tree and render the rest as they are expanded?

donatso commented 2 years ago

hmm, I am not sure how big the tree have to be. This one is pretty big, but it work ok, I think.. https://donatso.github.io/family-chart/examples/wiki-tree/?wiki_id=Q855 Can you give me some example of that very large tree?

bobokeke0 commented 2 years ago

sorry for the late reply. The example you showed seem to have less than 50 nodes (individual names). I'm looking to render a tree with almost 1000 nodes.

donatso commented 2 years ago

uh, 1000 is a lot. svg cannot handle so many cards.

best I can do for you for now is suggest this little hack that cuts tree before rendering it. https://codesandbox.io/s/family-chart-static-forked-qwbrw1?file=/index.html default is max_depth=1, which means that only parents and children and their spouses for the selected person will be shown. then you have to select child or parent to see their relatives. max_depth=2 will show grandparents and grandchildren and so on... I hope it helps!

bobokeke0 commented 2 years ago

Haha yeah. This took is amazing but I'm pushing it with that many nodes.

That's perfect. Cutting the tree before rendering actually give a better experience. Thanks a million!!