Domain-Specific Layout Algorithms

In addition to the major layout algorithms, which are predominantly general-purpose, the yFiles library also provides domain-specific layout algorithms that are tailored to deal with special-purpose applications. Often, such algorithms require the graph to fulfill certain conditions, or need additional tagging information with the graph elements.

Family Tree Layout

Class FamilyTreeLayouter is a special-purpose layout algorithm that provides genealogical tree layout for graphs that encode family trees. Figure 10.18, “Family tree” shows an example family tree.

Figure 10.18. Family tree

Family tree.

FamilyTreeLayouter requires that there is a data provider registered with the graph using the look-up key DpKeyFamilyType. This data provider is used to retrieve information about each of the nodes, namely whether a given node represents a person or a partnership of two persons, i.e., a family.

Supplemental Layout Data

Class FamilyTreeLayouter knows a number of data provider keys which are used to retrieve supplemental layout data for a graph's elements. The data is bound to the graph by means of a data provider which is registered using a given look-up key. Table 10.20, “Data provider look-up keys” lists all look-up keys for FamilyTreeLayouter.

Binding supplemental layout data to a graph is described in the section called “Providing Supplemental Layout Data”.

Table 10.20. Data provider look-up keys

Key Element Type Value Type Description
DpKeyFamilyType node string For each node one of TypeFamily, TypeMale, or TypeFemale.

Layout Options

Class FamilyTreeLayouter uses different strategies for arranging the members of families, i.e., parents and children, on the one hand and then arranging these entire families on the other hand. The so-called top layouter is responsible for the latter strategy, which by default is an incremental hierarchical layout algorithm. Setting another layout algorithm for the top layouter can be done by means of the following property:

ILayouter TopLayouter { get; set; }
Description Determines the top layouter.