Access Dash AG Grid documentation
v35dash-ag-grid has been moved to the central Dash documentation site. For the most up-to-date guides, API references, and tutorials, visit https://dash.plotly.com/.repository·v35·Indexed 42 days ago
https://github.com/plotly/dash-ag-gridA Dash component wrapper for the AG Grid JavaScript library, version 35.3.0, enabling high-performance interactive data grids in Dash applications. It supports both Community and Enterprise features, including column resizing, sorting, pagination, and advanced capabilities like grouping and pivoting with a valid license. The component provides the AgGrid entrypoint and access to the underlying AG Grid API via getApi and getApiAsync.
dash-ag-grid has been moved to the central Dash documentation site. For the most up-to-date guides, API references, and tutorials, visit https://dash.plotly.com/.Dash AG Grid includes both the AG Grid Community and Enterprise versions.
Note: While both versions are included in the component, Enterprise features will not function without a license.
To create a basic grid, import dash_ag_grid as dag. You need to provide rowData (a list of dictionaries representing your data) and columnDefs (a list of dictionaries defining the columns).
By default, the component enables the Alpine theme, sorting, column resizing/reordering/pinning, boolean checkboxes, and row animation on sort.
import dash_ag_grid as dag
from dash import Dash
import pandas as pd
app = Dash()
df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/ag-grid/space-mission-data.csv")
app.layout = dag.AgGrid(
rowData=df.to_dict("records"),
columnDefs=[{"field": i} for i in df.columns],
)
app.run(debug=True)To run the examples located in the more_examples directory, follow these steps:
pip install -r requires-docs.txtpython more_examples/demo_stock_portfolio_dmc/app.pyNote: These examples have been moved to the official Dash documentation. This repository's examples are maintained for historical reference only.
pip install -r requires-docs.txt
python more_examples/demo_stock_portfolio_dmc/app.pyusage.py to confirm that backend-driven updates correctly reflect in the frontend component.The Dash ecosystem relies heavily on integration tests. To run the sample integration test provided in the boilerplate (which launches a sample Dash app in a browser), use the following command from the root directory:
python -m tests.test_renderTo ensure compatibility with Dash documentation tools, provide basic documentation for your components using react docstrings. At a minimum, your documentation should include:
Ensure you use the correct formatting so that the docstrings are properly recognized by the Dash ecosystem.
MANIFEST.in file to ensure they are included in the package distribution.Install the dash-ag-grid package using pip to use the AG Grid component wrapper in your Dash applications.
pip install dash-ag-gridThe AgGrid component is the primary entrypoint for rendering an AG Grid instance within a Dash application. It is imported from the dash-ag-grid package.
import { AgGrid } from 'dash-ag-grid';
// Usage within a React/Dash context
<AgGrid ... />To interact with the underlying AG Grid instance (e.g., to trigger manual refreshes, export data, or manipulate columns programmatically), use getApi or getApiAsync.
getApi: Synchronously retrieves the AG Grid API instance.getApiAsync: Asynchronously retrieves the AG Grid API instance, which is useful when the component might not be fully initialized yet.import { getApi, getApiAsync } from 'dash-ag-grid';
// Synchronous access
const api = getApi();
// Asynchronous access
const api = await getApiAsync();