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 5.19, “Family tree” shows an example family tree.

Figure 5.19. Family tree

Family tree.

FamilyTreeLayouter requires that there is a data provider registered with the graph using the look-up key DP_KEY_FAMILY_TYPE. 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 5.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 5.20. Data provider look-up keys

Key Element Type Value Type Description
DP_KEY_FAMILY_TYPE node String For each node one of TYPE_FAMILY, TYPE_MALE, or TYPE_FEMALE.

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:

topLayouter:Layouter
Description Determines the top layouter.