Class CompactOrthogonalLayouter is a specialized variant of the orthogonal layout algorithm. It uses a divide-and-conquer approach to achieve compact orthogonal layouts that fit into, respectively are near, a desired aspect ratio.
In contrast to the majority of yFiles layout algorithms, class CompactOrthogonalLayouter does not inherit from CanonicMultiStageLayouter, but is instead an extension of abstract class AbstractLayoutStage.
CompactOrthogonalLayouter combines different phases that:
Figure 5.71. Sample layout produced by class CompactOrthogonalLayouter
|A compact orthogonal diagram with an aspect ratio of 1.0|
This specialized layout algorithm provides only few options by itself. However, the respective classes that are used for the different layout phases can be customized individually. In particular, this also includes the orthogonal layout algorithm which is used as the core layouter.
Defines the virtual grid spacing used by the layouter. Each node is placed in such a way that its center point lies on a grid point.
Specifies the desired aspect ratio that the resulting diagram should fit into. The algorithm tries to reach this value, depending on the actual graph structure, however, this may not always be feasible.
Table 5.55, “Layout Stages” lists layout stages that can be used to enhance the layout process of class CompactOrthogonalLayouter.
Table 5.55. Layout Stages
|PolylineLayoutStage||With class CompactOrthogonalLayouter as the core layouter, this stage adds octilinear edge routing to the diagram that results from the orthogonal layout calculation.|
Layout module CompactOrthogonalLayoutModule.java presents the setup of class CompactOrthogonalLayouter in an application context.
Copyright ©2004-2016, yWorks GmbH. All rights reserved.