@@ -37,6 +37,17 @@ def save_data(click_s, ind_image):
3737 print (xy , ind_image )
3838
3939
40+ @view .app .callback (
41+ Output ('radio' , 'options' ),
42+ [Input ('next' , 'n_clicks' ),
43+ Input ('previous' , 'n_clicks' )]
44+ )
45+ def refresh_radio_buttons (click_n , click_p ):
46+ if not (click_n or click_p ):
47+ return dash .no_update
48+ return view .refresh_radio_buttons ()
49+
50+
4051@view .app .callback (
4152 [Output ('canvas' , 'figure' ),
4253 Output ('radio' , 'value' ),
@@ -66,7 +77,6 @@ def update_image(clickData, relayoutData, click_n, click_p, click_c, slider_val,
6677
6778 if ind_image is None : ind_image = 0
6879 shapes = [] if shapes is None else json .loads (shapes )
69- n_bpt = view .options .index (option )
7080
7181 ctx = dash .callback_context
7282 event = ctx .triggered [0 ]['prop_id' ]
@@ -124,6 +134,7 @@ def update_image(clickData, relayoutData, click_n, click_p, click_c, slider_val,
124134 elif 'autorange' in key :
125135 view .fig .update_xaxes (autorange = True )
126136 view .fig .update_yaxes (autorange = 'reversed' )
137+ n_bpt = view .options .index (option )
127138 if button_id != 'slider' and 'relayout' not in event :
128139 n_bpt += 1
129140 new_option = view .options [min (len (view .options ) - 1 , n_bpt )]
0 commit comments