class_docstr: Gap handling based on the median diff of the x_agg array.
class_docstr_tok: ["Gap","handling","based","on","the","median","diff","of","the","x_agg","array","."]
docstr: Get a boolean mask indicating the indices where there are gaps.
  
  If you require custom gap handling, you can implement this method to return a
  boolean mask indicating the indices where there are gaps.
  
  Parameters
  ----------
  x_agg: np.ndarray
      The x array. This is used to determine the gaps.
  
  Returns
  -------
  Optional[np.ndarray]
      A boolean mask indicating the indices where there are gaps. If there are no
      gaps, None is returned.
docstr_tok: ["Get","a","boolean","mask","indicating","the","indices","where","there","are","gaps",".","If","you","require","custom","gap","handling",",","you","can","implement","this","method","to","return","a","boolean","mask","indicating","the","indices","where","there","are","gaps",".","Parameters","--","--","--","--","--","x_agg",":","np.ndarray","The","x","array",".","This","is","used","to","determine","the","gaps",".","Returns","--","--","--","-","Optional","[","np.ndarray","]","A","boolean","mask","indicating","the","indices","where","there","are","gaps",".","If","there","are","no","gaps",",","None","is","returned","."]
code: def _get_gap_mask(self, x_agg: np.ndarray) -> Optional[np.ndarray]:
      """Get a boolean mask indicating the indices where there are gaps.
  
      If you require custom gap handling, you can implement this method to return a
      boolean mask indicating the indices where there are gaps.
  
      Parameters
      ----------
      x_agg: np.ndarray
          The x array. This is used to determine the gaps.
  
      Returns
      -------
      Optional[np.ndarray]
          A boolean mask indicating the indices where there are gaps. If there are no
          gaps, None is returned.
  
      """
      med_diff, x_diff = self._calc_med_diff(x_agg)
  
      # TODO: this 4 was revealed to me in a dream, but it seems to work well
      # After some consideration, we altered this to a 4.1
      gap_mask = x_diff > 4.1 * med_diff
      if not any(gap_mask):
          return
      return gap_mask
  
file_path: plotly-resampler/plotly_resampler/aggregation/gap_handlers.py
imports: from __future__ import annotations
  from typing import Optional, Tuple
  import numpy
  from plotly_resampler.aggregation.gap_handler_interface import AbstractGapHandler
label_desc: Use image node_id 2 for calling the MedDiffGapHandler obj's underlying member method code with example usage: obj._get_gap_mask(x_agg) and returns: gap_mask