documentationfor yFiles for HTML 2.6

SelfLoopRouter

A SelfLoopRouter routes the self-loops (reflexive edges) of a graph.

Inheritance Hierarchy
LayoutStageBase
SelfLoopRouter
Implemented Interfaces

Remarks

Layout Style

The nodes and normal edges are arranged by the core layout algorithm. This layout algorithm only handles the paths of self-loops.

Self-loops are routed either orthogonal or with rounded corners. The layout algorithm places the self-loops in the least crowded quadrant around a node.

Small graph with self-loops

Concept

Self-loops are handled in four steps:

  1. Remove all self-loops of the input graph
  2. Invoke the core layout algorithm on the now self-loops free graph
  3. Reinsert all formerly removed self-loops
  4. Route the self-loops of the input graph

Features

SelfLoopRouter can either be used as a ILayoutStage wrapping a layout algorithm which cannot handle self-loops. Then it will hide the self-loops from this core layout algorithm and take over the routing of them.

If no core layout algorithm is specified, SelfLoopRouter can work alone. It will route only the self-loops and keep the remaining graph unchanged.

When all self-loops already have a suitable layout, this layout algorithm can keep the self-loop paths. It will just hide the self-loops before invoking the core layout algorithm, such that they are not altered by it.

To only exclude some self-loops from routing, a IDataProvider registered with KEEP_SELF_LOOP_LAYOUT_DP_KEY can be used for marking those self-loops.

Default Values of Properties

coreLayoutnull
keepAllSelfLoopRoutesfalseSelf-loops get a new route.
layoutStyleROUNDED
smartSelfLoopPlacementtrueThe corner of the nodes where self-loops are placed is chosen considering incident edges.

Type Details

yfiles module
layout-core
yfiles-umd modules
All layout modules, view-layout-bridge
Legacy UMD name
yfiles.layout.SelfLoopRouter

See Also

Constructors

Properties

Methods

Constants