code: function(x, y, opt) {
  
          var position = {};
  
          var localOpt = opt || {};
          if (opt) position.args = opt;
  
          var isDistanceRelative = !localOpt.absoluteDistance; // relative by default
          var isDistanceAbsoluteReverse = (localOpt.absoluteDistance && localOpt.reverseDistance); // non-reverse by default
          var isOffsetAbsolute = localOpt.absoluteOffset; // offset is non-absolute by default
  
          var path = this.path;
          var pathOpt = { segmentSubdivisions: this.getConnectionSubdivisions() };
  
          var labelPoint = new g.Point(x, y);
          var t = path.closestPointT(labelPoint, pathOpt);
  
          // GET DISTANCE:
  
          var labelDistance = path.lengthAtT(t, pathOpt);
          if (isDistanceRelative) labelDistance = (labelDistance / this.getConnectionLength()) || 0; // fix to prevent NaN for 0 length
          if (isDistanceAbsoluteReverse) labelDistance = (-1 * (this.getConnectionLength() - labelDistance)) || 1; // fix for end point (-0 => 1)
  
          position.distance = labelDistance;
  
          // GET OFFSET:
          // use absolute offset if:
          // - opt.absoluteOffset is true,
          // - opt.absoluteOffset is not true but there is no tangent
  
          var tangent;
          if (!isOffsetAbsolute) tangent = path.tangentAtT(t);
  
          var labelOffset;
          if (tangent) {
              labelOffset = tangent.pointOffset(labelPoint);
  
          } else {
              var closestPoint = path.pointAtT(t);
              var labelOffsetDiff = labelPoint.difference(closestPoint);
              labelOffset = { x: labelOffsetDiff.x, y: labelOffsetDiff.y };
          }
  
          position.offset = labelOffset;
  
          return position;
      }
docs: accepts options `absoluteDistance: boolean`, `reverseDistance: boolean`, `absoluteOffset: boolean` to move beyond connection endpoints, absoluteOffset has to be set