code: function sortByDistance(a, b) {
    const deltaA = squaredDistanceToSegment(this.pixelCoordinate_, a.segment);
    const deltaB = squaredDistanceToSegment(this.pixelCoordinate_, b.segment);
    return deltaA - deltaB;
  }
docs: Sort segments by distance, helper function
  @param {SegmentData} a The first segment data.
  @param {SegmentData} b The second segment data.
  @return {number} The difference in distance.
  @this {Snap}