ScatterLayerState3D

Contents

ScatterLayerState3D#

class glue.viewers.scatter3d.layer_state.ScatterLayerState3D(layer=None, **kwargs)#

Bases: LayerState3D

A state object for scatter layers

Attributes Summary

alpha

A property that callback functions can be added to.

cmap

A property that callback functions can be added to.

cmap_att

cmap_attribute

An alias for a CallbackProperty that redirects access to a target property.

cmap_name

cmap_vmax

A property that callback functions can be added to.

cmap_vmin

A property that callback functions can be added to.

color

A property that callback functions can be added to.

color_mode

layer

The Data or Subset represented by the layer

point_colors

point_sizes

size

A property that callback functions can be added to.

size_att

size_attribute

An alias for a CallbackProperty that redirects access to a target property.

size_mode

size_scaling

A property that callback functions can be added to.

size_vmax

A property that callback functions can be added to.

size_vmin

A property that callback functions can be added to.

vector_arrowhead

A property that callback functions can be added to.

vector_origin

vector_scaling

A property that callback functions can be added to.

vector_visible

A property that callback functions can be added to.

visible

Whether the layer is currently visible

vx_att

vx_attribute

An alias for a CallbackProperty that redirects access to a target property.

vy_att

vy_attribute

An alias for a CallbackProperty that redirects access to a target property.

vz_att

vz_attribute

An alias for a CallbackProperty that redirects access to a target property.

xerr_att

xerr_attribute

An alias for a CallbackProperty that redirects access to a target property.

xerr_visible

A property that callback functions can be added to.

yerr_att

yerr_attribute

An alias for a CallbackProperty that redirects access to a target property.

yerr_visible

A property that callback functions can be added to.

zerr_att

zerr_attribute

An alias for a CallbackProperty that redirects access to a target property.

zerr_visible

A property that callback functions can be added to.

zorder

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.

callback_properties()

Return a list of all callback property names.

clear_callbacks()

Remove all global and property-specific callbacks.

flip_cmap()

flip_size()

is_alias(name)

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

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.

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

alpha#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

cmap#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

cmap_att#
cmap_attribute#

An alias for a CallbackProperty that redirects access to a target property.

This is useful for renaming callback properties while maintaining backwards compatibility. Optionally emits deprecation warnings when the alias is used.

Parameters:
targetstr

The name of the target property to redirect to

deprecatedbool, optional

If True, emit a deprecation warning when the alias is accessed. Defaults to False (silent alias).

warningstr, optional

A custom warning message. If not provided, a default message will be generated. Setting this implies deprecated=True.

Examples

class Foo(HasCallbackProperties):
    # New property name
    line_color = CallbackProperty('red')

    # Silent alias for backwards compatibility
    linecolor = CallbackPropertyAlias('line_color')

    # Deprecated alias with warning
    lc = CallbackPropertyAlias('line_color', deprecated=True)
cmap_name#
cmap_vmax#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

cmap_vmin#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

color#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

color_mode#
layer#

The Data or Subset represented by the layer

point_colors#
point_sizes#
size#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

size_att#
size_attribute#

An alias for a CallbackProperty that redirects access to a target property.

This is useful for renaming callback properties while maintaining backwards compatibility. Optionally emits deprecation warnings when the alias is used.

Parameters:
targetstr

The name of the target property to redirect to

deprecatedbool, optional

If True, emit a deprecation warning when the alias is accessed. Defaults to False (silent alias).

warningstr, optional

A custom warning message. If not provided, a default message will be generated. Setting this implies deprecated=True.

Examples

class Foo(HasCallbackProperties):
    # New property name
    line_color = CallbackProperty('red')

    # Silent alias for backwards compatibility
    linecolor = CallbackPropertyAlias('line_color')

    # Deprecated alias with warning
    lc = CallbackPropertyAlias('line_color', deprecated=True)
size_mode#
size_scaling#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

size_vmax#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

size_vmin#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

vector_arrowhead#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

vector_origin#
vector_scaling#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

vector_visible#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

visible#

Whether the layer is currently visible

vx_att#
vx_attribute#

An alias for a CallbackProperty that redirects access to a target property.

This is useful for renaming callback properties while maintaining backwards compatibility. Optionally emits deprecation warnings when the alias is used.

Parameters:
targetstr

The name of the target property to redirect to

deprecatedbool, optional

If True, emit a deprecation warning when the alias is accessed. Defaults to False (silent alias).

warningstr, optional

A custom warning message. If not provided, a default message will be generated. Setting this implies deprecated=True.

Examples

class Foo(HasCallbackProperties):
    # New property name
    line_color = CallbackProperty('red')

    # Silent alias for backwards compatibility
    linecolor = CallbackPropertyAlias('line_color')

    # Deprecated alias with warning
    lc = CallbackPropertyAlias('line_color', deprecated=True)
vy_att#
vy_attribute#

An alias for a CallbackProperty that redirects access to a target property.

This is useful for renaming callback properties while maintaining backwards compatibility. Optionally emits deprecation warnings when the alias is used.

Parameters:
targetstr

The name of the target property to redirect to

deprecatedbool, optional

If True, emit a deprecation warning when the alias is accessed. Defaults to False (silent alias).

warningstr, optional

A custom warning message. If not provided, a default message will be generated. Setting this implies deprecated=True.

Examples

class Foo(HasCallbackProperties):
    # New property name
    line_color = CallbackProperty('red')

    # Silent alias for backwards compatibility
    linecolor = CallbackPropertyAlias('line_color')

    # Deprecated alias with warning
    lc = CallbackPropertyAlias('line_color', deprecated=True)
vz_att#
vz_attribute#

An alias for a CallbackProperty that redirects access to a target property.

This is useful for renaming callback properties while maintaining backwards compatibility. Optionally emits deprecation warnings when the alias is used.

Parameters:
targetstr

The name of the target property to redirect to

deprecatedbool, optional

If True, emit a deprecation warning when the alias is accessed. Defaults to False (silent alias).

warningstr, optional

A custom warning message. If not provided, a default message will be generated. Setting this implies deprecated=True.

Examples

class Foo(HasCallbackProperties):
    # New property name
    line_color = CallbackProperty('red')

    # Silent alias for backwards compatibility
    linecolor = CallbackPropertyAlias('line_color')

    # Deprecated alias with warning
    lc = CallbackPropertyAlias('line_color', deprecated=True)
xerr_att#
xerr_attribute#

An alias for a CallbackProperty that redirects access to a target property.

This is useful for renaming callback properties while maintaining backwards compatibility. Optionally emits deprecation warnings when the alias is used.

Parameters:
targetstr

The name of the target property to redirect to

deprecatedbool, optional

If True, emit a deprecation warning when the alias is accessed. Defaults to False (silent alias).

warningstr, optional

A custom warning message. If not provided, a default message will be generated. Setting this implies deprecated=True.

Examples

class Foo(HasCallbackProperties):
    # New property name
    line_color = CallbackProperty('red')

    # Silent alias for backwards compatibility
    linecolor = CallbackPropertyAlias('line_color')

    # Deprecated alias with warning
    lc = CallbackPropertyAlias('line_color', deprecated=True)
xerr_visible#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

yerr_att#
yerr_attribute#

An alias for a CallbackProperty that redirects access to a target property.

This is useful for renaming callback properties while maintaining backwards compatibility. Optionally emits deprecation warnings when the alias is used.

Parameters:
targetstr

The name of the target property to redirect to

deprecatedbool, optional

If True, emit a deprecation warning when the alias is accessed. Defaults to False (silent alias).

warningstr, optional

A custom warning message. If not provided, a default message will be generated. Setting this implies deprecated=True.

Examples

class Foo(HasCallbackProperties):
    # New property name
    line_color = CallbackProperty('red')

    # Silent alias for backwards compatibility
    linecolor = CallbackPropertyAlias('line_color')

    # Deprecated alias with warning
    lc = CallbackPropertyAlias('line_color', deprecated=True)
yerr_visible#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

zerr_att#
zerr_attribute#

An alias for a CallbackProperty that redirects access to a target property.

This is useful for renaming callback properties while maintaining backwards compatibility. Optionally emits deprecation warnings when the alias is used.

Parameters:
targetstr

The name of the target property to redirect to

deprecatedbool, optional

If True, emit a deprecation warning when the alias is accessed. Defaults to False (silent alias).

warningstr, optional

A custom warning message. If not provided, a default message will be generated. Setting this implies deprecated=True.

Examples

class Foo(HasCallbackProperties):
    # New property name
    line_color = CallbackProperty('red')

    # Silent alias for backwards compatibility
    linecolor = CallbackPropertyAlias('line_color')

    # Deprecated alias with warning
    lc = CallbackPropertyAlias('line_color', deprecated=True)
zerr_visible#

A property that callback functions can be added to.

When a callback property changes value, each callback function is called with information about the state change. Otherwise, callback properties behave just like normal instance variables.

CallbackProperties must be defined at the class level. Use the helper function add_callback() to attach a callback to a specific instance of a class with CallbackProperties

Parameters:
default

The initial value for the property

docstringstr

The docstring for the property

getter, setterfunc

Custom getter and setter functions (advanced)

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, validator=False)#

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 as callback(new)

priorityint, optional

This can optionally be used to force a certain order of execution of callbacks (larger values indicate a higher priority).

validatorbool, optional

Whether the callback is a validator, which is a special kind of callback that gets called before the property is set. The validator can return a modified value (for example it can be used to change the types of values or change properties in-place) or it can also raise an exception.

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()#

Return a list of all callback property names.

Note: This does not include CallbackPropertyAlias instances, only actual CallbackProperty instances.

clear_callbacks()#

Remove all global and property-specific callbacks.

flip_cmap()#
flip_size()#
is_alias(name)#

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

Parameters:
namestr

The name of the property to check

is_callback_property(name)#

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

Returns True for both CallbackProperty and CallbackPropertyAlias.

Parameters:
namestr

The name of the property to check

iter_callback_properties()#

Iterator to loop over all callback properties.

Note: This does not include CallbackPropertyAlias instances, only actual CallbackProperty instances.

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

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