LayerArtistMakerRegistry

class glue.config.LayerArtistMakerRegistry[source]

Bases: glue.config.Registry

A registry that allows customization of layer artists based on the data and viewer type.

Methods Summary

__call__(label[, priority])

This is provided so that registry instances can be used as decorators.

add(label, function[, priority])

Add a new plugin for providing custom layer artists.

Methods Documentation

__call__(label, priority=0)[source]

This is provided so that registry instances can be used as decorators. The decorators should add the decorated code object to the registry, and return the original function

add(label, function, priority=0)[source]

Add a new plugin for providing custom layer artists.

Plugins take the form of functions that take two arguments - the data or subset being added, and the viewer. The function should either return a ~glue.viewers.common.layer_artist.LayerArtist sub-class object or None.

Parameters
labelstr

Name for the plugin

functioncallable

The function that returns layer artists

priorityint, optional

Set this to a higher number if multiple plugins are present and you want your plugin to take precedence over another.