Skip to content

Update to latest aggrid / nicegui API#6

Open
xaptronic wants to merge 2 commits intomainfrom
refresh
Open

Update to latest aggrid / nicegui API#6
xaptronic wants to merge 2 commits intomainfrom
refresh

Conversation

@xaptronic
Copy link
Owner

Summary: Pre-Built Bundle Branch (Main)

Core Changes

Two Python Classes (aggrid.py)

  • AgGridEnterprise — AG Grid Enterprise with AG Charts Community (smaller bundle)
  • AgGridEnterpriseCharts — AG Grid Enterprise with AG Charts Enterprise (full features)

Two JavaScript Bundles

  • dist/index.js — imports AgChartsCommunityModule
  • dist-enterprise-charts/index.js — imports AgChartsEnterpriseModule

File Structure

src/nicegui_aggrid_enterprise/
├── __init__.py              # Exports AgGridEnterprise, AgGridEnterpriseCharts
├── aggrid.py                # Both class definitions
├── aggrid_enterprise.js     # Vue component (community charts)
├── aggrid_enterprise_charts.js  # Vue component (enterprise charts)
├── dist/index.js            # Pre-built bundle (community)
├── dist-enterprise-charts/index.js  # Pre-built bundle (enterprise)
└── src/
    ├── index.mjs            # Entry for community bundle
    └── index-enterprise-charts.mjs  # Entry for enterprise bundle

Key Updates from Original

  • AG Grid 35.0.0 (was older version)
  • NiceGUI 3.0.0+ compatibility (ESM module loading)
  • New theming APIAgGrid.themes[theme].withPart(colorSchemeVariable)
  • Dark mode support — MutationObserver watches body--dark class
  • New AG Grid options syntaxrowSelection: {mode: "multiRow"}, cellSelection: true
  • Charts module registrationIntegratedChartsModule.with(AgChartsCommunityModule)
  • Renamed class from AgGridAgGridEnterprise (avoids conflict with NiceGUI's built-in)

Usage

from nicegui_aggrid_enterprise import AgGridEnterprise, AgGridEnterpriseCharts

# Community charts (smaller)
AgGridEnterprise.license_key = "YOUR_KEY"
grid = AgGridEnterprise(options)

# Enterprise charts (full features)
AgGridEnterpriseCharts.license_key = "YOUR_KEY"
grid = AgGridEnterpriseCharts(options)

- Update AG Grid Enterprise from 33.3.2 to 35.0.0
- Switch to ESM module bundling with Rollup (matches NiceGUI 3.0+ architecture)
- Add new theming API with automatic dark mode support
- Add from_pandas() and from_polars() class methods
- Add property setters for theme, options, html_columns, auto_size_columns
- Use built-in autoSizeStrategy instead of manual sizeColumnsToFit()
- Change default theme from 'balham' to 'quartz'
- Rename JS component to aggrid_enterprise.js to avoid collision with built-in
- Requires NiceGUI >= 3.0.0
- Add test_app.py for testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant