documentationfor yFiles for HTML 2.6

OrthogonalLayout

This layout algorithm arranges graphs in an orthogonal fashion.

Inheritance Hierarchy
MultiStageLayout
OrthogonalLayout
Implemented Interfaces

Remarks

Layout Style

This layout algorithm arranges the nodes of a given graph such that each edge is drawn as an alternating sequence of horizontal and vertical segments.

It produces compact drawings with no overlapping nodes, few crossings and few bends and is well suited for small and medium-sized sparse graphs.

Orthogonal drawings are common in engineering applications since they are able to provide clear representations of complex networks that can also be optimal with respect to diverse objective functions such as bend minimization or area minimization. Application domains of orthogonal drawings include software engineering, database schema representation, system management, knowledge representation, VLSI circuits and floor planning applications.

Orthogonal layout with default settings

This algorithm also optionally supports directed edge drawings (although not in combination with hierarchically nested graphs or the non-default layout styles). Application domains of directed orthogonal drawings include, for example, software engineering, database schema and system management.

Sample output of OrthogonalLayout with default settings. Marked edges are considered as directed and the layout orientation is top-to-bottom.

Sample output of OrthogonalLayout with edge grouping. All edges are considered directed and the layout orientation is left-to-right.

Also this algorithm supports hierarchically nested graphs (although not in combination with the directed edge drawings, the from sketch option, or the non-default layout styles) feature:

Orthogonal layout of a grouped graph with default settings Orthogonal layout of a graph with nested groups

Concept

The orthogonal layout algorithm is based on the topology-shape-metrics approach and runs in three phases:

  • Planarization – A planar embedding is computed.
  • Orthogonalization – The bends and the angles are computed.
  • Compaction – The coordinates for the nodes and edges are determined.

Features

There exist several different layout styles that the orthogonal layout algorithm supports depending on whether or not the edges should be routed completely orthogonal, or whether or not the original size of the nodes should be maintained. Such layout styles are NORMAL, UNIFORM, BOX, MIXED, FIXED_BOX, FIXED_MIXED and can be applied using method layoutStyle.

OrthogonalLayout is able to consider edge label data when arranging a graph. This means that the layout algorithm will determine the positions of the nodes and edges such that the edge labels do not overlap with the rest of the layout. Integrated edge labeling can be activated using method integratedEdgeLabeling.

OrthogonalLayoutEdgeLayoutDescriptor instances can be used for specifying individual information (e.g. distances) for each edge in the graph. The descriptors are bound to the graph using IDataProviders registered with key EDGE_LAYOUT_DESCRIPTOR_DP_KEY. If there is no descriptor assigned to some edges, a default descriptor will be used. To set default descriptors, use edgeLayoutDescriptor.

OrthogonalLayout tries to optimize diverse objective functions such as bend minimization, number of edge crossings, edge length minimization or face maximization. These settings can be enabled using the corresponding methods optimizePerceivedBends, crossingReduction, edgeLengthReduction, and faceMaximization, respectively. The drawback when these settings are enabled is that the running time of the algorithm may be drastically increased.

For input graphs without group nodes, this layout algorithm is able to detect some specific substructures. If desired, it can handle and arrange them explicitly, making the structure easy to recognize. Supported substructures are trees, chains and cycles. See the corresponding style properties for details: treeStyle, chainStyle and cycleStyle. For the detection of substructures, it is optionally possible to consider node types, such that only nodes of the same user-defined type can form a substructure.

Default Values of Properties

alignDegreeOneNodesfalseDegree-one nodes with the same neighbor are not aligned with each other.
chainStyleNONEChains are not handled explicitly.
componentLayoutEnabledtrueThe stage that arranges connected graph components is activated.
considerNodeLabelsfalseNode labels are ignored.
crossingReductiontrueThe number of edge crossings is reduced.
cycleStyleNONECycles are not handled explicitly.
edgeLengthReductiontrueThe overall edge length is reduced.
fromSketchModefalseThe initial coordinates of the nodes are not considered.
gridSpacing20
hideGroupsStageEnabledtrueThe stage responsible for hiding group nodes is activated.
integratedEdgeLabelingfalseIntegrated edge labeling is disabled.
layoutStyleNORMAL
maximumDuration<code>0x7FFFFFFF</code>The layout algorithm runs unrestricted.
optimizePerceivedBendstrueThe number of perceived bends will be minimized.
orientationLayoutEnabledtrueThe orientation is activated.
parallelEdgeRouterEnabledfalseThe stage that routes parallel edges is activated.
randomizationtrueA randomization strategy is applied.
selfLoopRouterEnabledfalseThe stage that routes self-loops is activated.
treeStyleNONESubtrees are not arranged in a special way.
uniformPortAssignmentfalse

Type Details

yfiles module
layout-orthogonal
yfiles-umd modules
layout-orthogonal-compact, layout-orthogonal, layout
Legacy UMD name
yfiles.orthogonal.OrthogonalLayout

See Also

For graphs with group nodes, features like substructures, directed edges, and edge grouping are not supported.

Constructors

Properties

Methods

Constants