Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
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
8 changes: 8 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,11 @@ jobs:

- name: Run unit tests
run: pytest tests

- name: Upload test failure videos
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-videos-${{ matrix.os }}-${{ matrix.python-version }}
path: test-videos/
if-no-files-found: ignore
30 changes: 30 additions & 0 deletions docs/enterprise/ag_chart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# AG Chart

AG Chart is a powerful charting library that provides interactive charts and data visualization components for enterprise applications.

```python demo exec toggle
import reflex as rx
import reflex_enterprise as rxe

def basic_chart():
return rxe.ag_chart(
options={
"data": [
{"month": "Jan", "value": 10},
{"month": "Feb", "value": 20},
{"month": "Mar", "value": 15},
],
"series": [
{
"type": "line",
"xKey": "month",
"yKey": "value",
}
],
},
width="100%",
height="400px",
)
```

For more detailed documentation, see the [AG Chart Documentation](https://charts.ag-grid.com/).
61 changes: 61 additions & 0 deletions docs/enterprise/ag_grid/aligned-grids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Aligned Grids
---

AgGrid provides a way to align multiple grids together. This is useful when you want to display related data in a synchronized manner.

You can do so through the `aligned_grids` prop. This prop takes a list of grid IDs that you want to align.

```python demo exec toggle
import pandas as pd

import reflex_enterprise as rxe

df = pd.read_json("https://www.ag-grid.com/example-assets/olympic-winners.json")

row_data = df.to_dict("records")

column_defs = [
{"field": "athlete"},
{"field": "age"},
{"field": "country"},
{"field": "year"},
{"field": "sport"},
{
"header_name": "Medals",
"children": [
{
"field": "total",
"column_group_show": "closed",
"col_id": "total",
"value_getter": "params.data.gold + params.data.silver + params.data.bronze",
"width": 100,
},
{"field": "gold", "column_group_show": "open", "width": 100},
{"field": "silver", "column_group_show": "open", "width": 100},
{"field": "bronze", "column_group_show": "open", "width": 100},
],
},
]

def aligned_grids_page():
"""Aligned grids demo."""
return rxe.ag_grid(
id="grid1",
column_defs=column_defs,
row_data=row_data,
aligned_grids=["grid2"],
width="100%",
), rxe.ag_grid(
id="grid2",
column_defs=column_defs,
row_data=row_data,
aligned_grids=["grid1"],
width="100%",
)

```

```md alert warning
# The pivot functionality does not work with aligned grids. This is because pivoting data changes the columns, which would make the aligned grids incompatible, as they are no longer sharing the same set of columns.
```
35 changes: 35 additions & 0 deletions docs/enterprise/ag_grid/column-defs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
order: 1
---

```python exec
from pcweb.pages.docs import enterprise
```

# Column Definitions

## Basic Columns

AgGrid allows you to define the columns of your grid, passed to the prop `column_defs`. Each dictionary represents a column.

```md alert warning
# If you are converting from other AG Grid implementation, we also support camelCase for the name of the properties.
```

Here we define a grid with 3 columns:
```python
column_defs = [
{"field": "direction"},
{"field": "strength"},
{"field": "frequency"},
]
```

To set default properties for all your columns, you can define `default_col_def` in your grid:
```python
default_col_def = {
"sortable": True,
"filter": True,
"resizable": True,
}
```
Loading