Where to Find Up-to-date yFiles Information

This page is from the outdated yFiles for Java 2.13 documentation. You can find the most up-to-date documentation for all yFiles products on the yFiles documentation overview page.

Please see the following links for more information about the yFiles product family of diagramming programming libraries and corresponding yFiles products for modern web apps, for cross-platform Java(FX) applications, and for applications for the Microsoft .NET environment.

More about the yFiles product family Close X

Chapter 7. Graph Hierarchies

Table of Contents

Concepts
Grouping and Nesting
Special Proxy Elements
Group Node and Folder Node
Inter-Edge
Working with Graph Hierarchies
Comparing the Concepts
Nesting Characteristics
Managing Graph Hierarchies
Class HierarchyManager
Graph Hierarchy
Creating Grouped Nodes
Creating Nested Graphs
Handling Inter-edges
Node Visiting Order
Traversal Policies
Class DefaultHierarchyGraphFactory
Tutorial Demo Code
Node Realizers
Classes GroupNodeRealizer and GenericGroupNodeRealizer
Resizing Policy
Interface AutoBoundsFeature
View Implementations
Class HierarchyJTree
Related Classes
Class DefaultNodeChangePropagator
Class HierarchyTreeTransferHandler
User Interaction
Tutorial Demo Code
Events and Listeners
Hierarchy Changes
Automatic Layout
Class GroupLayoutConfigurator

This chapter describes the yFiles concept of graph hierarchies, often also referred to as grouped graphs. Discussed are all aspects from managing to user interaction, visual representation, and also layout preparation.

Graph hierarchies can be used to naturally organize large data sets or inherently hierarchically structured data. The yFiles library provides sophisticated support for graph hierarchies that seamlessly integrates with the notion of a graph as described in Chapter 3, General Concepts in yFiles.

Concepts

A graph hierarchy is an augmentation to the graph concept where proper graph structures are allowed to be nested within other graphs to arbitrary depth, forming a hierarchically organized inclusion tree of graphs. At the top of this inclusion tree is the so-called "root graph," the top level graph that is present in any graph hierarchy.

Grouping and Nesting

The yFiles library knows of two complementary ideas, namely "grouping" and "nesting." Grouping and nesting differ in both structural as well as visual nature. While both approaches make use of proxy nodes that reside in the original graph,

  • grouped nodes are stored within the same graph,
  • nested graph structures are stored separately.

Thus, grouping is merely of conceptual nature, while nesting is a true hierarchical inclusion of graph structures. Note that grouped nodes can live side by side with nested graph structures. Figure 7.1, “Grouping and nesting side by side” shows grouping and nesting within one graph.

Figure 7.1. Grouping and nesting side by side

Grouping and nesting.

Special Proxy Elements

Group Node and Folder Node

The proxy nodes that are used to either enclose grouped nodes (with grouping) or represent nested graph structures (with nesting) are called "group node" and "folder node," respectively.

The nested graph that is associated with a folder node is called the "inner graph" of this folder node. The graph where the folder node resides in is called the "parent graph" of the inner graph, and is hierarchically one level above the inner graph. Note that a folder node serves as a means to link inner graph to parent graph. A folder node is also called "anchor node."

From a conceptual point of view, grouped nodes that are contained in a group node can be thought of as being hierarchically one level below the graph where the group node resides in. Technically, however, these nodes belong to the same graph as the group node.

The difference in semantics of grouping and nesting is also reflected by the visual representation of group nodes and folder nodes. While grouped nodes contained in a group node are visible within the graph containing the group node itself, the nested graph structure that is associated with a folder node is hidden. However, a folder node provides access to its inner graph at any time, e.g., via a mouse double click that occurs within its area.

Figure 7.1, “Grouping and nesting side by side” shows both a group node and a folder node within the same graph. The content of the folder node cannot be seen in the graph view, but is listed in the tree-like view in the lower left corner of the application's window.

Inter-Edge

Besides group node and folder node there is also a proxy edge introduced that is used to replace an edge that connects nodes on different hierarchy levels. Such an edge would actually connect nodes in different graphs, which is not allowed. It is therefore redirected in a manner so that it connects nodes that are within the same graph.

The resulting redirected edge, which serves as a proxy for the original edge, is a so-called "inter-edge."