ComponentIDComboHelper#

class glue.core.data_combo_helper.ComponentIDComboHelper(state, selection_property, data_collection=None, data=None, numeric=True, datetime=True, categorical=True, pixel_coord=False, world_coord=False, derived=True, none=False)[source]#

Bases: ComboHelper

The purpose of this class is to set up a combo (represented by a SelectionCallbackProperty) showing componentIDs for one or more datasets, and to update these componentIDs if needed, for example if new components are added to a dataset, or if componentIDs are renamed. This is a GUI framework-independent implementation.

Parameters:
stateState

The state to which the selection property belongs

selection_propertySelectionCallbackProperty

The selection property representing the combo.

data_collectionDataCollection, optional

The data collection to which the datasets belong - if specified, this is used to remove datasets from the combo when they are removed from the data collection.

dataData, optional

If specified, set up the combo for this dataset only and don’t allow datasets to be added/removed

numericbool, optional

Show numeric components

datetimebool, optional

Show datetime components

categoricalbool, optional

Show categorical components

pixel_coordbool, optional

Show pixel coordinate components

world_coordbool, optional

Show world coordinate components

derivedbool, optional

Show derived components

nonebool or str, optional

Add an entry that means None. If a string, this is the display string that will be shown for the None entry, otherwise an empty string is shown.

Attributes Summary

categorical

datetime

derived

hub

none

numeric

pixel_coord

world_coord

Methods Summary

append_data(data[, refresh])

clear()

refresh(*args)

register_to_hub(hub)

remove_data(data)

set_multiple_data(datasets)

Add multiple datasets to the combo in one go (and clear any previous datasets).

unregister(hub)

Default unregistration action.

Attributes Documentation

categorical[source]#
datetime[source]#
derived[source]#
hub[source]#
none[source]#
numeric[source]#
pixel_coord[source]#
world_coord[source]#

Methods Documentation

append_data(data, refresh=True)[source]#
clear()[source]#
refresh(*args)[source]#
register_to_hub(hub)[source]#
remove_data(data)[source]#
set_multiple_data(datasets)[source]#

Add multiple datasets to the combo in one go (and clear any previous datasets).

Parameters:
datasetslist

The list of Data objects to add

unregister(hub)[source]#

Default unregistration action. Calls hub.unsubscribe_all on self