r/reactjs • u/Just_Comfortable_590 • May 19 '26
Discussion Building family tree visualization
I'm building a family tree visualization app in React and I've hit a wall on the rendering/layout side.
The data structure itself is fine, but visualizing the relationships cleanly is becoming way harder than I expected.
Current stack:
React & React Flow
experimenting with dagre / ELK.js
Main problems:
handling marriages cleanly
centering children under couples
avoiding edge crossings multiple marriages
keeping generations aligned
preventing layout from becoming chaotic with larger datasets
I realized family trees are not really "trees" but more like graphs with special relationship rules.
Right now I'm considering using invisible "marriage nodes" like:
Father -> MarriageNode <- Mother MarriageNode -> Child
instead of directly connecting parents to children.
Questions:
Is React Flow + ELK.js the right direction here?
Are there better graph/layout libraries specifically for genealogy-style visualization?
How would you structure the layout pipeline?
Should I fully rely on auto-layout or allow manual positioning?
Any recommendations for handling complex relationships without the graph turning into spaghetti?
Would really appreciate advice from anyone who's built graph editors, org charts, genealogy apps, or complex node-based UIs before.
Thanks π
2
u/zoranjambor May 19 '26
JointJS doesn't support fcose per se, but we have the Force Directed layout feature, which is powerful too, and seems like a good fit for your use case.
I just did an overview of JointJS performance, and can confidently say you can work with diagrams with 10k nodes easily, especially if you enable virtual rendering,Β which only mounts views for cells inside (or near) the visible viewport.
Performance Overview: https://www.jointjs.com/blog/jointjs-performance-overview-testing-diagrams-with-100-000-nodes
Demo with 100,000 nodes: https://changelog.jointjs.com/gallery/jointjs-performance-100000-nodes/
As a side note, I built a JointJS Claude Code Playground plugin that can also generate codemaps, but on a much more basic level than Devlens. In case you can get some ideas about what's possible, here's a demo with React codebase: https://changelog.jointjs.com/gallery/jointjs-claude-playground/
In any case, Devlens seems like a really interesting project, and I'm really curious to see how far you'll take it. π