This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. See the Extensions intro page for more information.
Optional
init: Partial<LinkLabelRouter>Properties of the underlying custom ForceDirectedLayout for this router.
Margin that will be applied to each link label when checking for overlaps. The default value is 0 on all sides.
Override
canDetermines which GraphObjects in Panel.elements list of each link should be treated as labels. By default this consists of all objects that are not the "main path" of the link, and are not fromArrows or toArrows.
Override
route
A custom Router for reducing overlaps between label objects on links by moving them apart with a custom ForceDirectedLayout. You can modify the properties of that Layout by setting layoutProps in the constructor.
By default, this router considers a "link label" to be any GraphObject that is part of a Link which is not a path Shape or an arrowhead. You can customize objects that the router operates on by overriding LinkLabelRouter.isLabel.
This Router will override the Spot.offsetX and Spot.offsetY of the GraphObject.alignmentFocus value for all link labels.
Typical setup:
If you want to experiment with this extension, try the LinkLabelRouter sample.