documentationfor yFiles for HTML 3.0.0.1

Organic Edge Router

This chapter describes the major API changes to the OrganicEdgeRouter introduced with yFiles for HTML 3.0 and how to migrate from the older version.

Renamed, Moved, and Removed Classes and Members

Renamed, moved, and removed members of classes related to the OrganicEdgeRouter (classes are bold)
yFiles for HTML 2.6 yFiles for HTML 3.0 Remarks
OrganicEdgeRouterclass name unchanged
Properties in class OrganicEdgeRouter
createNodeEnlargementStageallowMovingNodesEnabling the new property has the same effect as previously appending the stage created by the removed factory method.
edgeNodeOverlapsAllowedallowEdgeNodeOverlaps
OrganicEdgeRouterDataOrganicEdgeRouterData<TNode,TEdge,TNodeLabel,TEdgeLabel>
Properties in class OrganicEdgeRouterData
abortHandlerremovedA LayoutAbortController is exposed by the LayoutExecutor; see Section Maximum Duration and Aborting of Algorithms for details.
affectedEdgesscope.edgesMoved to sub-data scope. See section below (Scope) and general information about scope migration in Scope and Affected Items.

Changed Default Values and Behavior Changes

Port placement now considers the specified port candidates. The ports are placed in a post-processing step by the PortPlacementStage. Port candidates can be specified using the properties on the sub-data OrganicEdgeRouterData.ports. See also the section Ports.

Scope

yFiles for HTML 3.0 introduces more powerful options to configure the scope (the set of edges to route) of the organic router. The new scope property offers functionality to specify the affected edges directly or based on their incident nodes.

For more information on changes to the Scope API, see Scope and Affected Items.

Running OrganicEdgeRouter with a restricted scope
const organicEdgeRouter = new OrganicEdgeRouter()
const organicRouterData = organicEdgeRouter.createLayoutData(graph)
organicRouterData.scope.edges.predicate = (edge) => {
  if (edge === edge1 || edge === edge2) {
    // edge1 and edge2 are routed
    return true
  }
  // all others are not routed
  return false
}

// additionally, all edges incident to node1 are routed as well
organicRouterData.scope.incidentNodes.items.add(node)

const organicEdgeRouter = new OrganicEdgeRouter()
const organicRouterData = organicEdgeRouter.createLayoutData(graph)
organicRouterData.scope.edges.predicate = (edge: any) => {
  if (edge === edge1 || edge === edge2) {
    // edge1 and edge2 are routed
    return true
  }
  // all others are not routed
  return false
}

// additionally, all edges incident to node1 are routed as well
organicRouterData.scope.incidentNodes.items.add(node)