A genogram or pedigree chart is an extended family tree diagram that displays information about each person or each relationship. The proband is the person about whom the genetic study is focused -- that node is highlighted with an arrow. In this case we focus on "Bill".

There is support for twins or triplets, both fraternal and identical.

When the mouse passes over a node, all other nodes representing people who are direct ancestors or descendants are highlighted.

Note that the term "marriage" here does not refer to a legal or cultural kind of relationship, but simply one representing the female and male genetic sources for any children.

There are functions that convert an attribute value into a brush color or Shape geometry, to be added to the Node representing the person. These can be adapted for your app's specific purposes.

Although this uses an Inspector to show the values of the data properties for the first selected node, nothing can be changed in this sample. We also have a version of this sample that supports editing the graph.

A custom LayeredDigraphLayout does the layout, assuming there is a central person whose mother and father each have their own ancestors. Husband/wife node pairs are represented by a single LayeredDigraphVertex.

For a simpler family tree, see the family tree sample or Japanese family tree sample.

Diagram model saved in JSON format:

GoJS Features in this sample

Item Arrays

It is sometimes useful to display a variable number of elements in a node by data binding to a JavaScript Array. In GoJS, this is simply achieved by binding (or setting) Panel.itemArray. The Panel will create an element in the panel for each value in the Array. More information can be found in the GoJS Intro.

Related samples


Collections

GoJS provides its own collection classes: List, Set, and Map. You can iterate over a collection by using an Iterator. More information can be found in the GoJS Intro.

Related samples


Layered Digraph Layout

This predefined layout is used for placing Nodes of a general directed graph in layers (rows or columns). This is more general than TreeLayout, as it does not require that the graph be tree-structured. More information can be found in the GoJS Intro.

Related samples


Custom Layouts

GoJS allows for the creation of custom layouts to meet specific needs.

There are also many layouts that are extensions -- not predefined in the go.js or go-debug.js library, but available as source code in one of the three extension directories, with some documentation and corresponding samples. More information can be found in the GoJS Intro.

Related samples


Geometry Path Strings

The GoJS Geometry class controls the "shape" of a Shape, whereas the Shape.fill and Shape.stroke and other shape properties control the colors and appearance of the shape. For common shape figures, there are predefined geometries that can be used by setting Shape.figure. However one can also define custom geometries.

One can construct any Geometry by allocating and initializing a Geometry of at least one PathFigure holding some PathSegments. But you may find that using the string representation of a Geometry is easier to write and save in a database. Use the static method Geometry.parse or the Shape.geometryString property to transform a geometry path string into a Geometry object.

More information can be found in the GoJS Intro.

Related samples