Skip to content

Commit

Permalink
All buttons are now working
Browse files Browse the repository at this point in the history
  • Loading branch information
bhilbert4 committed Mar 17, 2024
1 parent 7ab4f50 commit 2e32ea9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions jwql/utils/interactive_preview_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
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 @@ -555,7 +554,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_change('labels', CustomJS(args={'i1': images[0], 'c1': color_bars[0],
scale_group.js_on_change('active', 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 @@ -595,10 +594,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_event(events.ButtonClick, limit_reset)
reset.js_on_event('button_click', limit_reset)

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

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

0 comments on commit 2e32ea9

Please sign in to comment.