The `dash-extensions` package is a comprehensive collection of utility functions, syntax extensions, and custom components designed to enhance the Plotly Dash development experience. It provides features like server-side caching, enhanced callbacks (e.g., blocking, multiplexing, server-side outputs), JavaScript interoperability, and enriched Dash components. Currently at version 2.0.5, the library maintains an active and regular release cadence, with multiple patch and major version updates throughout the year to introduce new features and address breaking changes in underlying libraries like Dash.
pip install dash-extensionsVerified import paths — ran on the pinned version, not inferred.
This minimal example demonstrates how to create a basic Dash application using `DashProxy` from `dash-extensions.enrich` and incorporate a custom `Lottie` component for animated visuals. The `Lottie` component fetches an animation from a URL and displays it, showcasing easy integration of extended functionalities.
Upgrade Dash to >=3.0.2. Replace `LogTransform` usage with the new `dash_extensions.logging` module. Remove `NoOutputTransform` as Dash 2.17.0+ supports callbacks without outputs. Remove usage of the `dataiku` module.
Refactor Lottie component usage: `Lottie(options=dict(style=dict(width='25%', margin='auto')), ...)` instead of `Lottie(style=dict(width='25%', margin='auto'), ...)` or `Lottie(width='25%', ...)` (if it ever supported direct `width`).
Update callbacks using `ServersideOutputTransform` to wrap return values: `return Serverside(my_data)` instead of relying on the `Output` replacement.
Migrate any `OperatorTransform` usage to Dash 2.9's partial property updates for similar functionality.
Always import `DashProxy` with `from dash_extensions.enrich import DashProxy` when leveraging `dash-extensions`' advanced functionalities.
Adjust import statements: `from dash_extensions.enrich import html, dcc, Input, Output` instead of `from dash import html, dcc, Input, Output`.
Ensure `dash-extensions` is installed (`pip install dash-extensions`). If using `conda`, install it via `conda install -c conda-forge dash-extensions`. For WebSocket functionality, also ensure `flask-sockets` (or `flask-sock` for Flask 2.0+) is installed and compatible with your Flask version.
Initialize your app with `DashProxy(transforms=[ServersideOutputTransform()])`. For callbacks, use `from dash_extensions.enrich import callback` and decorate your callback with `@callback`. Ensure the non-JSON-serializable output is wrapped with `Serverside()` (e.g., `return Serverside(my_dataframe)`).
Ensure `MultiplexerTransform` is included in your `DashProxy` initialization: `app = DashProxy(transforms=[MultiplexerTransform()])`. If the issue persists, verify all callbacks are correctly managed by `dash-extensions` and consider if merging related callbacks or using `dash.no_update` is appropriate.
Upgrade both `dash` and `dash-extensions` to their latest versions (`pip install -U dash dash-extensions`). Additionally, clear any existing cache files or directories created by `flask-caching` (e.g., by deleting the cache folder on disk) to remove potentially corrupt data.