Search code examples
javascriptattributesdiagramjointjs

What is the exact meaning of the perpendicularLinks attribute?


In JointJS there is a perpendicularLinks parameter which "make links tend to get perpendicular to their associated objects".

This is not so clear for me. Anyone knows what is this option ?


Solution

  • The perpendicularLinks option determines wether the last segment of the link should point to the center of the target object or be a horizontal/vertical line rather than a diagonal one. If perpendicularLinks is true, the link does not necessarily points to the center of the target object but to the closest point on the boundary of the target object where the last segment of the link is perpendicular.

    Better than words, see the following images:

    perpendicularLinks: false

    enter image description here

    perpendicularLinks: true

    enter image description here