class_docstr: Implements downsampling of a regularly sampled 1D dataset.
  
  Supports multiple algorithms:
  
      - `lttb`: Largest Triangle Three Buckets downsample algorithm
      - `nth`: Selects every n-th point.
class_docstr_tok: ["Implements","downsampling","of","a","regularly","sampled","1D","dataset",".","Supports","multiple","algorithms",":","-","`","lttb","`",":","Largest","Triangle","Three","Buckets","downsample","algorithm","-","`","nth","`",":","Selects","every","n-th","point","."]
code: def _process(self, element, key=None):
      if isinstance(element, (Overlay, NdOverlay)):
          _process = partial(self._process, key=key)
          if isinstance(element, Overlay):
              elements = [v.map(_process) for v in element]
          else:
              elements = {
                  k: v.map(_process) for k, v in element.items()
              }
          return element.clone(elements)
  
      if self.p.x_range:
          element = element[slice(*self.p.x_range)]
      if len(element) <= self.p.width:
          return element
      xs, ys = (element.dimension_values(i) for i in range(2))
      if ys.dtype == np.bool_:
          ys = ys.astype(np.int8)
      downsample = _ALGORITHMS[self.p.algorithm]
      if self.p.algorithm == "lttb" and isinstance(element, Area):
          raise NotImplementedError(
              "LTTB algorithm is not implemented for hv.Area"
          )
      samples = downsample(xs, ys, self.p.width)
      return element.iloc[samples]
  
file_path: holoviews/holoviews/operation/downsample.py
imports: import math
  from functools import partial
  import numpy
  import param
  from ..core import NdOverlay, Overlay
  from ..element.chart import Area
  from .resample import ResampleOperation1D
label_desc: Use image node_id 1 for calling the downsample1d obj's underlying member method code with example usage: obj._process(element, key) and returns: element, element, element