function calculateLinePointsOutsideCanvas(
  type,
  shapePointNavigation,
  shapeNeighborPointNavigation
) {
  let minimumPoint = 0;
  let minimumPointIndex = 0;
  forEach(shapePointNavigation, (point, index) => {
    if (point[type] < minimumPoint) {
      minimumPoint = point[type];
      minimumPointIndex = index;
    }
  });

  const [endPointIndex1, endPointIndex2] = shapeNeighborPointNavigation[minimumPointIndex];

  return {
    startPointIndex: minimumPointIndex,
    endPointIndex1,
    endPointIndex2,
  };
}
Calculate a point line outside the canvas.
@param {string} type - 'x' or 'y'
@param {Array} shapePointNavigation - shape edge positions
  @param {Object} shapePointNavigation.lefttop - left top position
  @param {Object} shapePointNavigation.righttop - right top position
  @param {Object} shapePointNavigation.leftbottom - lefttop position
  @param {Object} shapePointNavigation.rightbottom - rightbottom position
@param {Array} shapeNeighborPointNavigation - Array to find adjacent edges.
@returns {Object}