Skip to content

Commit

Permalink
interactive preview fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bhilbert4 committed Mar 15, 2024
1 parent 03a687e commit 7ab4f50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jwql/utils/interactive_preview_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from astropy.io import fits
from astropy.visualization import ZScaleInterval, MinMaxInterval, PercentileInterval
from astropy.wcs import WCS
from bokeh import events
from bokeh.embed import components
from bokeh.layouts import gridplot, layout
from bokeh.models import (
Expand Down Expand Up @@ -554,7 +555,7 @@ def add_interactive_controls(self, images, color_bars):
# JS callbacks for client side controls

# set alternate image visibility when scale selection changes
scale_group.js_on_click(CustomJS(args={'i1': images[0], 'c1': color_bars[0],
scale_group.js_on_change('labels', CustomJS(args={'i1': images[0], 'c1': color_bars[0],
'i2': images[1], 'c2': color_bars[1]},
code="""
if (i1.visible == true) {
Expand Down Expand Up @@ -594,10 +595,10 @@ def add_interactive_controls(self, images, color_bars):
limit_high.js_link('value', color_bars[i].color_mapper, 'high')

# reset boxes to preset range on button click
reset.js_on_click(limit_reset)
reset.js_on_event(events.ButtonClick, limit_reset)

# also reset when swapping limit style
scale_group.js_on_click(limit_reset)
scale_group.js_on_change('labels', limit_reset)

# return widgets
spacer = Spacer(height=20)
Expand Down

0 comments on commit 7ab4f50

Please sign in to comment.