@@ -2238,9 +2238,8 @@ def on_select(min: float, max: float) -> Any
22382238 If `True`, the event triggered outside the span selector will be
22392239 ignored.
22402240
2241- snap_values : 1D array-like, default: None
2242- Snap the extents of the selector to the values defined in
2243- ``snap_values``.
2241+ snap_values : 1D array-like, optional
2242+ Snap the selector edges to the given values.
22442243
22452244 Examples
22462245 --------
@@ -2585,12 +2584,11 @@ def _contains(self, event):
25852584 @staticmethod
25862585 def _snap (values , snap_values ):
25872586 """Snap values to a given array values (snap_values)."""
2588- indices = np .empty_like (values , dtype = "uint" )
25892587 # take into account machine precision
25902588 eps = np .min (np .abs (np .diff (snap_values ))) * 1e-12
2591- for i , v in enumerate ( values ):
2592- indices [ i ] = np .abs (snap_values - v + np .sign (v ) * eps ).argmin ()
2593- return snap_values [ indices ]
2589+ return tuple (
2590+ snap_values [ np .abs (snap_values - v + np .sign (v ) * eps ).argmin ()]
2591+ for v in values )
25942592
25952593 @property
25962594 def extents (self ):
@@ -2874,7 +2872,6 @@ def onselect(eclick: MouseEvent, erelease: MouseEvent)
28742872 use_data_coordinates : bool, default: False
28752873 If `True`, the "square" shape of the selector is defined in
28762874 data coordinates instead of display coordinates.
2877-
28782875 """
28792876
28802877
0 commit comments