Skip to content

Commit

Permalink
Move x_range check down
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Dec 20, 2023
1 parent 5fc5e73 commit 662cc90
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions holoviews/operation/downsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ class downsample1d(ResampleOperation1D):
algorithm = param.Selector(default='lttb', objects=list(_ALGORITHMS))

def _process(self, element, key=None):
if not self.p.x_range:
# We don't want to send all the data to the frontend on the first pass
# if we have set xlims. Therefore we return the element without any data,
# this will render the plot and trigger a second pass with the x_range set.
return element[()]
if isinstance(element, (Overlay, NdOverlay)):
_process = partial(self._process, key=key)
if isinstance(element, Overlay):
Expand All @@ -195,6 +190,11 @@ def _process(self, element, key=None):
self.param.warning(f"Could not apply neighbor mask to downsample1d: {e}")
mask = slice(*self.p.x_range)
element = element[mask]
else:
# We don't want to send all the data to the frontend on the first pass
# if we have set xlims. Therefore we return the element without any data,
# this will render the plot and trigger a second pass with the x_range set.
return element[()]

if len(element) <= self.p.width:
return element
Expand Down

0 comments on commit 662cc90

Please sign in to comment.