Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6b6b551
Bump AG Grid version
KoolADE85 Jul 2, 2025
04f8c28
Remove rowSelection from AG Grid props
KoolADE85 Jul 3, 2025
10d17d1
Memoize component
KoolADE85 Jul 4, 2025
222ad7e
Merge branch 'refactor/functional-component' into feature/ag-grid-34
KoolADE85 Jul 4, 2025
6fd20f8
Include sparklines module from ag-grid-enterprise
KoolADE85 Jul 10, 2025
1039821
Upgrade to AG Grid 33 instead of 34
KoolADE85 Jul 10, 2025
df6cd45
code cleanup
KoolADE85 Jul 10, 2025
e47d529
Merge branch 'refactor/functional-component' into feature/ag-grid-34
KoolADE85 Jul 10, 2025
02ddf77
Merge branch 'refactor/functional-component' into feature/ag-grid-34
KoolADE85 Jul 10, 2025
b2b9f55
code cleanup
KoolADE85 Jul 10, 2025
2cd615f
Merge branch 'refactor/functional-component' into feature/ag-grid-34
KoolADE85 Jul 14, 2025
813f024
Merge branch 'main' into feature/ag-grid-33
KoolADE85 Jul 18, 2025
528ed11
Merge branch 'main' into feature/ag-grid-33
KoolADE85 Jul 18, 2025
317666e
Merge branch 'main' into feature/ag-grid-33
KoolADE85 Jul 18, 2025
8c67d20
Remove default & legacy theme code
KoolADE85 Jul 18, 2025
edee45d
Ensure compatibility between legacy themes and modern themes
KoolADE85 Jul 21, 2025
e604f0c
Lazy load css for legacy themes
KoolADE85 Jul 22, 2025
739b1b7
Lazy load css for legacy themes
KoolADE85 Jul 22, 2025
ff98be1
Revert "Lazy load css for legacy themes"
KoolADE85 Jul 22, 2025
70251dd
Revert "Lazy load css for legacy themes"
KoolADE85 Jul 22, 2025
f189f5d
Add a `themes` module for external stylesheet usage
KoolADE85 Jul 22, 2025
65dffdf
remove unnecessary files
KoolADE85 Jul 22, 2025
cdfff73
Add e2e test for legacy theme css
KoolADE85 Jul 23, 2025
6d908c0
Merge branch 'main' into feature/ag-grid-33
KoolADE85 Jul 23, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# Build artifacts
dash_ag_grid/*
!dash_ag_grid/__init__.py
!dash_ag_grid/_version.py
!dash_ag_grid/themes.py
R/
deps/
man/
Expand Down
9 changes: 3 additions & 6 deletions dash_ag_grid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,18 @@
# noinspection PyUnresolvedReferences
from ._imports_ import *
from ._imports_ import __all__
from dash_ag_grid import themes

if not hasattr(_dash, '__plotly_dash') and not hasattr(_dash, 'development'):
print('Dash was not successfully imported. '
'Make sure you don\'t have a file '
'named \n"dash.py" in your current directory.', file=_sys.stderr)
_sys.exit(1)

_basepath = _os.path.dirname(__file__)
_filepath = _os.path.abspath(_os.path.join(_basepath, 'package-info.json'))
with open(_filepath) as f:
package = json.load(f)
from ._version import __version__, grid_version, get_package_info

package = get_package_info()
package_name = package['name'].replace(' ', '_').replace('-', '_')
__version__ = package['version']
grid_version = package['dependencies']['ag-grid-community']

_current_path = _os.path.dirname(_os.path.abspath(__file__))

Expand Down
12 changes: 12 additions & 0 deletions dash_ag_grid/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import json
import os

def get_package_info():
basepath = os.path.dirname(__file__)
filepath = os.path.abspath(os.path.join(basepath, 'package-info.json'))
with open(filepath) as f:
return json.load(f)

package = get_package_info()
__version__ = package['version']
grid_version = package['dependencies']['ag-grid-community']
9 changes: 9 additions & 0 deletions dash_ag_grid/themes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from ._version import grid_version

_base_url = f"https://cdn.jsdelivr.net/npm/ag-grid-community@{grid_version}/styles"

BASE = f"{_base_url}/ag-grid.min.css"
ALPINE = f"{_base_url}/ag-theme-alpine.min.css"
BALHAM = f"{_base_url}/ag-theme-balham.min.css"
MATERIAL = f"{_base_url}/ag-theme-material.min.css"
QUARTZ = f"{_base_url}/ag-theme-quartz.min.css"
158 changes: 104 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-ag-grid",
"version": "32.3.0",
"version": "33.3.2rc0",
"description": "Dash wrapper around AG Grid, the best interactive data grid for the web.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -32,11 +32,11 @@
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"ag-grid-community": "32.3.4",
"ag-grid-enterprise": "32.3.4",
"ag-grid-react": "32.3.4",
"@mui/icons-material": "^5.15.7",
"@mui/material": "^5.15.7",
"ag-grid-community": "33.3.2",
"ag-grid-enterprise": "33.3.2",
"ag-grid-react": "33.3.2",
"d3-format": "^3.1.0",
"d3-time": "^3.1.0",
"d3-time-format": "^4.1.0",
Expand Down
6 changes: 5 additions & 1 deletion src/lib/components/AgGrid.react.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import PropTypes from 'prop-types';
import LazyLoader from '../LazyLoader';
import React, {lazy, Suspense, useState, useCallback, useEffect} from 'react';
import {AllCommunityModule, ModuleRegistry} from 'ag-grid-community';

// Register all community features
ModuleRegistry.registerModules([AllCommunityModule]);

const RealAgGrid = lazy(LazyLoader.agGrid);
const RealAgGridEnterprise = lazy(LazyLoader.agGridEnterprise);
Expand Down Expand Up @@ -53,7 +57,7 @@ function DashAgGrid(props) {
DashAgGrid.dashRenderType = true;

DashAgGrid.defaultProps = {
className: 'ag-theme-alpine',
className: '',
resetColumnState: false,
exportDataAsCsv: false,
selectAll: false,
Expand Down
24 changes: 18 additions & 6 deletions src/lib/fragments/AgGrid.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ import RowMenuRenderer from '../renderers/rowMenuRenderer';
import {customFunctions} from '../renderers/customFunctions';

import {AgGridReact, useGridFilter} from 'ag-grid-react';

import 'ag-grid-community/styles/ag-grid.css';
import 'ag-grid-community/styles/ag-theme-alpine.css';
import 'ag-grid-community/styles/ag-theme-balham.css';
import 'ag-grid-community/styles/ag-theme-material.css';
import 'ag-grid-community/styles/ag-theme-quartz.css';
import {
themeAlpine,
themeBalham,
themeMaterial,
themeQuartz,
} from 'ag-grid-community';
const themes = {themeAlpine, themeBalham, themeMaterial, themeQuartz};

// d3 imports
import * as d3Format from 'd3-format';
Expand Down Expand Up @@ -159,6 +160,7 @@ export function DashAgGrid(props) {
const parsedCondition =
esprima.parse(funcString).body[0].expression;
const context = {
...themes,
d3,
dash_clientside,
...customFunctions,
Expand All @@ -176,6 +178,7 @@ export function DashAgGrid(props) {
const parsedCondition =
esprima.parse(funcString).body[0].expression;
const context = {
...themes,
d3,
dash_clientside,
...customFunctions,
Expand All @@ -195,6 +198,7 @@ export function DashAgGrid(props) {
const parsedCondition =
esprima.parse(funcString).body[0].expression;
const context = {
...themes,
d3,
...customFunctions,
...window.dashAgGridFunctions,
Expand Down Expand Up @@ -1532,6 +1536,14 @@ export function DashAgGrid(props) {
omit(NO_CONVERT_PROPS, {...dashGridOptions, ...restProps})
);

if ('theme' in convertedProps) {
if (typeof convertedProps.theme === 'function') {
convertedProps.theme = convertedProps.theme();
} else if (convertedProps.theme in themes) {
convertedProps.theme = themes[convertedProps.theme];
}
}

let alignedGrids;
if (dashGridOptions) {
if ('alignedGrids' in dashGridOptions) {
Expand Down
Loading