Skip to content

Commit c8d2ec1

Browse files
authored
Merge branch 'main' into devin/1752764199-fix-edit-page-link
2 parents 032802d + fce9247 commit c8d2ec1

40 files changed

+1112
-169
lines changed

blog/2024-03-21-reflex-architecture.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ class GithubState(rx.State):
3232
def set_profile(self, username: str):
3333
if username == "":
3434
return
35-
github_data = requests.get(f"https://api.github.com/users/{username}").json()
35+
try:
36+
github_data = requests.get(f"https://api.github.com/users/{username}").json()
37+
except:
38+
return
3639
self.url = github_data["url"]
3740
self.profile_image = github_data["avatar_url"]
3841

data/GanttChart-updated.csv

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Task,Start,Duration,Resource
2+
Task 1,1/1/2016,50,A
3+
Task 2,2/20/2016,25,B
4+
Task 3,1/1/2016,100,C
5+
Task 4,4/10/2016,60,C
6+
Task 5,6/9/2016,30,C
7+
Task 6,4/10/2016,150,A
8+
Task 7,9/7/2016,80,B
9+
Task 8,11/26/2016,10,B

data/gapminder2007.csv

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
country,pop,continent,lifeExp,gdpPercap
2+
Afghanistan,31889923.0,Asia,43.828,974.5803384
3+
Albania,3600523.0,Europe,76.423,5937.029525999999
4+
Algeria,33333216.0,Africa,72.301,6223.367465
5+
Angola,12420476.0,Africa,42.731,4797.231267
6+
Argentina,40301927.0,Americas,75.32,12779.379640000001
7+
Australia,20434176.0,Oceania,81.235,34435.367439999995
8+
Austria,8199783.0,Europe,79.829,36126.4927
9+
Bahrain,708573.0,Asia,75.635,29796.048339999998
10+
Bangladesh,150448339.0,Asia,64.062,1391.253792
11+
Belgium,10392226.0,Europe,79.441,33692.60508
12+
Benin,8078314.0,Africa,56.728,1441.284873
13+
Bolivia,9119152.0,Americas,65.554,3822.1370840000004
14+
Bosnia and Herzegovina,4552198.0,Europe,74.852,7446.298803
15+
Botswana,1639131.0,Africa,50.728,12569.851770000001
16+
Brazil,190010647.0,Americas,72.39,9065.800825
17+
Bulgaria,7322858.0,Europe,73.005,10680.79282
18+
Burkina Faso,14326203.0,Africa,52.295,1217.032994
19+
Burundi,8390505.0,Africa,49.58,430.07069160000003
20+
Cambodia,14131858.0,Asia,59.723,1713.7786859999999
21+
Cameroon,17696293.0,Africa,50.43,2042.0952399999999
22+
Canada,33390141.0,Americas,80.653,36319.235010000004
23+
Central African Republic,4369038.0,Africa,44.74100000000001,706.016537
24+
Chad,10238807.0,Africa,50.651,1704.0637239999999
25+
Chile,16284741.0,Americas,78.553,13171.63885
26+
China,1318683096.0,Asia,72.961,4959.1148539999995
27+
Colombia,44227550.0,Americas,72.889,7006.580419
28+
Comoros,710960.0,Africa,65.152,986.1478792000001
29+
"Congo, Dem. Rep.",64606759.0,Africa,46.461999999999996,277.55185869999997
30+
"Congo, Rep.",3800610.0,Africa,55.321999999999996,3632.557798
31+
Costa Rica,4133884.0,Americas,78.782,9645.06142
32+
Cote d'Ivoire,18013409.0,Africa,48.328,1544.750112
33+
Croatia,4493312.0,Europe,75.748,14619.222719999998
34+
Cuba,11416987.0,Americas,78.273,8948.102923
35+
Czech Republic,10228744.0,Europe,76.486,22833.30851
36+
Denmark,5468120.0,Europe,78.332,35278.41874
37+
Djibouti,496374.0,Africa,54.791000000000004,2082.4815670000003
38+
Dominican Republic,9319622.0,Americas,72.235,6025.374752000001
39+
Ecuador,13755680.0,Americas,74.994,6873.262326000001
40+
Egypt,80264543.0,Africa,71.33800000000001,5581.180998
41+
El Salvador,6939688.0,Americas,71.878,5728.353514
42+
Equatorial Guinea,551201.0,Africa,51.57899999999999,12154.08975
43+
Eritrea,4906585.0,Africa,58.04,641.3695236000001
44+
Ethiopia,76511887.0,Africa,52.946999999999996,690.8055759
45+
Finland,5238460.0,Europe,79.313,33207.0844
46+
France,61083916.0,Europe,80.657,30470.0167
47+
Gabon,1454867.0,Africa,56.735,13206.48452
48+
Gambia,1688359.0,Africa,59.448,752.7497265
49+
Germany,82400996.0,Europe,79.406,32170.37442
50+
Ghana,22873338.0,Africa,60.022,1327.60891
51+
Greece,10706290.0,Europe,79.483,27538.41188
52+
Guatemala,12572928.0,Americas,70.259,5186.050003
53+
Guinea,9947814.0,Africa,56.007,942.6542111
54+
Guinea-Bissau,1472041.0,Africa,46.388000000000005,579.2317429999999
55+
Haiti,8502814.0,Americas,60.916000000000004,1201.637154
56+
Honduras,7483763.0,Americas,70.19800000000001,3548.3308460000003
57+
"Hong Kong, China",6980412.0,Asia,82.208,39724.97867
58+
Hungary,9956108.0,Europe,73.33800000000001,18008.94444
59+
Iceland,301931.0,Europe,81.757,36180.789189999996
60+
India,1110396331.0,Asia,64.69800000000001,2452.210407
61+
Indonesia,223547000.0,Asia,70.65,3540.6515640000002
62+
Iran,69453570.0,Asia,70.964,11605.71449
63+
Iraq,27499638.0,Asia,59.545,4471.061906
64+
Ireland,4109086.0,Europe,78.885,40675.99635
65+
Israel,6426679.0,Asia,80.745,25523.2771
66+
Italy,58147733.0,Europe,80.546,28569.7197
67+
Jamaica,2780132.0,Americas,72.567,7320.880262000001
68+
Japan,127467972.0,Asia,82.603,31656.06806
69+
Jordan,6053193.0,Asia,72.535,4519.461171
70+
Kenya,35610177.0,Africa,54.11,1463.249282
71+
"Korea, Dem. Rep.",23301725.0,Asia,67.297,1593.06548
72+
"Korea, Rep.",49044790.0,Asia,78.623,23348.139730000003
73+
Kuwait,2505559.0,Asia,77.58800000000001,47306.98978
74+
Lebanon,3921278.0,Asia,71.993,10461.05868
75+
Lesotho,2012649.0,Africa,42.592,1569.331442
76+
Liberia,3193942.0,Africa,45.678000000000004,414.5073415
77+
Libya,6036914.0,Africa,73.952,12057.49928
78+
Madagascar,19167654.0,Africa,59.443000000000005,1044.770126
79+
Malawi,13327079.0,Africa,48.303000000000004,759.3499101
80+
Malaysia,24821286.0,Asia,74.241,12451.6558
81+
Mali,12031795.0,Africa,54.467,1042.581557
82+
Mauritania,3270065.0,Africa,64.164,1803.1514960000002
83+
Mauritius,1250882.0,Africa,72.801,10956.99112
84+
Mexico,108700891.0,Americas,76.195,11977.57496
85+
Mongolia,2874127.0,Asia,66.803,3095.7722710000003
86+
Montenegro,684736.0,Europe,74.543,9253.896111
87+
Morocco,33757175.0,Africa,71.164,3820.17523
88+
Mozambique,19951656.0,Africa,42.082,823.6856205
89+
Myanmar,47761980.0,Asia,62.068999999999996,944.0
90+
Namibia,2055080.0,Africa,52.906000000000006,4811.060429
91+
Nepal,28901790.0,Asia,63.785,1091.359778
92+
Netherlands,16570613.0,Europe,79.762,36797.93332
93+
New Zealand,4115771.0,Oceania,80.204,25185.00911
94+
Nicaragua,5675356.0,Americas,72.899,2749.320965
95+
Niger,12894865.0,Africa,56.867,619.6768923999999
96+
Nigeria,135031164.0,Africa,46.858999999999995,2013.9773050000001
97+
Norway,4627926.0,Europe,80.196,49357.19017
98+
Oman,3204897.0,Asia,75.64,22316.19287
99+
Pakistan,169270617.0,Asia,65.483,2605.94758
100+
Panama,3242173.0,Americas,75.53699999999999,9809.185636
101+
Paraguay,6667147.0,Americas,71.752,4172.838464
102+
Peru,28674757.0,Americas,71.421,7408.905561
103+
Philippines,91077287.0,Asia,71.688,3190.481016
104+
Poland,38518241.0,Europe,75.563,15389.924680000002
105+
Portugal,10642836.0,Europe,78.098,20509.64777
106+
Puerto Rico,3942491.0,Americas,78.74600000000001,19328.70901
107+
Reunion,798094.0,Africa,76.442,7670.122558
108+
Romania,22276056.0,Europe,72.476,10808.47561
109+
Rwanda,8860588.0,Africa,46.242,863.0884639000001
110+
Sao Tome and Principe,199579.0,Africa,65.528,1598.435089
111+
Saudi Arabia,27601038.0,Asia,72.777,21654.83194
112+
Senegal,12267493.0,Africa,63.062,1712.4721359999999
113+
Serbia,10150265.0,Europe,74.002,9786.534714
114+
Sierra Leone,6144562.0,Africa,42.568000000000005,862.5407561000001
115+
Singapore,4553009.0,Asia,79.972,47143.179639999995
116+
Slovak Republic,5447502.0,Europe,74.663,18678.31435
117+
Slovenia,2009245.0,Europe,77.926,25768.25759
118+
Somalia,9118773.0,Africa,48.159,926.1410683
119+
South Africa,43997828.0,Africa,49.339,9269.657808
120+
Spain,40448191.0,Europe,80.941,28821.0637
121+
Sri Lanka,20378239.0,Asia,72.396,3970.0954070000003
122+
Sudan,42292929.0,Africa,58.556000000000004,2602.394995
123+
Swaziland,1133066.0,Africa,39.613,4513.480643
124+
Sweden,9031088.0,Europe,80.884,33859.74835
125+
Switzerland,7554661.0,Europe,81.70100000000001,37506.419069999996
126+
Syria,19314747.0,Asia,74.143,4184.548089
127+
Taiwan,23174294.0,Asia,78.4,28718.27684
128+
Tanzania,38139640.0,Africa,52.516999999999996,1107.482182
129+
Thailand,65068149.0,Asia,70.616,7458.3963269999995
130+
Togo,5701579.0,Africa,58.42,882.9699437999999
131+
Trinidad and Tobago,1056608.0,Americas,69.819,18008.50924
132+
Tunisia,10276158.0,Africa,73.923,7092.923025
133+
Turkey,71158647.0,Europe,71.777,8458.276384
134+
Uganda,29170398.0,Africa,51.542,1056.3801210000001
135+
United Kingdom,60776238.0,Europe,79.425,33203.26128
136+
United States,301139947.0,Americas,78.242,42951.65309
137+
Uruguay,3447496.0,Americas,76.384,10611.46299
138+
Venezuela,26084662.0,Americas,73.747,11415.805690000001
139+
Vietnam,85262356.0,Asia,74.249,2441.576404
140+
West Bank and Gaza,4018332.0,Asia,73.422,3025.349798
141+
"Yemen, Rep.",22211743.0,Asia,62.698,2280.769906
142+
Zambia,11746035.0,Africa,42.38399999999999,1271.211593
143+
Zimbabwe,12311143.0,Africa,43.486999999999995,469.70929810000007

data/olympic-winners.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

data/wind_dataset.csv

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
direction,strength,frequency
2+
N,0-1,0.5
3+
NNE,0-1,0.6
4+
NE,0-1,0.5
5+
ENE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.8
78+
W,4-4,0.9
79+
WNW,4-4,1
80+
NW,4-4,1
81+
NNW,4-4,0.7
82+
N,4-5,0.3
83+
NNE,4-5,0.3
84+
NE,4-5,0.6
85+
ENE,4-5,0.2
86+
E,4-5,0.1
87+
ESE,4-5,0.1
88+
SE,4-5,0.05
89+
SSE,4-5,0.1
90+
S,4-5,0.1
91+
SSW,4-5,0.2
92+
SW,4-5,0.3
93+
WSW,4-5,0.4
94+
W,4-5,0.9
95+
WNW,4-5,0.9
96+
NW,4-5,0.9
97+
NNW,4-5,0.3
98+
N,5-6,0.2
99+
NNE,5-6,0.1
100+
NE,5-6,0.1
101+
ENE,5-6,0.1
102+
E,5-6,0.1
103+
ESE,5-6,0.1
104+
SE,5-6,0.05
105+
SSE,5-6,0.05
106+
S,5-6,0.1
107+
SSW,5-6,0.05
108+
SW,5-6,0.2
109+
WSW,5-6,0.2
110+
W,5-6,0.4
111+
WNW,5-6,0.7
112+
NW,5-6,0.7
113+
NNW,5-6,0.4
114+
N,6+,0.1
115+
NNE,6+,0.1
116+
NE,6+,0.1
117+
ENE,6+,0.1
118+
E,6+,0.1
119+
ESE,6+,0.05
120+
SE,6+,0.05
121+
SSE,6+,0.05
122+
S,6+,0.05
123+
SSW,6+,0.1
124+
SW,6+,0.1
125+
WSW,6+,0.1
126+
W,6+,0.9
127+
WNW,6+,2.2
128+
NW,6+,1.5
129+
NNW,6+,0.2

docs/advanced_onboarding/how-reflex-works.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ class GithubState(rx.State):
2020
def set_profile(self, username: str):
2121
if username == "":
2222
return
23-
github_data = requests.get(f"https://api.github.com/users/{username}").json()
23+
try:
24+
github_data = requests.get(f"https://api.github.com/users/{username}").json()
25+
except:
26+
return
2427
self.url = github_data["url"]
2528
self.profile_image = github_data["avatar_url"]
2629

docs/database/queries.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class AsyncUserState(rx.State):
211211
async with rx.asession() as asession:
212212
result = await asession.execute(User.select())
213213
async with self:
214-
self.users = (await result.all())
214+
self.users = result.all()
215215
```
216216

217217
### Async Select
@@ -229,7 +229,7 @@ class AsyncQueryUser(rx.State):
229229
stmt = User.select().where(User.username.contains(self.name))
230230
result = await asession.execute(stmt)
231231
async with self:
232-
self.users = (await result.all())
232+
self.users = result.all()
233233
```
234234

235235
### Async Insert
@@ -262,7 +262,7 @@ class AsyncChangeEmail(rx.State):
262262
async with rx.asession() as asession:
263263
stmt = User.select().where(User.username == self.username)
264264
result = await asession.execute(stmt)
265-
user = (await result.first())
265+
user = result.first()
266266
if user:
267267
user.email = self.email
268268
asession.add(user)
@@ -282,7 +282,7 @@ class AsyncRemoveUser(rx.State):
282282
async with rx.asession() as asession:
283283
stmt = User.select().where(User.username == self.username)
284284
result = await asession.execute(stmt)
285-
user = (await result.first())
285+
user = result.first()
286286
if user:
287287
await asession.delete(user)
288288
await asession.commit()
@@ -331,14 +331,14 @@ class AsyncRawSQL(rx.State):
331331
async with rx.asession() as asession:
332332
result = await asession.execute("SELECT * FROM user")
333333
async with self:
334-
self.users = [list(row) for row in (await result.all())]
334+
self.users = [list(row) for row in result.all()]
335335
```
336336

337337
```md alert info
338338
# Important Notes for Async Database Operations
339339
- Always use the `@rx.event(background=True)` decorator for async event handlers
340340
- Most operations against the `asession` must be awaited, including `commit()`, `execute()`, `refresh()`, and `delete()`
341341
- The `add()` method does not need to be awaited
342-
- Result objects from queries have methods like `all()` and `first()` that must be awaited
342+
- Result objects from queries have methods like `all()` and `first()` that are synchronous and return data directly
343343
- Use `async with self:` when updating state variables in background tasks
344344
```

docs/enterprise/ag_chart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
```python demo exec toggle
5+
```python demo exec
66
import reflex as rx
77
import reflex_enterprise as rxe
88

@@ -27,4 +27,4 @@ def basic_chart():
2727
)
2828
```
2929

30-
For more detailed documentation, see the [AG Chart Documentation](https://charts.ag-grid.com/).
30+
For more detailed documentation, see the [AG Chart Documentation](https://charts.ag-grid.com/).

docs/enterprise/ag_grid/aligned-grids.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ AgGrid provides a way to align multiple grids together. This is useful when you
66

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

9-
```python demo exec toggle
9+
```python demo exec
1010
import pandas as pd
1111

1212
import reflex_enterprise as rxe
1313

14-
df = pd.read_json("https://www.ag-grid.com/example-assets/olympic-winners.json")
14+
# Olympic winners data (originally from https://www.ag-grid.com/example-assets/olympic-winners.json)
15+
df = pd.read_json("data/olympic-winners.json")
1516

1617
row_data = df.to_dict("records")
1718

@@ -58,4 +59,4 @@ def aligned_grids_page():
5859

5960
```md alert warning
6061
# 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-
```
62+
```

0 commit comments

Comments
 (0)