documentationfor yFiles for HTML 2.6

OrganicLayoutConstraintFactory

The OrganicLayoutConstraintFactory allows to define additional constraints on subsets of a graph that will be applied by the OrganicLayout during the layout calculation.

Inheritance Hierarchy
OrganicLayoutConstraintFactory

Remarks

Constraints modify the behavior of the organic layout algorithm for subsets of a graph, in order to introduce structures, relative positioning, or area restrictions on the positions of the nodes in the layout.

The constraints are defined on IDs registered to the nodes with a IDataProvider with the key NODE_ID_DP_KEY

A OrganicLayoutConstraintFactory has to be disposed of after use. Disposing of the factory will also remove all constraints previously specified for the factory's associated graph.

Type Details

yfiles module
layout-organic
yfiles-umd modules
layout-multipage, layout-organic, layout
Legacy UMD name
yfiles.organic.OrganicLayoutConstraintFactory
For grouped graphs, any one constraint may only be applied to nodes with the same parent.
Contradictory constraints may be violated. If the scope of the organic layout is not set to ALL or overlaps are not allowed, the specified constraints may be broken in favor of the other features if it is necessary.
Some features of the OrganicLayout can contradict the constraints specified here. In that case, conflicts are resolved as follows:
  • If the graph is partitioned, constraints that are not compatible with the partition grid can be broken.
  • If a partial layout is applied to chains, cycles, stars, trees, parallel structures or groups, constraints that include the affected nodes will be ignored.
  • If the graph contains fixed nodes, those nodes will remain fixed. Constraints affecting those nodes will be enforced if possible, which may decrease the quality of the resulting layout. If the constraints are impossible to enforce without moving the fixed nodes, they can break.
  • An edge orientation that contradicts constraints specified here, may lead to undefined behaviour w.r.t. the orientation of the edge and the affected constraints.

Methods