glue-jupyter icon indicating copy to clipboard operation
glue-jupyter copied to clipboard

The vmin/vmax values of the profile layer immediatly switch back after editing

Open mariobuikhuizen opened this issue 5 years ago • 2 comments

The vmin/vmax values of the profile layer immediatly switch back after editing. This also happens when changing form code:

Schermafbeelding 2020-09-01 om 18 05 32

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

mariobuikhuizen avatar Sep 08 '20 15:09 mariobuikhuizen

--- 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.

maartenbreddels avatar Sep 17 '20 13:09 maartenbreddels

These fields were removed from the profile viewer in #230 , this can be closed.

rosteen avatar Jun 22 '21 13:06 rosteen