Esempio n. 1
0
'''
	ODC User Interface
		manages all interactivity

'''
# radio button groups
widget_telescope_sizes = RadioButtonGroup(labels=dfs.string_telescope_sizes,
                                          active=0,
                                          name=dfs.string_widget_names[0])
widget_object_types = RadioButtonGroup(labels=dfs.string_object_types,
                                       active=dfs.default_object_types,
                                       name=dfs.string_widget_names[1])
widget_galaxy_type = Dropdown(label=dfs.string_object_types_types[1],
                              menu=dfs.string_galaxy_types,
                              name=dfs.string_widget_names[2])
widget_galaxy_type.disabled = True  # change if galaxies default
widget_mag_type = RadioButtonGroup(labels=dfs.string_magnitude_three,
                                   active=0,
                                   name=dfs.string_widget_names[3])
widget_grating_types = RadioButtonGroup(labels=dfs.string_grating_types,
                                        active=0,
                                        name=dfs.string_widget_names[4])
widget_moon_days = RadioButtonGroup(
    labels=dfs.string_moon_days, active=0, name=dfs.string_widget_names[5]
)  # TODO: need title for this, would be string_title[7]
widget_binned_pixel_scale_mode = RadioButtonGroup(
    labels=dfs.string_binned_pixel_scale_modes, active=0)
widget_binned_pixel_scale = RadioButtonGroup(
    name=dfs.string_binned_pixel_scale_header,
    labels=dfs.string_binned_pixel_scale_labels,
    active=0)
Esempio n. 2
0
# Choose between IPv4 and IPv6.
LABELS_IPV4_IPV6 = ["IPv4", "IPv6"]
ipv4_ipv6_radio_button = RadioButtonGroup(labels=LABELS_IPV4_IPV6, active=0)
ipv4_ipv6_radio_button.on_change(
    "active", OnChangeIPv4IPv6RadioButton)  # Change the selected prefix.

# Dropdown to select the year.
# Dropdown list is based on the chosen prefix type, for example, if IPv4 is selected, only years with IPv4 files will be shown.
year_dropdown = Dropdown(label="Select year", menu=ListYears())
year_dropdown.on_click(OnClickYearDropdown)  # Change the selected year.

# Dropdown to select the month. The months that will be shown is based os the selected prefix and the selected year.
month_dropdown = Dropdown(label="Select month", menu=ListMonths(selected_year))
month_dropdown.on_click(OnClickMonthDropdown)  # Change the selected month.
month_dropdown.disabled = True  # It will only let the user select the month if the year was already selected.

# Dropdown to select the day. The days that will be shown is based os the selected prefix, the selected year and the selected month.
day_dropdown = Dropdown(label="Select day",
                        menu=ListDays(selected_year, selected_month))
day_dropdown.on_click(OnClickDayDropdown)  # Change the selected day.
day_dropdown.disabled = True  # It will only let the user select the day if the year and the month was already selected.

# Choose the type of plot.
LABELS_PLOT_TYPE = [
    "Number of total used AS's", "Number of AS's per policy",
    "Percentage of AS's per policy"
]
plot_type_radio_button = RadioButtonGroup(labels=LABELS_PLOT_TYPE, active=0)
plot_type_radio_button.on_change(
    "active", OnChangePlotTypeRadioButton)  # Change the selected type of plot.