ComponentIDComboHelper

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

Bases: glue.core.data_combo_helper.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

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

derived

hub

none

numeric

pixel_coord

world_coord

Methods Summary

append_data(self, data[, refresh])

clear(self)

refresh(self, \*args)

register_to_hub(self, hub)

remove_data(self, data)

set_multiple_data(self, datasets)

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

unregister(self, hub)

Default unregistration action.

Attributes Documentation

categorical
derived
hub
none
numeric
pixel_coord
world_coord

Methods Documentation

append_data(self, data, refresh=True)[source]
clear(self)[source]
refresh(self, *args)[source]
register_to_hub(self, hub)[source]
remove_data(self, data)[source]
set_multiple_data(self, 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(self, hub)[source]

Default unregistration action. Calls hub.unsubscribe_all on self