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.63. 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.
Grid Spacing | |
API | void setGridSpacing(int gridSpacing) |
Description |
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. |
Aspect Ratio | |
API | void setAspectRatio(double aspectRatio) |
Description |
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.44, “Layout Stages” lists layout stages that can be used to enhance the layout process of class CompactOrthogonalLayouter.
Table 5.44. Layout Stages
Classname | Description |
---|---|
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-2012, yWorks GmbH. All rights reserved. |