holoviews.operation.resample module#

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

Bases: Operation

Abstract baseclass for operations supporting linked inputs.

Parameter Definitions


Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, streams

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

By default, the link_inputs parameter is set to True so that when applying an operation, backends that support linked streams update RangeXY streams on the inputs of the operation. Disable when you do not want the resulting plot to be interactive, e.g. when trying to display an interactive plot a second time.

class holoviews.operation.resample.ResampleOperation1D(*, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: LinkableOperation

Abstract baseclass for resampling operations

Parameter Definitions


Parameters inherited from:

dynamic = Boolean(default=True, label='Dynamic')

Enables dynamic processing by default.

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

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

x_range = Tuple(allow_None=True, label='X range', length=2)

The x_range as a tuple of min and max x-value. Auto-ranges if set to None.

x_sampling = Number(allow_None=True, inclusive_bounds=(True, True), label='X sampling')

Specifies the smallest allowed sampling interval along the x axis.

width = Integer(default=400, inclusive_bounds=(True, True), label='Width')

The width of the output image in pixels.

height = Integer(default=400, inclusive_bounds=(True, True), label='Height')

The height of the output image in pixels.

pixel_ratio = Number(allow_None=True, bounds=(0, None), inclusive_bounds=(False, False), label='Pixel ratio')

Pixel ratio applied to the height and width. Useful for higher resolution screens where the PlotSize stream reports ‘nominal’ dimensions in pixels that do not match the physical pixels. For instance, setting pixel_ratio=2 can give better results on Retina displays. Also useful for using lower resolution for speed. If not set explicitly, the zoom level of the browsers will be used, if available.

class holoviews.operation.resample.ResampleOperation2D(*, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: ResampleOperation1D

Abstract baseclass for resampling operations

Parameter Definitions


Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

dynamic = Boolean(default=True, label='Dynamic')

Enables dynamic processing by default.

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

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

expand = Boolean(default=True, label='Expand')

Whether the x_range and y_range should be allowed to expand beyond the extent of the data. Setting this value to True is useful for the case where you want to ensure a certain size of output grid, e.g. if you are doing masking or other arithmetic on the grids. A value of False ensures that the grid is only just as large as it needs to be to contain the data, which will be faster and use less memory if the resulting aggregate is being overlaid on a much larger background.

y_range = Tuple(allow_None=True, label='Y range', length=2)

The y-axis range as a tuple of min and max y value. Auto-ranges if set to None.

y_sampling = Number(allow_None=True, inclusive_bounds=(True, True), label='Y sampling')

Specifies the smallest allowed sampling interval along the y axis.

target = ClassSelector(allow_None=True, class_=<class 'holoviews.core.data.Dataset'>, label='Target')

A target Dataset which defines the desired x_range, y_range, width and height.

element_type = ClassSelector(class_=(<class 'holoviews.core.data.Dataset'>,), default=<class 'holoviews.element.raster.Image'>, label='Element type')

The type of the returned Elements, must be a 2D Dataset type.

precompute = Boolean(default=False, label='Precompute')

Whether to apply precomputing operations. Precomputing can speed up resampling operations by avoiding unnecessary recomputation if the supplied element does not change between calls. The cost of enabling this option is that the memory used to represent this internal state is not freed between calls.

element_type[source]#

alias of Image

instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.