Fix datetime clipping on RangeXY stream
@@ -668,23 +668,23 @@ class RangeXYCallback(Callback):
data = {}
if 'x0' in msg and 'x1' in msg:
x0, x1 = msg['x0'], msg['x1']
- if x0 > x1:
- x0, x1 = x1, x0
if isinstance(self.plot.handles.get('xaxis'), DatetimeAxis):
if not isinstance(x0, datetime_types):
x0 = convert_timestamp(x0)
if not isinstance(x1, datetime_types):
x1 = convert_timestamp(x1)
+ if x0 > x1:
+ x0, x1 = x1, x0
data['x_range'] = (x0, x1)
if 'y0' in msg and 'y1' in msg:
y0, y1 = msg['y0'], msg['y1']
- if y0 > y1:
- y0, y1 = y1, y0
if isinstance(self.plot.handles.get('yaxis'), DatetimeAxis):
if not isinstance(y0, datetime_types):
y0 = convert_timestamp(y0)
if not isinstance(y1, datetime_types):
y1 = convert_timestamp(y1)
+ if y0 > y1:
+ y0, y1 = y1, y0
data['y_range'] = (y0, y1)
return self._transform(data)
