Skip to content

RDP class

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.

Methods

__init__()

__init__(
    epsilon: Optional[int] = None,
    n_out: Optional[int] = None,
    threshold: Optional[int] = None,
    zoom: Optional[bool] = 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