documentationfor yFiles for HTML 2.6

OrganicLayout

This layout algorithm arranges graphs in an organic fashion.

Inheritance Hierarchy
MultiStageLayout
OrganicLayout
Implemented Interfaces

Remarks

Layout Style

The organic layout style is characterized by a natural distribution of nodes that exhibits clusters and symmetric properties of the graph. Nodes are placed space-saving, close to their adjacent nodes. Edges maintain uniform lengths and are routed with straight-line segments without bends.

Organic diagrams are commonly used for visualizing relations in large networks for example in bioinformatics, enterprise networking, visualizing social networks, mesh visualization or system management.

Organic Layout obtained with default settings

Organic Layout exhibiting symmetric properties

Concept

OrganicLayout uses a force-directed approach to place the nodes of the input graph. According to this approach, the graph is modeled as a physical system with appropriate forces acting on it. Nodes are considered as electrically charged particles with mutually repulsive forces. Edges are modeled as springs that attract adjacent nodes. A good diagram is obtained from an equilibrium state of the system, i.e., the nodes are rearranged based on the physical forces until the system reaches a (local) minimum of the sum of the forces.

Features

Quality-Time-Ratio

The ratio between the layout quality and the running time is conveniently adjustable.

Partition Grid

This layout algorithm is able to consider a PartitionGrid structure. However, for common nodes (i.e. non-group nodes) it only considers single partition cells. Furthermore, the layout algorithm will throw a InvalidGraphStructureError if there is a partition grid and the descendants of a group node are assigned to different partition grid cells or if there are group nodes that are associated with a group node mode other than NORMAL.

Avoidance of Node Edge Overlaps

The layout can be configured such that overlaps between edges and nodes are avoided. However, it doesn't guarantee that they won't appear in the resulting layout. To avoid overlaps, it is possible to route the edges afterwards using an edge routing algorithm, e.g., OrganicEdgeRouter.

Maximum Duration

OrganicLayout allows restricting the maximum duration which may be a suitable option to reduce the runtime required for large graphs. Note that restricting the maximum duration may result in a lower layout quality. Furthermore, the actual runtime may exceed the maximum duration since the layout algorithm still has to find a valid solution.

Substructures

The algorithm is also able to detect certain types of substructures in a graph (i.e., chains, stars, cycles, parallel, tree and group structures), and arrange these structures with special-purpose layout styles. Using substructure styles ensures that the corresponding structures are easily recognized in the graph. 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.

Organic Layout without applying specific layout styles to substructures

Organic Layout of the same graph applying specific layout styles to the detected substructures

Constraints

The placement of the nodes can be influenced and restricted by additional constraints. Among others, the layout supports the following constraints; for more constraints see createConstraintFactory and OrganicLayoutConstraintFactory.

Nodes can be enforced to be placed on horizontal and vertical lines addAlignmentConstraint. In this example, the nodes with label "H" are forced on a horizontal line, and nodes with label "V" are forced on a vertical line.

Nodes can be forced on rectangles and ellipses using addRectangle and addEllipse, respectively. In this example, the nodes with label "R" are forced on a square, and nodes with label "E" are forced on a circle. The sizes of the geometric structures are determined automatically.

Default Values of Properties

automaticGroupNodeCompactiontrueAutomatic group node compaction is enabled.
clusteringPolicyNONEAutomatic clustering is disabled.
compactnessFactor0.5
considerNodeLabelsfalseNode labels are not considered.
considerNodeSizesfalsePoints will be used for modeling the nodes.
create3DLayoutfalseThe layout algorithm doesn't produce a 3D result.
deterministicfalseThe layout algorithm is non-deterministic.
groupBoundsCalculatorMinimumSizeGroupBoundsCalculator
groupNodeCompactness0.4
hideGroupsStageEnabledfalseThe stage responsible for hiding group nodes is activated.
integratedEdgeLabelingfalseIntegrated edge labeling is disabled.
maximumDuration30000
minimumNodeDistance0
nodeEdgeOverlapAvoidedfalseOverlaps between nodes and edges are not avoided.
nodeOverlapsAllowedfalseNode overlaps are not allowed.
orientationLayoutEnabledtrueThe orientation is activated.
outputRestrictionNONE
preferredEdgeLength40
qualityTimeRatio0.6
scopeALL
smartComponentLayoutfalseSmart component layout is disabled.

Type Details

yfiles module
layout-organic
yfiles-umd modules
layout-multipage, layout-organic, layout
Legacy UMD name
yfiles.organic.OrganicLayout

See Also

For large tree structures applying a tree layout algorithm like, e.g., the BalloonLayout produces more suitable results. Hence, for tree-like input graphs, we recommend choosing a suitable tree substructure style in which case the layout of subtrees is automatically delegated to a tree layout algorithm.

Constructors

Properties

Methods

Constants