• Public
  • Public/Protected
  • All

Class DimensioningLink

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. Extensions can be found in the GoJS kit under the extensions or extensionsTS folders. See the Extensions intro page for more information.


A custom routed Link for showing the distances between a point on one node and a point on another node.

Note that because this is a Link, the points being measured must be on Nodes, not simple Parts. The exact point on each Node is determined by the Link.fromSpot and Link.toSpot.

Several properties of the DimensioningLink customize the appearance of the dimensioning: direction, for orientation of the dimension line and which side it is on, extension, for how far the dimension line is from the measured points, inset, for leaving room for a text label, and gap, for distance that the extension line starts from the measured points.

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





direction : number

  • The general angle at which the measurement should be made.

    The default value is 0, meaning to go measure only along the X axis, with the dimension line and label above the two nodes (at lower Y coordinates). New values must be one of: 0, 90, 180, 270, or NaN. The value NaN indicates that the measurement is point-to-point and not orthogonal.

extension : number

  • The distance at which the dimension line should be from the points being measured.

    The default value is 30. Larger values mean further away from the nodes. The new value must be greater than or equal to zero.

gap : number

  • The distance that the extension lines should come short of the measured points.

    The default value is 10.

inset : number

  • The distance that the dimension line should be "indented" from the ends of the extension lines that are orthogonal to the dimension line.

    The default value is 10.


Override cloneProtected

  • cloneProtected(copy: this): void
  • Copies properties to a cloned DimensioningLink.


    • copy: this

    Returns void

Override computePoints

  • computePoints(): boolean
  • Constructs the link's route by modifying points.

    Returns boolean

    true if it computed a route of points