OrganicEdgeRouter produces extreme bends |
| Applies to: yFiles 2.5, yFiles 2.4 |
Type: Troubleshooting
Categories this article belongs to:
| yFiles for Java | > yFiles Layout | > Automatic Graph Layout | > Organic Edge Routing |
This article describes a problem which might occur when OrganicEdgeRouter shall route edges inside graphs, where nodes are close to each other and shows how to avoid it.
For OrganicEdgeRouter
to function properly it has to be guaranteed that nodes are at least approximately twice as far away from each other as the minimal edge distance
, which has been set for this algorithm. If this is not the case this might lead to very long edges and extreme bends.
To achieve the right behavior, one can prepend a layout stage which is provided by OrganicEdgeRouter's method createNodeEnlargementStage()
in combination with a stage that removes node overlaps as the core of this layouter.
The following code snippet shows how to prepend these stages to the router:
To achieve the right behavior, one can prepend a layout stage which is provided by OrganicEdgeRouter's method createNodeEnlargementStage()
The following code snippet shows how to prepend these stages to the router:
OrganicEdgeRouter router = new OrganicEdgeRouter(); CompositeLayoutStage cls = new CompositeLayoutStage(); cls.appendStage(router.createNodeEnlargementStage()); cls.appendStage(new BendConverter()); cls.appendStage(new RemoveOverlapsLayoutStage(0)); router.setCoreLayouter(cls); //router.doLayout(myGraph); |
| Keywords: | OrganicEdgeRouter - route - edges - edge - bends - organic - router |


