Skip to content

Commit 16ed4db

Browse files
authored
move enterprise docs to rxweb (#1455)
* move enterprise docs to rxweb * remove home links * clean import * fix lockfile * add videos on failure * stuff for video * fix tests * fix ? * test something * na * remove successful test from videos * remove some prints * wait longer * fix stuff * fix sidebar
1 parent 238d6ee commit 16ed4db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3929
-1228
lines changed

.github/workflows/unit_tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,11 @@ jobs:
5959

6060
- name: Run unit tests
6161
run: pytest tests
62+
63+
- name: Upload test failure videos
64+
if: failure()
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: playwright-videos-${{ matrix.os }}-${{ matrix.python-version }}
68+
path: test-videos/
69+
if-no-files-found: ignore

docs/enterprise/ag_chart.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# AG Chart
2+
3+
AG Chart is a powerful charting library that provides interactive charts and data visualization components for enterprise applications.
4+
5+
```python demo exec toggle
6+
import reflex as rx
7+
import reflex_enterprise as rxe
8+
9+
def basic_chart():
10+
return rxe.ag_chart(
11+
options={
12+
"data": [
13+
{"month": "Jan", "value": 10},
14+
{"month": "Feb", "value": 20},
15+
{"month": "Mar", "value": 15},
16+
],
17+
"series": [
18+
{
19+
"type": "line",
20+
"xKey": "month",
21+
"yKey": "value",
22+
}
23+
],
24+
},
25+
width="100%",
26+
height="400px",
27+
)
28+
```
29+
30+
For more detailed documentation, see the [AG Chart Documentation](https://charts.ag-grid.com/).
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Aligned Grids
3+
---
4+
5+
AgGrid provides a way to align multiple grids together. This is useful when you want to display related data in a synchronized manner.
6+
7+
You can do so through the `aligned_grids` prop. This prop takes a list of grid IDs that you want to align.
8+
9+
```python demo exec toggle
10+
import pandas as pd
11+
12+
import reflex_enterprise as rxe
13+
14+
df = pd.read_json("https://www.ag-grid.com/example-assets/olympic-winners.json")
15+
16+
row_data = df.to_dict("records")
17+
18+
column_defs = [
19+
{"field": "athlete"},
20+
{"field": "age"},
21+
{"field": "country"},
22+
{"field": "year"},
23+
{"field": "sport"},
24+
{
25+
"header_name": "Medals",
26+
"children": [
27+
{
28+
"field": "total",
29+
"column_group_show": "closed",
30+
"col_id": "total",
31+
"value_getter": "params.data.gold + params.data.silver + params.data.bronze",
32+
"width": 100,
33+
},
34+
{"field": "gold", "column_group_show": "open", "width": 100},
35+
{"field": "silver", "column_group_show": "open", "width": 100},
36+
{"field": "bronze", "column_group_show": "open", "width": 100},
37+
],
38+
},
39+
]
40+
41+
def aligned_grids_page():
42+
"""Aligned grids demo."""
43+
return rxe.ag_grid(
44+
id="grid1",
45+
column_defs=column_defs,
46+
row_data=row_data,
47+
aligned_grids=["grid2"],
48+
width="100%",
49+
), rxe.ag_grid(
50+
id="grid2",
51+
column_defs=column_defs,
52+
row_data=row_data,
53+
aligned_grids=["grid1"],
54+
width="100%",
55+
)
56+
57+
```
58+
59+
```md alert warning
60+
# 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.
61+
```
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
order: 1
3+
---
4+
5+
```python exec
6+
from pcweb.pages.docs import enterprise
7+
```
8+
9+
# Column Definitions
10+
11+
## Basic Columns
12+
13+
AgGrid allows you to define the columns of your grid, passed to the prop `column_defs`. Each dictionary represents a column.
14+
15+
```md alert warning
16+
# If you are converting from other AG Grid implementation, we also support camelCase for the name of the properties.
17+
```
18+
19+
Here we define a grid with 3 columns:
20+
```python
21+
column_defs = [
22+
{"field": "direction"},
23+
{"field": "strength"},
24+
{"field": "frequency"},
25+
]
26+
```
27+
28+
To set default properties for all your columns, you can define `default_col_def` in your grid:
29+
```python
30+
default_col_def = {
31+
"sortable": True,
32+
"filter": True,
33+
"resizable": True,
34+
}
35+
```

0 commit comments

Comments
 (0)