Skip to content

Commit

Permalink
Make sure limits are synced with glue state changes
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Sep 12, 2023
1 parent 88d0e65 commit 9779af8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions glue_jupyter/widgets/axes_limits.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import traitlets
import ipyvuetify as v
from echo import delay_callback
from ..link import dlink
from ..state_traitlets_helpers import GlueState

__all__ = ['AxesLimits']
Expand All @@ -19,6 +20,10 @@ class AxesLimits(v.VuetifyTemplate):
def __init__(self, viewer_state):
super().__init__()
self.glue_state = viewer_state
dlink((self.glue_state, 'x_min'), (self, 'x_min'))
dlink((self.glue_state, 'x_max'), (self, 'x_max'))
dlink((self.glue_state, 'y_min'), (self, 'y_min'))
dlink((self.glue_state, 'y_max'), (self, 'y_max'))

def vue_apply_limits(self, data):
self._cache = (self.x_min, self.x_max, self.y_min, self.y_max)
Expand Down

0 comments on commit 9779af8

Please sign in to comment.