{"id":6031,"library":"plotly-resampler","title":"Plotly Resampler","description":"Plotly-resampler is a Python library designed for visualizing large time series datasets efficiently with Plotly. It extends Plotly's capabilities by dynamically resampling data based on the zoom level, ensuring smooth performance even with millions of data points. The current version is 0.11.0, and the project maintains an active development pace with frequent releases.","status":"active","version":"0.11.0","language":"en","source_language":"en","source_url":"https://github.com/predict-idlab/plotly-resampler","tags":["plotly","timeseries","data-visualization","resampling","large-data","interactive"],"install":[{"cmd":"pip install plotly-resampler","lang":"bash","label":"Install core library"},{"cmd":"pip install plotly-resampler[full]","lang":"bash","label":"Install with all optional dependencies"}],"dependencies":[{"reason":"Core dependency for plotting functionality.","package":"plotly","optional":false},{"reason":"Primary backend for fast data aggregation and resampling (since v0.9.0).","package":"tsdownsample","optional":false},{"reason":"Optional, required for static image export of figures (e.g., .png, .jpeg).","package":"kaleido","optional":true},{"reason":"Optional, often used for enabling Cross-Origin Resource Sharing in web applications built with Dash/Flask.","package":"flask-cors","optional":true}],"imports":[{"symbol":"FigureResampler","correct":"from plotly_resampler import FigureResampler"},{"note":"Globally registers Plotly-Resampler for all plotly.graph_objects.Figure instances. Available since v0.7.0.","symbol":"FigureResampler.register_plotly_resampler","correct":"from plotly_resampler import FigureResampler\n# ... later ...\nFigureResampler.register_plotly_resampler()"}],"quickstart":{"code":"import pandas as pd\nimport numpy as np\nfrom plotly_resampler import FigureResampler\nimport plotly.graph_objects as go\n\n# Create some large time series data\nn_points = 1_000_000\ntime_index = pd.date_range(\"2020-01-01\", periods=n_points, freq=\"S\")\ndata_y = np.cumsum(np.random.randn(n_points))\n\n# Initialize FigureResampler, wrapping a Plotly figure\nfig = FigureResampler(go.Figure())\n\n# Add a trace with resampling enabled by providing hf_x and hf_y\nfig.add_trace(go.Scattergl(name='High-Frequency Data'), hf_x=time_index, hf_y=data_y)\n\n# Show the figure (opens in browser or displays in compatible environments)\nfig.show()","lang":"python","description":"This quickstart demonstrates how to create a `FigureResampler` instance to visualize a large time series dataset. It wraps a standard `plotly.graph_objects.Figure` and uses the `add_trace` method with `hf_x` and `hf_y` arguments to enable dynamic resampling."},"warnings":[{"fix":"Remove `check_nans` from your calls. Configure NaN handling via the `nan_policy` argument of your chosen aggregator (e.g., `MinMax(nan_policy='drop')`).","message":"The `check_nans` argument was removed from the `FigureResampler` constructor and its `add_traces` method. NaN handling is now delegated entirely to the specific aggregators via their `nan_policy` argument.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Ensure `tsdownsample` is installed. Review custom aggregation logic if you were relying on internal details of previous backends. Most users will benefit from improved performance and reduced compilation issues.","message":"The default aggregation backend was switched from a custom C implementation (and previously `lttbc`) to `tsdownsample`. This significantly changed the underlying resampling logic and dependencies.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Decide whether to explicitly instantiate `FigureResampler` or use `FigureResampler.register_plotly_resampler()` at the start of your script/application for global effect. Be aware that global registration affects all `go.Figure` objects.","message":"The `register_plotly_resampler()` class method was introduced, allowing dynamic resampling to be applied automatically to all `plotly.graph_objects.Figure` instances globally. This changes the typical usage pattern from explicitly wrapping figures to a more 'set-and-forget' approach.","severity":"gotcha","affected_versions":">=0.7.0"},{"fix":"To get these dependencies, use `pip install plotly-resampler[full]` or `pip install 'plotly-resampler[kaleido]'` / `pip install 'plotly-resampler[flask-dash]'` as needed.","message":"Optional dependencies `kaleido` (for static image export) and `flask-cors` (for web app integration) are no longer installed by default. If you need these functionalities, you must install them explicitly.","severity":"gotcha","affected_versions":">=0.8.3.2"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}