Skip to content

taipy.gui.data.Decimator

Bases: ABC

Base class for decimating chart data.

Decimating is the term used to name the process of reducing the number of data points displayed in charts while retaining the overall shape of the traces. Decimator is a base class that does decimation on data sets.

Taipy GUI comes out-of-the-box with several implementation of this class for different use cases.

__init__(threshold, zoom)

Initialize a new Decimator.

Parameters:

Name Type Description Default
threshold Optional[int]

The minimum amount of data points before the decimator class is applied.

required
zoom Optional[bool]

set to True to reapply the decimation when zoom or re-layout events are triggered.

required

decimate(data, payload) abstractmethod

Decimate function.

This method is executed when the appropriate conditions specified in the constructor are met. This function implements the algorithm that determines which data points are kept or dropped.

Parameters:

Name Type Description Default
data array

An array containing all the data points represented as tuples.

required
payload Dict[str, any]

additional information on charts that is provided at runtime.

required

Returns:

Type Description
ndarray

An array of Boolean mask values. The array should set True or False for each of its indexes where True indicates that the corresponding data point from data should be preserved, or False requires that this data point be dropped.