ScatterViewerState

class glue.viewers.scatter.state.ScatterViewerState(**kwargs)[source]

Bases: glue.viewers.matplotlib.state.MatplotlibDataViewerState

A state class that includes all the attributes for a scatter viewer.

Attributes Summary

aspect Aspect ratio for the axes
layers A collection of all layers in the viewer
layers_data
x_att The attribute to show on the x-axis
x_log Whether the x axis is logarithmic
x_max Upper limit of the visible x range
x_min Lower limit of the visible x range
y_att The attribute to show on the y-axis
y_log Whether the y axis is logarithmic
y_max Upper limit of the visible y range
y_min Lower limit of the visible y range

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.
flip_x() Flip the x_min/x_max limits.
flip_y() Flip the y_min/y_max limits.
is_callback_property(name) Whether a property (identified by name) is a callback property.
iter_callback_properties() Iterator to loop over all callback properties.
remove_callback(name, callback) Remove a previously-added callback
remove_global_callback(callback) Remove a global callback function.
reset_limits()
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.

Attributes Documentation

aspect

Aspect ratio for the axes

layers

A collection of all layers in the viewer

layers_data
x_att

The attribute to show on the x-axis

x_log

Whether the x axis is logarithmic

x_max

Upper limit of the visible x range

x_min

Lower limit of the visible x range

y_att

The attribute to show on the y-axis

y_log

Whether the y axis is logarithmic

y_max

Upper limit of the visible y range

y_min

Lower limit of the visible y range

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:

name : str

The instance to add the callback to.

callback : func

The callback function to add

echo_old : bool, 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 as callback(new)

priority : int, 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:

callback : func

The callback function to add

as_dict()

Return the current state as a dictionary of attribute/value pairs.

flip_x()[source]

Flip the x_min/x_max limits.

flip_y()[source]

Flip the y_min/y_max limits.

is_callback_property(name)

Whether a property (identified by name) is a callback property.

Parameters:

name : str

The name of the property to check

iter_callback_properties()

Iterator to loop over all callback properties.

remove_callback(name, callback)

Remove a previously-added callback

Parameters:

name : str

The instance to remove the callback from.

func : func

The callback function to remove

remove_global_callback(callback)

Remove a global callback function.

Parameters:

callback : func

The callback function to remove

reset_limits()[source]
update_from_dict(properties)

Update this state using the values from a dictionary of attributes.

Parameters:

properties : dict

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