holoviews.core.operation module#

Operations manipulate Elements, HoloMaps and Layouts, typically for the purposes of analysis or visualization.

class holoviews.core.operation.Operation(*, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: ParameterizedFunction

An Operation process an Element or HoloMap at the level of individual elements or overlays. If a holomap is passed in as input, a processed holomap is returned as output where the individual elements have been transformed accordingly. An Operation may turn overlays in new elements or vice versa.

An Operation can be set to be dynamic, which will return a DynamicMap with a callback that will apply the operation dynamically. An Operation may also supply a list of Stream classes on a streams parameter, which can allow dynamic control over the parameters on the operation.

Parameter Definitions


group = String(default='Operation', label='Group')

The group string used to identify the output of the Operation. By default this should match the operation name.

dynamic = Selector(default='default', label='Dynamic', names={}, objects=['default', True, False])

Whether the operation should be applied dynamically when a specific frame is requested, specified as a Boolean. If set to ‘default’ the mode will be determined based on the input type, i.e. if the data is a DynamicMap it will stay dynamic.

input_ranges = ClassSelector(allow_None=True, class_=(<class 'dict'>, <class 'tuple'>), default={}, label='Input ranges')

Ranges to be used for input normalization (if applicable) in a format appropriate for the Normalization.ranges parameter. By default, no normalization is applied. If key-wise normalization is required, a 2-tuple may be supplied where the first component is a Normalization.ranges list and the second component is Normalization.keys.

link_inputs = Boolean(default=False, label='Link inputs')

If the operation is dynamic, whether or not linked streams should be transferred from the operation inputs for backends that support linked streams. For example if an operation is applied to a DynamicMap with an RangeXY, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.

streams = ClassSelector(class_=(<class 'dict'>, <class 'list'>), default=[], label='Streams')

List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.core.operation.OperationCallable(callable, **kwargs)[source]#

Bases: Callable

OperationCallable allows wrapping an Operation and the objects it is processing to allow traversing the operations applied on a DynamicMap.

Parameter Definitions


Parameters inherited from:

holoviews.core.spaces.Callable: callable, inputs, operation_kwargs, link_inputs, memoize, stream_mapping

operation = ClassSelector(allow_None=True, class_=<class 'holoviews.core.operation.Operation'>, label='Operation')

The Operation being wrapped into an OperationCallable.