Skip to content

taipy.gui.data.RDP

Bases: Decimator

A decimator using the RDP algorithm.

The RDP algorithm reduces a shape made of line segments into a similar shape with less points. This algorithm should be used if the final visual representation is prioritized over the performance of the application.

This class can only be used with line charts.

__init__(epsilon=None, n_out=None, threshold=None, zoom=True)

Initialize a new RDP.

Parameters:

Name Type Description Default
epsilon Optional[int]

The epsilon value for the RDP algorithm. If this value is being used, the n_out argument is ignored.

None
n_out Optional(int

The maximum number of points that are displayed after decimation. This value is ignored if the epsilon value is used.
This process is not very efficient so consider using LTTB or MinMaxDecimator if the provided data has more than 100.000 data points.

None
threshold Optional[int]

The minimum amount of data points before the decimation is applied.

None
zoom Optional[bool]

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

True

dsquared_line_points(P1, P2, points) staticmethod

Calculate only squared distance, only needed for comparison