示例#1
0
    elif (0 not in cb_obj.active):
        red_glyphs[tabs.active].line_alpha = 0.0
    # blue glyphs on
    if (1 in cb_obj.active):
        blue_glyphs[tabs.active].line_alpha = 0.5
    # blue glyphs off
    elif (1 not in cb_obj.active):
        blue_glyphs[tabs.active].line_alpha = 0.0


# linkages
coalesced_callback = CustomJS.from_py_func(
    fun_callback)  # only convert to JS once!
tabs.callback = coalesced_callback
widget_object_types.callback = coalesced_callback
widget_types_types.callback = coalesced_callback
widget_galaxy_type.callback = coalesced_callback
widget_plot_types.callback = CustomJS.from_py_func(
    plot_types_callback
)  # this can go straight in (unlike coalesced) since only one idget calls it; it only gets instanced once

# final panel building
widget_group_one = widgetbox(children=[
    widget_telescope_sizes, widget_object_types, widget_types_types,
    widget_galaxy_type
])
widget_group_two = layout([[widget_mag_input],
                           [widget_filters, widget_mag_type]])
widget_group_three = widgetbox(children=[
    widget_grating_types, widget_redshift, widget_exposure_time, widget_seeing,
    widget_slit_width, widget_moon_days_header, widget_moon_days,
示例#2
0
# TAB1 population view ----------------------------------------------------------------------- TAB1 population view

# file loading and update
file_source_tree.on_change('data', file_callback_tree)

file_source_populations.on_change('data', file_callback_populations)

file_source_patient.on_change('data', file_callback_pat)

file_source_clinical.on_change('data', file_callback_clinical)

# upload tree files
menu_tree = [("Upload cluster coordinates", "coordinates"), ("Upload graph edges", "edges")]
tree_dropdown = Dropdown(label="Upload tree structure", button_type="warning", menu=menu_tree,
                         css_classes=['dropdowns'])
tree_dropdown.callback = CustomJS(args=dict(file_source=file_source_tree),
                                  code=open(join(dirname(__file__), "static/js/upload.js")).read())

# upload patients data
upload_patients = Button(label="upload patients data")
upload_patients.js_on_click(CustomJS(args=dict(file_source=file_source_patient),
                                     code=open(join(dirname(__file__), "static/js/upload_multiple.js")).read()))

# upload population list
upload_populations = Button(label="upload population list")
upload_populations.js_on_click(CustomJS(args=dict(file_source=file_source_populations),
                                        code=open(join(dirname(__file__), "static/js/upload.js")).read()))

# select patient
patient = Select(title='Patient', value='None', options=['None'] + df_viz.columns.tolist())

patient.on_change('value', select_patient)