documentationfor yFiles for HTML 2.6

ShuffleLayout

This layout algorithm removes overlaps between nodes in a graph.

Inheritance Hierarchy
ShuffleLayout
Implemented Interfaces

Remarks

Note: The usage of RemoveOverlapsStage instead of this class is recommended for most use cases involving the mere removal of overlaps. That stage offers a more powerful strategy to do the task.

Layout Style

The style of results often resembles the look of tiles which have been dropped onto each other, where tiles correspond to nodes of the graph. The reason is that overlapping nodes are moved in order to resolve the overlap. During this process, several nodes moving in the same direction may be stacked next to or above each other.

This algorithm does not route the edges of the input graph - edges might although be stretched due to the node movement.

Example with overlaps (left) and after executing the shuffle layout (right) Example with overlaps (left) and after executing the shuffle layout (right)

Concept

Nodes overlapping with other nodes will be moved in horizontal or vertical direction in order to remove overlaps. The concept behind this removal step is based on a famous Russian arcade game.

Features

This layout stage can also be executed on its own, without specifying a core layout algorithm.

A minimum distance between nodes can be specified such that not only overlaps will be removed but nodes will keep this specified distance to other nodes. This distance can be defined separately for each node using a IDataProvider registered with key MINIMUM_DISTANCE_DP_KEY. The minimum distance can also be specified globally via minimumNodeDistance.

To specify that specific nodes should not be moved, they can be marked as fixed using a IDataProvider registered with key FIXED_NODE_DP_KEY.

Default Values of Properties

barycenterModefalseThe barycenter mode is disabled.
horizontalOverlapCriterionLESS_MOVEMENT
minimumNodeDistance5

Type Details

yfiles module
layout-core
yfiles-umd modules
All layout modules, view-layout-bridge
Legacy UMD name
yfiles.organic.ShuffleLayout
This stage does not directly support group nodes. However, if the graph contains groups, this stage can be applied as core layout algorithm of the RecursiveGroupLayout.

Constructors

Properties

Methods

Constants