Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
16afc80
Initial plan
Copilot Apr 7, 2026
e2c504b
fix: add lazy AG Charts module loading via dashEnableCharts
Copilot Apr 7, 2026
a1b9097
chore: address review feedback for chart module registration
Copilot Apr 7, 2026
94d9b82
fix: restrict dashEnableCharts loading to enterprise grids only
Copilot Apr 7, 2026
59ee922
fix: auto-enable enableCharts when dashEnableCharts is set
Copilot Apr 7, 2026
2c07239
fix: auto-enable charts and guard conflicting enableCharts=false
Copilot Apr 7, 2026
01d7df9
adjustments for community default
BSd3v Apr 7, 2026
b361cef
fix for lint
BSd3v Apr 7, 2026
2326ff5
fix: add AG Charts enterprise license key support
Copilot Apr 8, 2026
10f59b6
adjustments to only have `dashEnableCharts` be community or enterprise
BSd3v Apr 9, 2026
5180197
Merge branch 'v35' into copilot/fix-ag-charts-in-33-3-3
BSd3v Apr 22, 2026
d477ea6
adding changelog entry
BSd3v Apr 22, 2026
f3f5255
fix: handle null dashGridOptions in chart guard logic
Copilot Apr 23, 2026
cecca00
revert: undo null normalization in dashGridOptions handling
Copilot Apr 23, 2026
9c23036
Merge branch 'v35' into copilot/fix-ag-charts-in-33-3-3
BSd3v Apr 23, 2026
3587408
updates for tests loading the modules
BSd3v Apr 24, 2026
7040eb6
fixing issue with dashGridOptions not existing
BSd3v Apr 27, 2026
4d805f5
Align dashEnableCharts to enterprise-only mode
Copilot Jun 25, 2026
f9e0b8d
Merge branch 'v35' into copilot/fix-ag-charts-in-33-3-3
BSd3v Jun 26, 2026
bb189e7
adjusting `dashEnableCharts` -> `dashChartMode`
BSd3v Jun 26, 2026
6f8ecd4
adjustments feedback statement for enableCharts and enterprise module…
BSd3v Jun 26, 2026
76182b1
Update CHANGELOG.md
BSd3v Jun 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Links "DE#nnn" prior to version 2.0 point to the Dash Enterprise closed-source D

### Added
- [#453](https://github.com/plotly/dash-ag-grid/pull/453) Test for changelog entry
- [#448](https://github.com/plotly/dash-ag-grid/pull/448) Added support for AG-Charts (split out in v33 of AG Grid). Integrated Charts require enableEnterpriseModules=True, dashChartMode="community" or "enterprise", and dashGridOptions={"enableCharts": True}.
- [#455](https://github.com/plotly/dash-ag-grid/pull/455) Added support for dynamic `detailCellRendererParams` in Master/Detail, including dynamic detail-grid column definitions.

### Changed
Expand Down
58 changes: 54 additions & 4 deletions src/lib/components/AgGrid.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ ModuleRegistry.registerModules([AllCommunityModule]);
const RealAgGrid = lazy(LazyLoader.agGrid);
const RealAgGridEnterprise = lazy(LazyLoader.agGridEnterprise);

function getGrid(enable) {
return enable ? RealAgGridEnterprise : RealAgGrid;
function getGrid(enableEnterpriseModules) {
return enableEnterpriseModules ? RealAgGridEnterprise : RealAgGrid;
}

export const defaultProps = {
Expand Down Expand Up @@ -64,12 +64,50 @@ function DashAgGrid(props) {
}
}, [props.rowTransaction, state.mounted, buildArray]);

const {enableEnterpriseModules} = props;
const {
enableEnterpriseModules,
dashChartMode,
dashGridOptions = {},
} = props;
const normalizedDashChartMode =
typeof dashChartMode === 'undefined' || dashChartMode === null
? false
: dashChartMode;
const hasConflictingEnableChartsSetting =
normalizedDashChartMode && dashGridOptions.enableCharts === false;
const gridDashOptions = normalizedDashChartMode
? {...dashGridOptions, enableCharts: true}
: dashGridOptions;
const hasEnableCharts = gridDashOptions?.enableCharts;

if (normalizedDashChartMode && !enableEnterpriseModules) {
throw new Error(
'dashChartMode is only supported when enableEnterpriseModules is true.'
);
}

if (hasConflictingEnableChartsSetting) {
throw new Error(
'dashChartMode cannot be combined with dashGridOptions.enableCharts=false.'
);
Comment thread
AnnMarieW marked this conversation as resolved.
}

if (hasEnableCharts && !normalizedDashChartMode) {
throw new Error(
"enableCharts=true requires enableEnterpriseModules=true and dashChartMode='community' or 'enterprise'."
);
}

const RealComponent = getGrid(enableEnterpriseModules);

return (
<Suspense fallback={null}>
<RealComponent parentState={state} {...defaultProps} {...props} />
<RealComponent
parentState={state}
{...defaultProps}
{...props}
dashGridOptions={gridDashOptions}
/>
</Suspense>
);
}
Expand Down Expand Up @@ -494,11 +532,23 @@ DashAgGrid.propTypes = {
*/
licenseKey: PropTypes.string,

/**
* License key for AG Charts Enterprise when dashChartMode is "enterprise".
* If not provided, licenseKey is used.
*/
chartsLicenseKey: PropTypes.string,

/**
* If True, enable ag-grid Enterprise modules. Recommended to use with licenseKey.
*/
enableEnterpriseModules: PropTypes.bool,

/**
* Load enterprise AG Charts modules for integrated charts.
* Set to "enterprise" to load enterprise chart modules or use "community" for community chart modules and set dashGridOptions.enableCharts=true.
*/
dashChartMode: PropTypes.oneOf(['enterprise', 'community']),
Comment thread
AnnMarieW marked this conversation as resolved.

/**
* The rowData in the grid after inline filters are applied.
*/
Expand Down
24 changes: 22 additions & 2 deletions src/lib/fragments/AgGridEnterprise.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ import React from 'react';
import {ModuleRegistry} from 'ag-grid-community';
import {
AllEnterpriseModule,
IntegratedChartsModule,
LicenseManager,
SparklinesModule,
} from 'ag-grid-enterprise';
import {AgChartsEnterpriseModule} from 'ag-charts-enterprise';
import {AgChartsCommunityModule} from 'ag-charts-community';
import {
AgChartsEnterpriseModule,
LicenseManager as AgChartsLicenseManager,
} from 'ag-charts-enterprise';
import MemoizedAgGrid, {propTypes} from './AgGrid.react';

// Register all enterprise features
Expand All @@ -15,10 +20,25 @@ ModuleRegistry.registerModules([
]);

export default function DashAgGridEnterprise(props) {
const {licenseKey} = props;
const {licenseKey, chartsLicenseKey, dashChartMode} = props;
if (licenseKey) {
LicenseManager.setLicenseKey(licenseKey);
}
if (dashChartMode) {
if (dashChartMode === 'enterprise') {
const effectiveChartsLicenseKey = chartsLicenseKey || licenseKey;
if (effectiveChartsLicenseKey) {
AgChartsLicenseManager.setLicenseKey(effectiveChartsLicenseKey);
}
ModuleRegistry.registerModules([
IntegratedChartsModule.with(AgChartsEnterpriseModule),
]);
} else {
ModuleRegistry.registerModules([
IntegratedChartsModule.with(AgChartsCommunityModule),
]);
}
}
return <MemoizedAgGrid {...props} />;
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/propCategories.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ export const PROPS_NOT_FOR_AG_GRID = [
'setProps',
'loading_state',
'enableEnterpriseModules',
'dashChartMode',
'parentState',
'persistence',
'persisted_props',
Expand Down
150 changes: 150 additions & 0 deletions tests/test_charts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import dash_ag_grid as dag
from dash import Dash, html
from . import utils
from dash.testing.wait import until


def _make_chart_grid(**extra_props):
return [
html.Div(id='loaded', children='true'),
dag.AgGrid(
id="grid",
columnDefs=[{"field": "make"}, {"field": "model"}, {"field": "price"}],
rowData=[
{"make": "Toyota", "model": "Celica", "price": 35000},
{"make": "Ford", "model": "Mondeo", "price": 32000},
{"make": "Porsche", "model": "Boxster", "price": 72000},
],
**extra_props,
)
]


def _make_basic_grid(**extra_props):
return [
html.Div(id='loaded', children='true'),
dag.AgGrid(
id="grid",
columnDefs=[{"field": "make"}, {"field": "model"}, {"field": "price"}],
rowData=[
{"make": "Toyota", "model": "Celica", "price": 35000},
{"make": "Ford", "model": "Mondeo", "price": 32000},
{"make": "Porsche", "model": "Boxster", "price": 72000},
],
**extra_props,
)
]


def test_charts001_enables_enterprise_charts_modules_with_true(dash_duo):
app = Dash(__name__)
app.layout = html.Div(
_make_chart_grid(enableEnterpriseModules=True, dashChartMode="enterprise")
)

dash_duo.start_server(app)

grid = utils.Grid(dash_duo, "grid")
grid.wait_for_cell_text(0, 0, "Toyota")

assert not any(
"AG Grid: error #200" in entry.get("message", "")
for entry in dash_duo.get_logs()
)


def test_charts002_enables_enterprise_charts_modules(dash_duo):
app = Dash(__name__)
app.layout = html.Div(
_make_chart_grid(
enableEnterpriseModules=True,
dashChartMode="enterprise",
)
)

dash_duo.start_server(app)

grid = utils.Grid(dash_duo, "grid")
grid.wait_for_cell_text(0, 0, "Toyota")

assert not any(
"AG Grid: error #200" in entry.get("message", "")
for entry in dash_duo.get_logs()
)


def test_charts003_keeps_enterprise_grid_without_charts(dash_duo):
app = Dash(__name__)
app.layout = html.Div(_make_basic_grid(enableEnterpriseModules=True))

dash_duo.start_server(app)

grid = utils.Grid(dash_duo, "grid")
grid.wait_for_cell_text(0, 0, "Toyota")


def test_charts004_rejects_charts_on_community_grid(dash_duo):
app = Dash(__name__)
app.layout = html.Div(_make_chart_grid(dashChartMode="enterprise"))

dash_duo.start_server(app)
until(lambda: dash_duo.find_element('#loaded').text == 'true', 10)

assert any(
"dashChartMode is only supported when enableEnterpriseModules is true."
in entry.get("message", "")
for entry in dash_duo.get_logs()
)


def test_charts005_rejects_enablecharts_without_dashenablecharts(dash_duo):
app = Dash(__name__)
app.layout = html.Div(
_make_chart_grid(dashGridOptions={"enableCharts": True})
)

dash_duo.start_server(app)
until(lambda: dash_duo.find_element('#loaded').text == 'true', 10)

assert any(
"enableCharts=true requires enableEnterpriseModules=true and dashChartMode='community' or 'enterprise'."
in entry.get("message", "")
for entry in dash_duo.get_logs()
)


def test_charts006_rejects_conflicting_enablecharts_false(dash_duo):
app = Dash(__name__)
app.layout = html.Div(
_make_chart_grid(
enableEnterpriseModules=True,
dashChartMode="enterprise",
dashGridOptions={"enableCharts": False},
)
)

dash_duo.start_server(app)
until(lambda: dash_duo.find_element('#loaded').text == 'true', 10)

assert any(
"dashChartMode cannot be combined with dashGridOptions.enableCharts=false."
in entry.get("message", "")
for entry in dash_duo.get_logs()
)


def test_charts007_accepts_charts_license_key_prop(dash_duo):
app = Dash(__name__)
app.layout = html.Div(
_make_chart_grid(
enableEnterpriseModules=True,
dashChartMode="enterprise",
licenseKey="grid-key",
chartsLicenseKey="charts-key",
)
)

dash_duo.start_server(app)

grid = utils.Grid(dash_duo, "grid")
grid.wait_for_cell_text(0, 0, "Toyota")
Loading