documentationfor yFiles for HTML 3.0.0.1

Organic Layout

This section describes the major changes to the OrganicLayout.

Like all major layout algorithms, the OrganicLayout no longer inherits from MultiStageLayout but instead implements ILayoutAlgorithm directly. The layout stages are now managed by a LayoutStageStack, which can be obtained via the layoutStages property. See Layout Stages and Multi-Stage Layouts for more details.

Renamed, Moved, and Removed Classes and Members

The following table lists the renamed, moved, and removed classes and members of the major classes of the OrganicLayout. In addition to the changes listed here, the expert API was streamlined as well by removing some protected methods of OrganicLayout.

Renamed, moved, and removed members of classes related to the OrganicLayout (classes are bold)
yFiles for HTML 2.6 yFiles for HTML 3.0 Remarks
OrganicLayoutclass name unchanged
Members of class OrganicLayout
clusterAsGroupSubstructureAllowedallowClusterAsGroupSubstructure
clusterNodesremovedTo disable clustering, set the clusteringPolicy property to NONE.
clusteringQualityremovedThe clustering quality is now automatically determined based on the qualityTimeRatio.
componentLayoutEnabledcomponentLayout.enabled
considerNodeLabelsnodeLabelPlacementThe enum now allows you to choose between considering the node labels and the GenericLabeling algorithm.
considerNodeSizesremovedThe OrganicLayout now always considers the node sizes.
createConstraintFactoryremovedThe factory is no longer necessary, see Constraints.
hideGroupsStageremovedThe OrganicLayout is able to handle group nodes itself.
hideGroupsStageEnabled
integratedEdgeLabelingedgeLabelPlacementThe enum now allows you to choose between integrated labeling and the GenericLabeling algorithm.
L labelingremovedTo influence the labeling, use the nodeLabelPlacement and edgeLabelPlacement properties.
labelingEnabled
maximumDurationstopDurationThe OrganicLayout tries to stop within the given time, but it is not guaranteed to do so. The property was renamed to better reflect this.
minimumNodeDistancedefaultMinimumNodeDistanceSettings for individual edges can be specified via the OrganicLayoutData.minimumNodeDistances property.
nodeEdgeOverlapAvoidedavoidNodeEdgeOverlap
nodeOverlapsAllowedallowNodeOverlaps
orientationLayoutremovedUse layoutOrientation to set the desired layout orientation.
orientationLayoutEnabled
outputRestrictionshapeConstraint
parallelEdgeRouterEnabledparallelEdgeRouter.enabled
preferredEdgeLengthdefaultPreferredEdgeLengthSettings for individual edges can be specified via the OrganicLayoutData.preferredEdgeLengths property.
scopeOrganicLayoutData.scope.scopeModesAll settings related to the scope have been moved to the layout data. The scope mode can now be set individually per node. See also the section Scope.
selfLoopRouterEnabledselfLoopRouter.enabled
smartComponentLayoutremovedThe OrganicLayout now configures the ComponentLayout. To disable this configuration, remove or replace the instance of the ComponentLayout in the LayoutStageStack accessible via the layoutStages property.
subgraphLayoutremovedIf necessary, the OrganicLayout can be wrapped by a SubgraphLayoutStage, but this may lead to overlaps. It is usually advisable to set an appropriate scope.
SubgraphLayoutEnabled
OrganicLayoutDataOrganicLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel>
Properties in class OrganicLayoutData
abortHandlerremovedA LayoutAbortController is exposed by the LayoutExecutor; see Section Maximum Duration and Aborting of Algorithms for more details.
affectedNodesscope.nodesAll settings related to the scope have been combined into the sub-data scope. See also section Scope.
edgeLabelPreferredPlacementedgeLabelPreferredPlacements
edgeOrientationsedgeOrientation
groupNodeModesscope.groupNodeHandlingPoliciesAll settings related to the scope have been combined into the sub-data scope. See also section Scope.
nodeHalosnodeMarginsThe type of the values was changed to Insets.
partitionGridDatalayoutGridData
sourceGroupIdssubstructureSourceGroupIds
targetGroupIdssubstructureTargetGroupIds
zCoordinateszCoordinatesResult
OrganicLayoutScoperemovedNow a scope mode is set per node; see section Scope.
GroupNodeModeGroupNodeHandlingPolicy
Constants in enum GroupNodeHandlingPolicy
NORMALFREE
OutputRestrictionShapeConstraint
Methods in class ShapeConstraint
createAspectRatioRestrictioncreateAspectRatioConstraint
createCircularCageRestrictioncreateCircularConstraint
createEllipticalCageRestrictioncreateEllipticalConstraint
createRectangularCageRestrictioncreateRectangularConstraint
OrganicLayoutTreeSubstructureStyleenum name unchanged
Constants in enum OrthogonalLayoutTreeSubstructureStyle
BALLOONRADIAL_TREEThe layout algorithm was renamed to RadialTreeLayout as well.
OrganicLayoutClusteringPolicyenum name unchanged
Constants in enum OrganicLayoutClusteringPolicy
USER_DEFINEDremovedCluster IDs defined via OrganicLayoutData.clusterIds are now always considered.
ClassicOrganicLayoutremovedUse the OrganicLayout instead; see section ClassicOrganicLayout.
OrganicPartitionGridLayoutStageremovedThe OrganicLayout handles layout grids itself.
OrganicRemoveOverlapsStageremovedUse the RemoveOverlapsStage with property overlapRemovalPolicy set to PRESERVE_RELATIVE_LOCATIONS.

Changed Default Values and Behavior Changes

Node sizes are now always considered. Consequently, the property OrganicLayout.ConsiderNodeSizes has been removed.

Node labels are now considered by default. To change this behavior, set the nodeLabelPlacement property to the desired value. It is now also easier to place node labels with GenericLabeling by setting the value to GENERIC.

Edge labels are now placed by the GenericLabeling algorithm by default. To change this behavior, set the edgeLabelPlacement property to the desired value.

The default component arrangement style has been changed from ROWS to PACKED_CIRCLE. The style can be specified via the ComponentLayout.style property. The ComponentLayout that is used by the OrganicLayout is available via the componentLayout property.

The OrganicLayout now always configures the ComponentLayout to respect the location of fixed nodes that lie in different components. The property SmartComponentLayout has been removed. To disable this configuration, replace the instance of the ComponentLayout in the LayoutStageStack accessible via the layoutStages property.

Port placement now takes the specified port candidates into account. The ports are placed in a post-processing step by the PortPlacementStage. Port candidates can be specified via the properties on the sub-data OrganicLayoutData.ports. See also the section Ports.

If custom clusters are defined via the OrganicLayoutData.clusterIds, these are considered automatically, and the value of OrganicLayout.clusteringPolicy is ignored. It is no longer necessary to set it to ClusteringPolicy.USER_DEFINED, which consequently has been removed.

ClassicOrganicLayout

The ClassicOrganicLayout has been superseded by the OrganicLayout, which supports all use cases of the ClassicOrganicLayout. Consequently, the ClassicOrganicLayout has been removed.

Scope

In yFiles for HTML 3.0, defining the scope has been made uniform for all major layout algorithms. For the OrganicLayout, this means that all settings related to the scope have been combined into the sub-data scope of the OrganicLayoutData.

Additionally, the scope mode can now be set per node, which makes it more flexible than before. To emulate the previous settings of the scope property of the OrganicLayout, the following settings can be used.

Constraints

The changes described in this chapter only affect users who work directly with the LayoutGraph API, for example, when writing custom layout algorithms.

The class ConstraintFactory has been removed. Node placement constraints should now be specified directly via the constraints property on the OrganicLayoutData, as when working with an IGraph.

Defining node placement constraints for a LayoutGraph
const organicLayout = new OrganicLayout()
const layoutData = organicLayout.createLayoutData(graph)

// Align all nodes in the list on a horizontal line
layoutData.constraints.addAlignmentConstraint('horizontal').source =
  nodesToAlign

Interactive Organic Layout

The interactive organic layout has been significantly reworked. It is recommended to also consult the source code demo for the Interactive Organic Layout.

There is now a corresponding InteractiveOrganicLayoutData. This class is responsible for setting the value of the properties of the edges and nodes both before and during the layout calculations.

To set the initial values of these properties, it offers properties like preferredEdgeLengths. To update these values while the layout algorithm is running and to query the values that the algorithm used after completion, use handles (InteractiveOrganicNodeHandle and InteractiveOrganicEdgeHandle). For example, the method InteractiveOrganicLayout.SetPreferredEdgeLength has been replaced with the property InteractiveOrganicEdgeHandle.preferredEdgeLength. Mappings from the nodes to these handles are maintained by the InteractiveOrganicLayoutData using the properties nodeHandles and edgeHandles.

Renamed, moved, and removed members of the InteractiveOrganicLayout
yFiles for HTML 2.6 yFiles for HTML 3.0 Remarks
addStructureUpdateremoved
getCenterInteractiveOrganicNodeHandle.getCenterThe handles are available via InteractiveOrganicLayoutData.nodeHandles.
getCenterX
getCenterY
setCenterInteractiveOrganicNodeHandle.setCenter
setCenterX
setCenterY
commitPositionsInteractiveOrganicLayoutData.updateNodeCenters
commitPositionsSmoothly
disableAllStagesremoved
getInertiaInteractiveOrganicNodeHandle.inertiaThe handles are available via InteractiveOrganicLayoutData.nodeHandles.
setInertia
maximumDurationstopDurationThe InteractiveOrganicLayout tries to stop within the given time, but it is not guaranteed to do so. The property was renamed to signal this intent better.
outputRestrictionshapeConstraint
preferredEdgeLengthdefaultPreferredEdgeLengthSettings for individual edges can be specified via the InteractiveOrganicLayoutData.preferredEdgeLengths property.
setPreferredEdgeLengthInteractiveOrganicEdgeHandle.preferredEdgeLengthThe handles are available via InteractiveOrganicLayoutData.edgeHandles.
setRadiusInteractiveOrganicNodeHandle.radiusThe handles are available via InteractiveOrganicLayoutData.nodeHandles.
setStressInteractiveOrganicNodeHandle.stressThe handles are available via InteractiveOrganicLayoutData.nodeHandles.
syncStructureremoved