code: function cropConnection(connection, newWaypoints) {
  
      // crop connection, if docking service is provided only
      if (!connectionDocking) {
        return newWaypoints;
      }
  
      var oldWaypoints = connection.waypoints,
          croppedWaypoints;
  
      // temporary set new waypoints
      connection.waypoints = newWaypoints;
  
      croppedWaypoints = connectionDocking.getCroppedWaypoints(connection);
  
      // restore old waypoints
      connection.waypoints = oldWaypoints;
  
      return croppedWaypoints;
    }
docs: Crop connection if connection cropping is provided.
  
  @param {Connection} connection
  @param {Array<Point>} newWaypoints
  
  @return {Array<Point>} cropped connection waypoints