Layout a family tree


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
4 views
Tell me how it would be logical to layout a family tree? The emphasis is on the fact that the data will come from MySql database, therefore a complex and highly variable structures are not suitable. Here are my thoughts on a simple tree. But the appearance in the branches of brothers and sisters, relatives, parents and their families all is not so simple.
by | 4 views

2 Answers

0 like 0 dislike
I would do stupid forehead — the man drawn any element, div, even, though button, but look forward to JavaScript coordinates.
\r
Nakolbasit recursive (and rather head-recursive) function, for example, draw_ancestors(). When rendered lower, obviously more populated level, and only then according to the obtained coordinates of the bottom has to calculate coordinates for the current and bring them back to the top level in the stack.
\r
How to optimize the structure of the database and to communicate with her in this case — a separate issue. I would try for the sake of interest all no-sql solution by taking the whole tree in JSON.
by
0 like 0 dislike
The first thing that came to mind: table. The number of columns, the maximum width of the tree (just the very horizontal "spikes" in the form of siblings), number of rows — the maximum height of the tree (mom, dad, grandparents). Something like this.
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
4 answers
asked Mar 24, 2019 by anaximen
0 like 0 dislike
1 answer
asked Jun 8, 2019 by ferles
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
27,923 users