glue-jupyter
glue-jupyter copied to clipboard
The vmin/vmax values of the profile layer immediatly switch back after editing
The vmin/vmax values of the profile layer immediatly switch back after editing. This also happens when changing form code:
In the browser devtools I see a websocket message with glue-state containing the new value, immediatly followed with a glue-state containing the old value.
I've tracked it down to: https://github.com/glue-viz/glue-jupyter/blob/030db61c725357dbbfd16cecbabbaad6071722dc/glue_jupyter/bqplot/profile/layer_artist.py#L94 After which the state contains the old value again
I can "fix" it with:
if self.state.v_min is None or self.state.v_max is None:
self.state.update_limits()
else:
self.state.update_profile(update_limits=False)
But then I don’t see the plot reflect the changes to v_min or v_max
--- a/glue_jupyter/bqplot/profile/layer_artist.py
+++ b/glue_jupyter/bqplot/profile/layer_artist.py
@@ -159,12 +159,12 @@ class BqplotProfileLayerArtist(LayerArtist):
if force or any(prop in changed for prop in ('layer', 'x_att', 'attribute',
'function', 'normalize',
- 'v_min', 'v_max')):
+ )):
self._calculate_profile(reset=force)
force = True
if force or any(prop in changed for prop in ('alpha', 'color', 'zorder',
- 'visible', 'linewidth')):
+ 'visible', 'linewidth', 'v_min', 'v_max')):
self._update_visual_attributes()
@defer_draw
This also fixes it, but I am not what it should do. Looking at the code, this should only affect normalized profiles, which is not yet supported in glue-jupyter.
These fields were removed from the profile viewer in #230 , this can be closed.