Class AvoidsLinksRouter

GoJS® Diagramming Components
version 3.0.0-b1
by Northwoods Software®

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.

Hierarchy

A way of reducing the number of cases where link segments of orthogonal links overlap.

Typical setup:

  myDiagram.routers.add(new AvoidsLinksRouter());

If you want to experiment with this extension, try the AvoidsLinksRouter sample.

Index

Constructors

Accessors

  • Gets or sets whether the AvoidsLinksRouter should reduce spacing between separated Links to avoid overlap with nearby Nodes. If avoidsNodes is false, all separated links will have a distance of exactly linkSpacing, even if this causes them to cross over a nearby Node.

    The default value is true.

  • Gets or sets the number of times the AvoidsLinksRouter will run iteratively. In the vast majority of cases, one iteration should be enough and this parameter should not need to be modified. Multiple iterations may be useful when numerous links coincide, particularly when they are close to Nodes with avoidsNodes set to true.

    The default value is 1.

  • Gets or sets the desired distance between Links that are separated by AvoidsLinksRouter. If avoidsNodes is true, this value is the maximum allowed distance between such links, but the distance could be smaller to avoid overlapping Nodes.

    The default value is 4.

Methods

  • Returns _SegInfo

  • Parameters

    • si: _SegInfo
    • index: number
    • vertical: number

    Returns number

  • Parameters

    • si: _SegInfo

    Returns number

  • Parameters

    • si: _SegInfo

    Returns number

  • Parameters

    • si: _SegInfo

    Returns number

  • Parameters

    • si: _SegInfo

    Returns void

  • Parameters

    • positions: any

    Returns void

  • Only route once, at the top level

    Parameters

    Returns boolean

  • Parameters

    • seg1: _SegInfo
    • seg2: _SegInfo
    • idx1: number
    • idx2: number

    Returns number

  • Parameters

    • a: number
    • b: number

    Returns boolean

  • Parameters

    • arr: any[]
    • start: number
    • end: number
    • f: ((a: any, b: any) => number)
        • (a: any, b: any): number
        • Parameters

          • a: any
          • b: any

          Returns number

    Returns any[]

  • Because of canRoute, the first argument here is always a Diagram.

    Parameters

    Returns void

  • Parameters

    • link: Link
    • index: number
    • vertical: boolean

    Returns boolean

  • Parameters

    • link: Link
    • index: number

    Returns boolean

  • Parameters

    • link: Link
    • index: number

    Returns boolean

  • Parameters

    • gridline: any

    Returns void