docstr: Downsample to `n_out` points using the log variant of the LTTB algorithm.
  
  Parameters
  ----------
  x : np.ndarray
      The x-values of the data.
  y : np.ndarray
      The y-values of the data.
  n_out : int
      The number of points to downsample to.
  
  Returns
  -------
  np.ndarray
      The indices of the downsampled data.
docstr_tok: ["Downsample","to","`","n_out","`","points","using","the","log","variant","of","the","LTTB","algorithm",".","Parameters","--","--","--","--","--","x",":","np.ndarray","The","x-values","of","the","data",".","y",":","np.ndarray","The","y-values","of","the","data",".","n_out",":","int","The","number","of","points","to","downsample","to",".","Returns","--","--","--","-","np.ndarray","The","indices","of","the","downsampled","data","."]
code: def _arg_downsample(
      self,
      x: Union[np.ndarray, None],
      y: np.ndarray,
      n_out: int,
      **kwargs,
  ) -> np.ndarray:
      """Downsample to `n_out` points using the log variant of the LTTB algorithm.
  
      Parameters
      ----------
      x : np.ndarray
          The x-values of the data.
      y : np.ndarray
          The y-values of the data.
      n_out : int
          The number of points to downsample to.
  
      Returns
      -------
      np.ndarray
          The indices of the downsampled data.
      """
      # We need a valid x array to determine the x-range
      assert x is not None, "x cannot be None for this downsampler"
  
      # the log function to use
      lf = np.log1p
  
      offset = np.unique(
          np.searchsorted(
              x,
              np.exp(
                  np.linspace(lf(x[0]), lf(x[-1]), n_out + 1)
              ).astype(np.int64),
          )
      )
  
      # Construct the output array
      sampled_x = np.empty(len(offset) + 1, dtype="int64")
      sampled_x[0] = 0
      sampled_x[-1] = x.shape[0] - 1
  
      # Convert x & y to int if it is boolean
      if x.dtype == np.bool_:
          x = x.astype(np.int8)
      if y.dtype == np.bool_:
          y = y.astype(np.int8)
  
      a = 0
      for i in range(len(offset) - 2):
          a = (
              self._argmax_area(
                  prev_x=x[a],
                  prev_y=y[a],
                  avg_next_x=np.mean(x[offset[i + 1] : offset[i + 2]]),
                  avg_next_y=y[offset[i + 1] : offset[i + 2]].mean(),
                  x_bucket=x[offset[i] : offset[i + 1]],
                  y_bucket=y[offset[i] : offset[i + 1]],
              )
              + offset[i]
          )
          sampled_x[i + 1] = a
  
      # ------------ EDGE CASE ------------
      # next-average of last bucket = last point
      sampled_x[-2] = (
          self._argmax_area(
              prev_x=x[a],
              prev_y=y[a],
              avg_next_x=x[-1],  # last point
              avg_next_y=y[-1],
              x_bucket=x[offset[-2] : offset[-1]],
              y_bucket=y[offset[-2] : offset[-1]],
          )
          + offset[-2]
      )
      return sampled_x
  
imports: import numpy
  from plotly_resampler.aggregation.aggregation_interface import DataPointSelector
  from typing import Union
label_desc: Use image node_id 2 for calling the LogLTTB obj's underlying member method code with example usage: obj._arg_downsample(x, y, n_out) and returns: sampled_x