Skip to content

Commit edcb816

Browse files
authored
Merge pull request #345 from astrofrog/fix-limits-sync
Don't set scale limits if glue state limits are None
2 parents 1d273cf + 9697545 commit edcb816

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

glue_jupyter/bqplot/common/viewer.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from ...view import IPyWidgetView
1313
from ...link import on_change
14-
from ...utils import float_or_none, debounced, get_ioloop
14+
from ...utils import debounced, get_ioloop
1515
from .tools import ROIClickAndDrag
1616

1717
__all__ = ['BqplotBaseView']
@@ -106,13 +106,15 @@ def _update_bqplot_limits(self, *args):
106106
# doesn't change this - at the end of the day, the two scales are
107107
# separate widgets so will result in two updates.
108108

109-
with self.scale_x.hold_sync():
110-
self.scale_x.min = float_or_none(self.state.x_min)
111-
self.scale_x.max = float_or_none(self.state.x_max)
109+
if self.state.x_min is not None and self.state.x_max is not None:
110+
with self.scale_x.hold_sync():
111+
self.scale_x.min = float(self.state.x_min)
112+
self.scale_x.max = float(self.state.x_max)
112113

113-
with self.scale_y.hold_sync():
114-
self.scale_y.min = float_or_none(self.state.y_min)
115-
self.scale_y.max = float_or_none(self.state.y_max)
114+
if self.state.y_min is not None and self.state.y_max is not None:
115+
with self.scale_y.hold_sync():
116+
self.scale_y.min = float(self.state.y_min)
117+
self.scale_y.max = float(self.state.y_max)
116118

117119
self._last_limits = (self.state.x_min, self.state.x_max,
118120
self.state.y_min, self.state.y_max)

0 commit comments

Comments
 (0)