@@ -333,14 +333,14 @@ def sky_plot() -> figure:
333333 _p_sky = figure (title = 'Sky Plot' , outer_height = 500 ,
334334 active_scroll = 'wheel_zoom' , active_drag = 'box_zoom' ,
335335 tools = 'pan,wheel_zoom,box_zoom,box_select,reset' ,
336- sizing_mode = 'stretch_width' , x_range = [ - 180 , 180 ] , y_range = [ - 90 , 90 ] )
336+ sizing_mode = 'stretch_width' , x_range = Range1d ( - 180 , 180 ) , y_range = Range1d ( - 90 , 90 ) )
337337
338338 # background for skyplot
339339 _p_sky .ellipse (x = 0 , y = 0 , width = 360 , height = 180 , color = '#444444' , name = 'background' )
340340
341341 # scatter plot for sky plot
342- circle = _p_sky .circle ( source = full_cds , x = 'ra_projected' , y = 'dec_projected' ,
343- size = 6 , name = 'circle' , color = 'ghostwhite' )
342+ circle = _p_sky .scatter ( marker = 'circle' , source = full_cds , x = 'ra_projected' , y = 'dec_projected' ,
343+ size = 6 , name = 'circle' , color = 'ghostwhite' )
344344
345345 # bokeh tools for sky plot
346346 this_hover = HoverTool (renderers = [circle , ], tooltips = tooltips )
@@ -367,7 +367,8 @@ def colour_colour_plot() -> Tuple[figure, Toggle, Toggle, Select, Select]:
367367 _p_colour_colour = bokeh_formatter (_p_colour_colour )
368368
369369 # scatter plot for colour-colour
370- full_plot = _p_colour_colour .circle (x = x_full_name , y = y_full_name , source = full_cds , size = 6 , color = cmap )
370+ full_plot = _p_colour_colour .scatter (marker = 'circle' , x = x_full_name , y = y_full_name , source = full_cds , size = 6 ,
371+ color = cmap )
371372
372373 # colour bar for colour-colour plot
373374 cbar = ColorBar (color_mapper = cmap ['transform' ], label_standoff = 12 ,
@@ -395,6 +396,8 @@ def colour_colour_plot() -> Tuple[figure, Toggle, Toggle, Select, Select]:
395396 args = {'full_plot' : full_plot , 'full_data' : full_cds .data ,
396397 'y_button' : _button_y_flip , 'y_axis' : _p_colour_colour .yaxis [0 ],
397398 'y_range' : _p_colour_colour .y_range }))
399+ _p_colour_colour .js_on_event ('reset' , CustomJS (args = dict (dropdown_x = _dropdown_x , dropdown_y = _dropdown_y ),
400+ code = js_callbacks .reset_dropdown ))
398401 return _p_colour_colour , _button_x_flip , _button_y_flip , _dropdown_x , _dropdown_y
399402
400403 def colour_absolute_magnitude_diagram () -> Tuple [figure , Toggle , Toggle , Select , Select ]:
@@ -413,7 +416,8 @@ def colour_absolute_magnitude_diagram() -> Tuple[figure, Toggle, Toggle, Select,
413416 _p_camd = bokeh_formatter (_p_camd )
414417
415418 # scatter plot for camd
416- full_mag_plot = _p_camd .circle (x = x_full_name , y = y_full_name , source = full_cds , size = 6 , color = cmap )
419+ full_mag_plot = _p_camd .scatter (marker = 'circle' , x = x_full_name , y = y_full_name , source = full_cds , size = 6 ,
420+ color = cmap )
417421
418422 # colour bar for camd
419423 cbar = ColorBar (color_mapper = cmap ['transform' ], label_standoff = 12 ,
@@ -439,6 +443,8 @@ def colour_absolute_magnitude_diagram() -> Tuple[figure, Toggle, Toggle, Select,
439443 args = {'full_plot' : full_mag_plot ,
440444 'full_data' : full_cds .data , 'y_button' : _button_mag_y_flip ,
441445 'y_axis' : _p_camd .yaxis [0 ], 'y_range' : _p_camd .y_range }))
446+ _p_camd .js_on_event ('reset' , CustomJS (args = dict (dropdown_x = _dropdown_mag_x , dropdown_y = _dropdown_mag_y ),
447+ code = js_callbacks .reset_dropdown ))
442448 return _p_camd , _button_mag_x_flip , _button_mag_y_flip , _dropdown_mag_x , _dropdown_mag_y
443449
444450 # gather all necessary data including parallaxes, spectral types and bands
@@ -491,8 +497,8 @@ def colour_absolute_magnitude_diagram() -> Tuple[figure, Toggle, Toggle, Select,
491497 absmagnames = absmagnames [~ np .isin (absmagnames , bad_cols )]
492498 absmag_shown_name = [name_simplifier (mag ) for mag in absmagnames ]
493499 dropdown_menu_mag = [* zip (absmagnames , absmag_shown_name )]
494- y_full_name = absmagnames [0 ]
495- y_shown_name = absmag_shown_name [0 ]
500+ y_full_name = absmagnames [1 ]
501+ y_shown_name = absmag_shown_name [1 ]
496502
497503 # camd plot
498504 p_camd , button_mag_x_flip , button_mag_y_flip , dropdown_mag_x , dropdown_mag_y = colour_absolute_magnitude_diagram ()
@@ -650,13 +656,13 @@ def camd_plot(query: str, everything: Inventory, all_bands: np.ndarray, all_resu
650656
651657 # scatter plot for given object
652658 this_cds = ColumnDataSource (data = this_photometry )
653- this_plot = p .square ( x = x_full_name , y = y_full_name , source = this_cds ,
654- color = cmap , size = 20 ) # plot for this object
659+ this_plot = p .scatter ( marker = 'square' , x = x_full_name , y = y_full_name , source = this_cds ,
660+ color = cmap , size = 20 ) # plot for this object
655661
656662 # scatter plot for all data
657663 cds_full = ColumnDataSource (data = all_results_full ) # bokeh cds object
658- full_plot = p .circle ( x = x_full_name , y = y_full_name , source = cds_full ,
659- color = cmap , alpha = 0.5 , size = 6 ) # plot all objects
664+ full_plot = p .scatter ( marker = 'circle' , x = x_full_name , y = y_full_name , source = cds_full ,
665+ color = cmap , alpha = 0.5 , size = 6 ) # plot all objects
660666 full_plot .level = 'underlay' # put full plot underneath this plot
661667
662668 # colour bar
@@ -683,6 +689,8 @@ def camd_plot(query: str, everything: Inventory, all_bands: np.ndarray, all_resu
683689 args = {'full_plot' : full_plot , 'this_plot' : this_plot ,
684690 'full_data' : cds_full .data , 'y_button' : button_y_flip ,
685691 'y_axis' : p .yaxis [0 ], 'y_range' : p .y_range }))
692+ p .js_on_event ('reset' , CustomJS (args = dict (dropdown_x = dropdown_x , dropdown_y = dropdown_y ),
693+ code = js_callbacks .reset_dropdown ))
686694
687695 # creating bokeh layout and html
688696 plots = column (p , row (dropdown_x ,
@@ -705,6 +713,6 @@ def main_plots():
705713
706714
707715if __name__ == '__main__' :
708- ARGS , DB_FILE , PHOTOMETRIC_FILTERS , ALL_RESULTS , ALL_RESULTS_FULL , VERSION_STR ,\
716+ ARGS , DB_FILE , PHOTOMETRIC_FILTERS , ALL_RESULTS , ALL_RESULTS_FULL , VERSION_STR , \
709717 ALL_PHOTO , ALL_BANDS , ALL_PLX , ALL_SPTS = main_utils ()
710718 NIGHTSKYTHEME , JSCALLBACKS = main_plots ()
0 commit comments