ProfileLayerState¶
- class glue.viewers.profile.state.ProfileLayerState(layer=None, viewer_state=None, **kwargs)[source]¶
Bases:
MatplotlibLayerState
,HubListener
A state class that includes all the attributes for layers in a Profile plot.
Attributes Summary
The transparency used to display the data
Whether to display the profile as steps
The attribute shown in the layer
The color used to display the data
The width of the line
The percentile value used to automatically calculate levels
The upper level shown
The lower level shown
Whether the layer is currently visible
A value used to indicate which layers are shown in front of which (larger zorder values are on top of other layers)
Methods Summary
add_callback
(name, callback[, echo_old, ...])Add a callback that gets triggered when a callback property of the class changes.
add_global_callback
(callback)Add a global callback function, which is a callback that gets triggered when any callback properties on the class change.
as_dict
()Return the current state as a dictionary of attribute/value pairs.
Remove all global and property-specific callbacks.
is_callback_property
(name)Whether a property (identified by name) is a callback property.
Iterator to loop over all callback properties.
normalize_values
(values)notify
(message)register_to_hub
(hub)remove_callback
(name, callback)Remove a previously-added callback
remove_global_callback
(callback)Remove a global callback function.
reset_cache
(*args)unregister
(hub)Default unregistration action.
update_from_dict
(properties)Update this state using the values from a dictionary of attributes.
update_from_state
(state)Update this state using the values from another state.
update_limits
([update_profile])update_profile
([update_limits])Attributes Documentation
- alpha¶
The transparency used to display the data
- as_steps¶
Whether to display the profile as steps
- attribute¶
The attribute shown in the layer
- color¶
The color used to display the data
- linewidth¶
The width of the line
- percentile¶
The percentile value used to automatically calculate levels
- v_max¶
The upper level shown
- v_min¶
The lower level shown
- visible¶
Whether the layer is currently visible
- zorder¶
A value used to indicate which layers are shown in front of which (larger zorder values are on top of other layers)
Methods Documentation
- add_callback(name, callback, echo_old=False, priority=0)¶
Add a callback that gets triggered when a callback property of the class changes.
- Parameters:
- namestr
The instance to add the callback to.
- callbackfunc
The callback function to add
- echo_oldbool, optional
If True, the callback function will be invoked with both the old and new values of the property, as
callback(old, new)
. If False (the default), will be invoked ascallback(new)
- priorityint, optional
This can optionally be used to force a certain order of execution of callbacks (larger values indicate a higher priority).
- add_global_callback(callback)¶
Add a global callback function, which is a callback that gets triggered when any callback properties on the class change.
- Parameters:
- callbackfunc
The callback function to add
- as_dict()¶
Return the current state as a dictionary of attribute/value pairs.
- callback_properties()¶
- clear_callbacks()¶
Remove all global and property-specific callbacks.
- is_callback_property(name)¶
Whether a property (identified by name) is a callback property.
- Parameters:
- namestr
The name of the property to check
- iter_callback_properties()¶
Iterator to loop over all callback properties.
- notify(message)¶
- register_to_hub(hub)¶
- remove_callback(name, callback)¶
Remove a previously-added callback
- Parameters:
- namestr
The instance to remove the callback from.
- funcfunc
The callback function to remove
- remove_global_callback(callback)¶
Remove a global callback function.
- Parameters:
- callbackfunc
The callback function to remove
- unregister(hub)¶
Default unregistration action. Calls hub.unsubscribe_all on self
- update_from_dict(properties)¶
Update this state using the values from a dictionary of attributes.
- Parameters:
- propertiesdict
The dictionary containing attribute/value pairs.
- update_from_state(state)¶
Update this state using the values from another state.
- Parameters:
- state~glue.core.state_objects.State
The state to use the values from