Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript Library - How to draw Family Tree Orgchart or Flowchart?

I'm looking for a simple Javascript Library (svg?) that allow me to draw a family tree relationships.

I have searched a lot on google found a lot of interesting libraries like Raphaël and its extention Dracula. Google has its own library to make flowcharts too.

Unfortunately, every library make a relation between nodes with a single line. If A and B has a relation to C, I will obtain 2 line: one from A to C and one from B to C.

What I need is a line from A to B (we call it AB) and a line from AB to C to represent the Marriage of A and B.

Example (Source: example-image): My Requirement

Thanks.

like image 815
MrMime Avatar asked May 03 '12 10:05

MrMime


2 Answers

Found TreantJS - might be helpful.

like image 87
Zeeshan Avatar answered Sep 21 '22 13:09

Zeeshan


I know I am really late to the party, but when I saw that your sample image was created using yEd, I thought that linking to the underlying software library that yEd is built upon would be a good idea. After all there is a JavaScript version of the graph visualization library that has a specific automatic layout for family trees built-in.

There is a an article about how to use that library to draw family charts in JavaScript, so if this is in a commercial context (this is a commercial library) you might want to take a look, as it specifically solves the problem with the connections ("marriage nodes") you are describing:

Sample Automatic Family Tree Layout

The grey round nodes depict marriages and child nodes connect to the marriage node of their respective parents.

If not for the automatic layout, of course you might also want to look at the other libraries in this question.

Disclaimer: I work for the company that provides the linked library, but I do not represent the company on SO. My comments, opinions, and answers are my own.

like image 27
Sebastian Avatar answered Sep 19 '22 13:09

Sebastian