function lassoAppend(lasso, x, y) {
    let minDist = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;
    lasso = array$2(lasso);
    const last = lasso[lasso.length - 1];

    // Add point to lasso if its the first point or distance to last point exceed minDist
    return last === undefined || Math.hypot(last[0] - x, last[1] - y) > minDist ? [...lasso, [x, y]] : lasso;
  }
Appends a new point to the lasso

@param {*} lasso the lasso in pixel space
@param {*} x the x coordinate in pixel space
@param {*} y the y coordinate in pixel space
@param {*} minDist the minimum distance, in pixels, that thenew point needs to be apart from the last point
@returns a new array containing the lasso with the new point