with_spinner#

jdaviz.core.template_mixin.with_spinner(spinner_traitlet='spinner', truthy=True)[source]#

decorator on a plugin method to set a traitlet to True (or the passed string) at the beginning and False (or an empty string) either on failure or successful completion. This traitlet can then be used in the UI to disable elements or display a spinner during operation.

Each plugin gets a ‘spinner’ traitlet by default, but some plugins may want different controls for different sections/actions within the plugin.

If truthy is a string that matches an attribute name on the instance, the attribute’s value will be used instead. This allows subclasses to override the spinner text by defining a class attribute.