function sortByDistance(a, b) {
  const deltaA = squaredDistanceToSegment(this.pixelCoordinate_, a.segment);
  const deltaB = squaredDistanceToSegment(this.pixelCoordinate_, b.segment);
  return deltaA - deltaB;
}
function sortByDistance(a, b) {
  const deltaA = squaredDistanceToSegment(this.pixelCoordinate_, a.segment);
  const deltaB = squaredDistanceToSegment(this.pixelCoordinate_, b.segment);
  return deltaA - deltaB;
}
function sortByDistance ( a , b ) { const deltaA = squaredDistanceToSegment ( this . pixelCoordinate_ , a . segment ) ; const deltaB = squaredDistanceToSegment ( this . pixelCoordinate_ , b . segment ) ; return deltaA - deltaB ; }
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}
Sort segments by distance helper function
Sort by distance from one segment to another