Skip to content

Conversation

@droumis
Copy link
Member

@droumis droumis commented Apr 15, 2024

fixes #1312

This pull request updates the handling of the downsample parameter in hvPlot. Previously, the parameter only accepted a boolean value. With these changes, users can now specify the downsampling algorithm directly, provided they have 'tsdownsample' library installed.

"""
downsample (default=False):
        Controls the application of downsampling to the plotted data,
        which is particularly useful for large timeseries datasets to
        reduce the amount of data sent to browser and improve
        visualization performance. Requires HoloViews >= 1.16. Additional
        dependencies: Installing the `tsdownsample` library is required
        for using any downsampling methods other than the default 'lttb'.
        Acceptable values:
        - False: No downsampling is applied.
        - True: Applies downsampling using HoloViews' default algorithm
            (LTTB - Largest Triangle Three Buckets).
        - 'lttb': Explicitly applies the Largest Triangle Three Buckets
          algorithm.
        - 'minmax': Applies the MinMax algorithm, selecting the minimum
          and maximum values in each bin. Requires `tsdownsample`.
        - 'm4': Applies the M4 algorithm, selecting the minimum, maximum,
          first, and last values in each bin. Requires `tsdownsample`.
        - 'minmax-lttb': Combines MinMax and LTTB algorithms for
          downsampling, first applying MinMax to reduce to a preliminary
          set of points, then LTTB for further reduction. Requires
          `tsdownsample`.
        Other string values corresponding to supported algorithms in
        HoloViews may also be used.
"""
  • add tests
  • add docs (already in large timeseries nb)

@droumis droumis marked this pull request as ready for review April 15, 2024 22:12
@droumis droumis requested a review from maximlt April 15, 2024 22:17
@droumis droumis self-assigned this Apr 15, 2024
Copy link
Member

@maximlt maximlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The day we need to allow configuring more downsample1d we can still overload downsample to accept a dict, for now this looks way more than enough. Thanks!

@maximlt maximlt merged commit 4e02ff0 into main Apr 16, 2024
@maximlt maximlt deleted the downsample-algos branch April 16, 2024 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose more downsample algorithms and options

3 participants