Skip to content

Conversation

@evnchn
Copy link
Collaborator

@evnchn evnchn commented Feb 2, 2026

Motivation

Fixes #3340, where the UI grinds to a halt when the Ploty chart has a large dataset.

Implementation

Implement LTTB (Largest Triangle Three Buckets) algorithm for automatic downsampling of large time series data in Plotly charts.

  • Add n_samples parameter to ui.plotly() to enable dynamic resampling
  • Resample data on zoom/pan via plotly_relayout events
  • Include pure NumPy LTTB implementation as fallback
  • Support optional tsdownsample package for faster Rust-based downsampling

Progress

  • I chose a meaningful title that completes the sentence: "If applied, this PR will..."
  • The implementation is complete.
  • If this PR addresses a security issue, it has been coordinated via the security advisory process.
  • Pytests is a tough one. How do we validate that the resampling took place?
  • Explicit documentation is not necessary because the option is documented in the options
    • Nevertheless I think maybe let's showcase this functionality

evnchn and others added 3 commits February 2, 2026 22:37
Implement LTTB (Largest Triangle Three Buckets) algorithm for automatic
downsampling of large time series data in Plotly charts.

- Add `n_samples` parameter to `ui.plotly()` to enable dynamic resampling
- Resample data on zoom/pan via plotly_relayout events
- Include pure NumPy LTTB implementation as fallback
- Support optional `tsdownsample` package for faster Rust-based downsampling

Fixes zauberzeug#3340

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Updating Ploty chart with a large dataset causes the UI to hang

1 participant