12401240 ),
12411241 html .Div ("" , id = "synchronization_type_dependency" , style = {"display" :"none" }), # This is a hack to pass on a retrigger without causing infinite loops in the dependency chain
12421242 html .Div ("" , id = "page_parameters" , style = {"display" :"none" }), # This is an intermediate dependency to hold the parameters so we make it easier to update them
1243- html .Div ("" , id = "auto_import_parameters" , style = {"display" :"none" }),
1243+ html .Div ("" , id = "auto_import_parameters" , style = {"display" :"none" }), # This is a hidden area to set parameters to be loaded into the interface
12441244
12451245 dbc .Row ([
12461246 dbc .Col (
@@ -1979,6 +1979,7 @@ def update_usi(search, url_hash, filecontent_list, sychronization_load_session_b
19791979
19801980 return [usi , usi2 , "Using URL USI" , dash .no_update ]
19811981
1982+
19821983
19831984# Calculating which xic value to use
19841985@app .callback (Output ('xic_mz' , 'value' ),
@@ -2715,46 +2716,56 @@ def determine_plot_zoom_bounds(url_search, usi,
27152716 map_plot_rt_min , map_plot_rt_max , map_plot_mz_min , map_plot_mz_max , existing_map_plot_zoom ,
27162717 sychronization_session_id , setting_json_area ):
27172718
2719+
2720+ print ("ALL TRIGGERS" , [p ['prop_id' ] for p in dash .callback_context .triggered ], file = sys .stderr , flush = True )
2721+
27182722 triggered_id = [p ['prop_id' ] for p in dash .callback_context .triggered ][0 ]
27192723
27202724 usi_list = usi .split ("\n " )
2721- remote_link , local_filename = _resolve_usi (usi_list [0 ])
2725+ remote_link , local_filename = _resolve_usi (usi_list [0 ])
27222726
2723- # Figuring out the map plot selection
2724- if "map_plot_update_range_button" in triggered_id :
2725- # We clicked the button, so we should read the values out of the
2726- current_map_selection , highlight_box , min_rt , max_rt , min_mz , max_mz = _resolve_map_plot_selection (url_search ,
2727- usi ,
2728- local_filename ,
2729- ui_map_selection = map_selection ,
2730- map_plot_rt_min = map_plot_rt_min ,
2731- map_plot_rt_max = map_plot_rt_max ,
2732- map_plot_mz_min = map_plot_mz_min ,
2733- map_plot_mz_max = map_plot_mz_max )
2734- else :
2735- session_dict = {}
2727+ session_dict = {}
27362728
2737- if "sychronization_load_session_button" in triggered_id or "sychronization_interval" in triggered_id :
2738- try :
2739- session_dict = _sychronize_load_state (sychronization_session_id , redis_client )
2740- except :
2741- pass
2742-
2743- # We clicked the button so we are going to load from the text area
2744- if "advanced_import_update_button" in triggered_id :
2745- try :
2746- session_dict = json .loads (setting_json_area )
2747- except :
2748- pass
2729+ if "sychronization_load_session_button" in triggered_id or "sychronization_interval" in triggered_id :
2730+ try :
2731+ session_dict = _sychronize_load_state (sychronization_session_id , redis_client )
2732+ except :
2733+ pass
2734+
2735+ # We clicked the button so we are going to load from the text area
2736+ if "advanced_import_update_button" in triggered_id :
2737+ try :
2738+ session_dict = json .loads (setting_json_area )
2739+ except :
2740+ pass
27492741
2750- if "auto_import_parameters" in triggered_id :
2751- try :
2752- session_dict = json .loads (auto_import_parameters )
2753- except :
2754- pass
2742+ if "auto_import_parameters" in triggered_id :
2743+ try :
2744+ session_dict = json .loads (auto_import_parameters )
2745+ except :
2746+ pass
2747+
2748+ priority = "url"
27552749
2756- current_map_selection , highlight_box , min_rt , max_rt , min_mz , max_mz = _resolve_map_plot_selection (url_search , usi , local_filename , ui_map_selection = map_selection , session_dict = session_dict )
2750+ if "map-plot" in triggered_id :
2751+ priority = "ui"
27572752
2753+ if "map_plot_update_range_button" in triggered_id :
2754+ priority = "ui_update_range"
2755+
2756+ if "sychronization_load_session_button" in triggered_id or "sychronization_interval" in triggered_id or "advanced_import_update_button" in triggered_id or "auto_import_parameters" in triggered_id :
2757+ priority = "session"
2758+
2759+ current_map_selection , highlight_box , min_rt , max_rt , min_mz , max_mz = _resolve_map_plot_selection (url_search ,
2760+ usi ,
2761+ local_filename ,
2762+ ui_map_selection = map_selection ,
2763+ map_plot_rt_min = map_plot_rt_min ,
2764+ map_plot_rt_max = map_plot_rt_max ,
2765+ map_plot_mz_min = map_plot_mz_min ,
2766+ map_plot_mz_max = map_plot_mz_max ,
2767+ session_dict = session_dict ,
2768+ priority = priority )
27582769
27592770 current_map_plot_zoom_string = json .dumps (current_map_selection )
27602771
@@ -2767,9 +2778,9 @@ def determine_plot_zoom_bounds(url_search, usi,
27672778 except :
27682779 pass
27692780
2770- print ("MAP SELECTION" , map_selection , file = sys .stderr )
2771- print ("NEW SELECTION" , current_map_selection , highlight_box , file = sys .stderr )
2772- print ("EXISTING PLOT ZOOM" , existing_map_plot_zoom , file = sys .stderr )
2781+ print ("MAP SELECTION" , map_selection , file = sys .stderr , flush = True )
2782+ print ("NEW SELECTION" , current_map_selection , highlight_box , file = sys .stderr , flush = True )
2783+ print ("EXISTING PLOT ZOOM" , existing_map_plot_zoom , file = sys .stderr , flush = True )
27732784
27742785 return [current_map_plot_zoom_string , highlight_box_string , min_rt , max_rt , min_mz , max_mz ]
27752786
0 commit comments