LayerArtistBase

class glue.core.layer_artist.LayerArtistBase(layer)[source]

Bases: glue.utils.misc.PropertySetMixin

Create a new LayerArtist

Parameters:

layer : Data or Subset

Data or Subset to draw

layer : Data or glue.core.subset.Subset

Attributes Summary

disabled_message Returns why a layer is disabled
enabled
layer The Data or Subset visualized in this layer
visible
zorder

Methods Summary

clear() Clear the visualization for this layer
disable(reason) Disable the layer for a particular reason.
disable_incompatible_subset() Disable a layer because the subset mask cannot be computed.
disable_invalid_attributes(*attributes) Disable a layer because visualization depends on knowing a set
enable()
force_update(*args, **kwargs) Sets the _changed flag to true, and calls update.
get_layer_color()
redraw() Re-render the plot
remove() Remove the visualization for this layer.
update([view]) Sync the visual appearance of the layer, and redraw

Attributes Documentation

disabled_message[source]

Returns why a layer is disabled

enabled = None
layer[source]

The Data or Subset visualized in this layer

visible = None
zorder = None

Methods Documentation

clear()[source]

Clear the visualization for this layer

disable(reason)[source]

Disable the layer for a particular reason.

Layers should only be disabled when drawing is impossible, e.g. because a subset cannot be applied to a dataset.

Parameters:

reason : str

A short explanation for why the layer can’t be drawn. Used by the UI

disable_incompatible_subset()[source]

Disable a layer because the subset mask cannot be computed.

Automatically generates a disabled message.

disable_invalid_attributes(*attributes)[source]

Disable a layer because visualization depends on knowing a set of ComponentIDs that cannot be derived from a dataset or subset

Automatically generates a disabled message.

Parameters:attributes : sequence of ComponentIDs
enable()[source]
force_update(*args, **kwargs)[source]

Sets the _changed flag to true, and calls update.

Force an update of the layer, overriding any caching that might be going on for speed

get_layer_color()[source]
redraw()[source]

Re-render the plot

remove()[source]

Remove the visualization for this layer.

This is called when the layer artist is removed for good from the viewer. It defaults to calling clear, but can be overriden in cases where clear and remove should be different.

update(view=None)[source]

Sync the visual appearance of the layer, and redraw

Subclasses may skip the update if the _changed attribute is set to False.

Parameters:

view : (ComponentID, numpy_style view) or None

A hint about what sub-view into the data is relevant.