reflex 0.5.6a2__py3-none-any.whl → 0.5.7a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of reflex might be problematic. Click here for more details.

Files changed (39) hide show
  1. reflex/.templates/jinja/web/utils/context.js.jinja2 +2 -0
  2. reflex/.templates/web/utils/state.js +31 -2
  3. reflex/app.py +190 -4
  4. reflex/compiler/templates.py +1 -0
  5. reflex/components/base/__init__.py +4 -0
  6. reflex/components/base/__init__.pyi +2 -0
  7. reflex/components/base/error_boundary.py +78 -0
  8. reflex/components/base/error_boundary.pyi +98 -0
  9. reflex/components/radix/primitives/form.py +3 -2
  10. reflex/components/recharts/cartesian.py +31 -16
  11. reflex/components/recharts/cartesian.pyi +46 -22
  12. reflex/components/recharts/charts.py +6 -6
  13. reflex/components/recharts/charts.pyi +10 -10
  14. reflex/components/recharts/general.py +7 -0
  15. reflex/components/recharts/general.pyi +5 -0
  16. reflex/components/recharts/recharts.py +16 -1
  17. reflex/components/recharts/recharts.pyi +1 -0
  18. reflex/config.py +2 -1
  19. reflex/constants/compiler.py +20 -2
  20. reflex/constants/config.py +1 -1
  21. reflex/event.py +9 -0
  22. reflex/experimental/__init__.py +2 -0
  23. reflex/experimental/vars/__init__.py +3 -0
  24. reflex/experimental/vars/base.py +210 -0
  25. reflex/state.py +85 -18
  26. reflex/testing.py +28 -0
  27. reflex/utils/compat.py +7 -5
  28. reflex/utils/console.py +10 -1
  29. reflex/utils/prerequisites.py +11 -5
  30. reflex/utils/processes.py +7 -2
  31. reflex/utils/pyi_generator.py +4 -1
  32. reflex/utils/types.py +35 -30
  33. reflex/vars.py +58 -23
  34. reflex/vars.pyi +4 -1
  35. {reflex-0.5.6a2.dist-info → reflex-0.5.7a1.dist-info}/METADATA +1 -1
  36. {reflex-0.5.6a2.dist-info → reflex-0.5.7a1.dist-info}/RECORD +39 -35
  37. {reflex-0.5.6a2.dist-info → reflex-0.5.7a1.dist-info}/LICENSE +0 -0
  38. {reflex-0.5.6a2.dist-info → reflex-0.5.7a1.dist-info}/WHEEL +0 -0
  39. {reflex-0.5.6a2.dist-info → reflex-0.5.7a1.dist-info}/entry_points.txt +0 -0
@@ -31,7 +31,7 @@ from .recharts import (
31
31
  class Axis(Recharts):
32
32
  """A base class for axes in Recharts."""
33
33
 
34
- # The key of a group of data which should be unique in an area chart.
34
+ # The key of data displayed in the axis.
35
35
  data_key: Var[Union[str, int]]
36
36
 
37
37
  # If set true, the axis do not display in the chart.
@@ -43,9 +43,6 @@ class Axis(Recharts):
43
43
  # The height of axis, which can be setted by user.
44
44
  height: Var[Union[str, int]]
45
45
 
46
- # The orientation of axis 'top' | 'bottom'
47
- orientation: Var[LiteralOrientationTopBottom]
48
-
49
46
  # The type of axis 'number' | 'category'
50
47
  type_: Var[LiteralPolarRadiusType]
51
48
 
@@ -67,6 +64,9 @@ class Axis(Recharts):
67
64
  # Reverse the ticks or not.
68
65
  reversed: Var[bool]
69
66
 
67
+ # The label of axis, which appears next to the axis.
68
+ label: Var[Union[str, int, Dict[str, Any]]]
69
+
70
70
  # If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function
71
71
  scale: Var[LiteralScale]
72
72
 
@@ -94,6 +94,12 @@ class Axis(Recharts):
94
94
  # The minimum gap between two adjacent labels
95
95
  min_tick_gap: Var[int]
96
96
 
97
+ # The stroke color of axis
98
+ stroke: Var[Union[str, Color]]
99
+
100
+ # The text anchor of axis
101
+ text_anchor: Var[str] # 'start', 'middle', 'end'
102
+
97
103
  # The customized event handler of click on the ticks of this axis
98
104
  on_click: EventHandler[lambda: []]
99
105
 
@@ -123,6 +129,9 @@ class XAxis(Axis):
123
129
 
124
130
  alias = "RechartsXAxis"
125
131
 
132
+ # The orientation of axis 'top' | 'bottom'
133
+ orientation: Var[LiteralOrientationTopBottom]
134
+
126
135
  # The id of x-axis which is corresponding to the data.
127
136
  x_axis_id: Var[Union[str, int]]
128
137
 
@@ -140,12 +149,12 @@ class YAxis(Axis):
140
149
  # The orientation of axis 'left' | 'right'
141
150
  orientation: Var[LiteralOrientationLeftRight]
142
151
 
143
- # The key of data displayed in the axis.
144
- data_key: Var[Union[str, int]]
145
-
146
152
  # The id of y-axis which is corresponding to the data.
147
153
  y_axis_id: Var[Union[str, int]]
148
154
 
155
+ # The range of the axis. Work best in conjuction with allow_data_overflow.
156
+ domain: Var[List]
157
+
149
158
 
150
159
  class ZAxis(Recharts):
151
160
  """A ZAxis component in Recharts."""
@@ -177,9 +186,6 @@ class Brush(Recharts):
177
186
 
178
187
  alias = "RechartsBrush"
179
188
 
180
- # Stroke color
181
- stroke: Var[Union[str, Color]]
182
-
183
189
  # The key of data displayed in the axis.
184
190
  data_key: Var[Union[str, int]]
185
191
 
@@ -210,6 +216,12 @@ class Brush(Recharts):
210
216
  # The default end index of brush. If the option is not set, the end index will be 1.
211
217
  end_index: Var[int]
212
218
 
219
+ # The fill color of brush
220
+ fill: Var[Union[str, Color]]
221
+
222
+ # The stroke color of brush
223
+ stroke: Var[Union[str, Color]]
224
+
213
225
  def get_event_triggers(self) -> dict[str, Union[Var, Any]]:
214
226
  """Get the event triggers that pass the component's value to the handler.
215
227
 
@@ -283,13 +295,13 @@ class Area(Cartesian):
283
295
  # The interpolation type of area. And customized interpolation function can be set to type. 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' |
284
296
  type_: Var[LiteralAreaType]
285
297
 
286
- # If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally.
298
+ # If set false, dots will not be drawn. If set true, dots will be drawn which have the props calculated internally.
287
299
  dot: Var[bool]
288
300
 
289
- # The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally.
301
+ # The dot is shown when a user enters an area chart and this chart has a tooltip. If set false, no active dot will be drawn. If set true, an active dot will be drawn which will have the props calculated internally.
290
302
  active_dot: Var[bool]
291
303
 
292
- # If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally.
304
+ # If set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally.
293
305
  label: Var[bool]
294
306
 
295
307
  # The stack id of area, when two areas have the same value axis and same stack_id, then the two areas are stacked in order.
@@ -345,6 +357,9 @@ class Bar(Cartesian):
345
357
  # Max size of the bar
346
358
  max_bar_size: Var[int]
347
359
 
360
+ # The active bar is shown when a user enters a bar chart and this chart has tooltip. If set to false, no active bar will be drawn. If set to true, active bar will be drawn with the props calculated internally. If passed an object, active bar will be drawn, and the internally calculated props will be merged with the key value pairs of the passed object.
361
+ # active_bar: Var[Union[bool, Dict[str, Any]]]
362
+
348
363
  # Valid children components
349
364
  _valid_children: List[str] = ["Cell", "LabelList", "ErrorBar"]
350
365
 
@@ -361,7 +376,7 @@ class Bar(Cartesian):
361
376
  animation_easing: Var[LiteralAnimationEasing]
362
377
 
363
378
  # The customized event handler of animation start
364
- on_animation_begin: EventHandler[lambda: []]
379
+ on_animation_start: EventHandler[lambda: []]
365
380
 
366
381
  # The customized event handler of animation end
367
382
  on_animation_end: EventHandler[lambda: []]
@@ -383,10 +398,10 @@ class Line(Cartesian):
383
398
  # The width of the line stroke.
384
399
  stoke_width: Var[int]
385
400
 
386
- # The dot is shown when mouse enter a line chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally.
401
+ # If set false, dots will not be drawn. If set true, dots will be drawn which have the props calculated internally.
387
402
  dot: Var[bool]
388
403
 
389
- # The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally.
404
+ # The dot is shown when a user enters an area chart and this chart has a tooltip. If set false, no active dot will be drawn. If set true, an active dot will be drawn which will have the props calculated internally.
390
405
  active_dot: Var[bool]
391
406
 
392
407
  # If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally.
@@ -24,9 +24,6 @@ class Axis(Recharts):
24
24
  hide: Optional[Union[Var[bool], bool]] = None,
25
25
  width: Optional[Union[Var[Union[int, str]], str, int]] = None,
26
26
  height: Optional[Union[Var[Union[int, str]], str, int]] = None,
27
- orientation: Optional[
28
- Union[Var[Literal["top", "bottom"]], Literal["top", "bottom"]]
29
- ] = None,
30
27
  type_: Optional[
31
28
  Union[Var[Literal["number", "category"]], Literal["number", "category"]]
32
29
  ] = None,
@@ -36,6 +33,9 @@ class Axis(Recharts):
36
33
  axis_line: Optional[Union[Var[bool], bool]] = None,
37
34
  mirror: Optional[Union[Var[bool], bool]] = None,
38
35
  reversed: Optional[Union[Var[bool], bool]] = None,
36
+ label: Optional[
37
+ Union[Var[Union[Dict[str, Any], int, str]], str, int, Dict[str, Any]]
38
+ ] = None,
39
39
  scale: Optional[
40
40
  Union[
41
41
  Var[
@@ -86,6 +86,8 @@ class Axis(Recharts):
86
86
  tick_line: Optional[Union[Var[bool], bool]] = None,
87
87
  tick_size: Optional[Union[Var[int], int]] = None,
88
88
  min_tick_gap: Optional[Union[Var[int], int]] = None,
89
+ stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
90
+ text_anchor: Optional[Union[Var[str], str]] = None,
89
91
  style: Optional[Style] = None,
90
92
  key: Optional[Any] = None,
91
93
  id: Optional[Any] = None,
@@ -143,11 +145,10 @@ class Axis(Recharts):
143
145
 
144
146
  Args:
145
147
  *children: The children of the component.
146
- data_key: The key of a group of data which should be unique in an area chart.
148
+ data_key: The key of data displayed in the axis.
147
149
  hide: If set true, the axis do not display in the chart.
148
150
  width: The width of axis which is usually calculated internally.
149
151
  height: The height of axis, which can be setted by user.
150
- orientation: The orientation of axis 'top' | 'bottom'
151
152
  type_: The type of axis 'number' | 'category'
152
153
  allow_decimals: Allow the ticks of XAxis to be decimals or not.
153
154
  allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain.
@@ -155,6 +156,7 @@ class Axis(Recharts):
155
156
  axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line.
156
157
  mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside.
157
158
  reversed: Reverse the ticks or not.
159
+ label: The label of axis, which appears next to the axis.
158
160
  scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function
159
161
  unit: The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart.
160
162
  name: The name of data displayed in the axis. This option will be used to represent an index in a scatter chart.
@@ -164,6 +166,8 @@ class Axis(Recharts):
164
166
  tick_line: If set false, no axis tick lines will be drawn.
165
167
  tick_size: The length of tick line.
166
168
  min_tick_gap: The minimum gap between two adjacent labels
169
+ stroke: The stroke color of axis
170
+ text_anchor: The text anchor of axis
167
171
  style: The style of the component.
168
172
  key: A unique key for the component.
169
173
  id: The id for the component.
@@ -183,15 +187,15 @@ class XAxis(Axis):
183
187
  def create( # type: ignore
184
188
  cls,
185
189
  *children,
190
+ orientation: Optional[
191
+ Union[Var[Literal["top", "bottom"]], Literal["top", "bottom"]]
192
+ ] = None,
186
193
  x_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None,
187
194
  include_hidden: Optional[Union[Var[bool], bool]] = None,
188
195
  data_key: Optional[Union[Var[Union[int, str]], str, int]] = None,
189
196
  hide: Optional[Union[Var[bool], bool]] = None,
190
197
  width: Optional[Union[Var[Union[int, str]], str, int]] = None,
191
198
  height: Optional[Union[Var[Union[int, str]], str, int]] = None,
192
- orientation: Optional[
193
- Union[Var[Literal["top", "bottom"]], Literal["top", "bottom"]]
194
- ] = None,
195
199
  type_: Optional[
196
200
  Union[Var[Literal["number", "category"]], Literal["number", "category"]]
197
201
  ] = None,
@@ -201,6 +205,9 @@ class XAxis(Axis):
201
205
  axis_line: Optional[Union[Var[bool], bool]] = None,
202
206
  mirror: Optional[Union[Var[bool], bool]] = None,
203
207
  reversed: Optional[Union[Var[bool], bool]] = None,
208
+ label: Optional[
209
+ Union[Var[Union[Dict[str, Any], int, str]], str, int, Dict[str, Any]]
210
+ ] = None,
204
211
  scale: Optional[
205
212
  Union[
206
213
  Var[
@@ -251,6 +258,8 @@ class XAxis(Axis):
251
258
  tick_line: Optional[Union[Var[bool], bool]] = None,
252
259
  tick_size: Optional[Union[Var[int], int]] = None,
253
260
  min_tick_gap: Optional[Union[Var[int], int]] = None,
261
+ stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
262
+ text_anchor: Optional[Union[Var[str], str]] = None,
254
263
  style: Optional[Style] = None,
255
264
  key: Optional[Any] = None,
256
265
  id: Optional[Any] = None,
@@ -308,13 +317,13 @@ class XAxis(Axis):
308
317
 
309
318
  Args:
310
319
  *children: The children of the component.
320
+ orientation: The orientation of axis 'top' | 'bottom'
311
321
  x_axis_id: The id of x-axis which is corresponding to the data.
312
322
  include_hidden: Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden
313
- data_key: The key of a group of data which should be unique in an area chart.
323
+ data_key: The key of data displayed in the axis.
314
324
  hide: If set true, the axis do not display in the chart.
315
325
  width: The width of axis which is usually calculated internally.
316
326
  height: The height of axis, which can be setted by user.
317
- orientation: The orientation of axis 'top' | 'bottom'
318
327
  type_: The type of axis 'number' | 'category'
319
328
  allow_decimals: Allow the ticks of XAxis to be decimals or not.
320
329
  allow_data_overflow: When domain of the axis is specified and the type of the axis is 'number', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain.
@@ -322,6 +331,7 @@ class XAxis(Axis):
322
331
  axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line.
323
332
  mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside.
324
333
  reversed: Reverse the ticks or not.
334
+ label: The label of axis, which appears next to the axis.
325
335
  scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function
326
336
  unit: The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart.
327
337
  name: The name of data displayed in the axis. This option will be used to represent an index in a scatter chart.
@@ -331,6 +341,8 @@ class XAxis(Axis):
331
341
  tick_line: If set false, no axis tick lines will be drawn.
332
342
  tick_size: The length of tick line.
333
343
  min_tick_gap: The minimum gap between two adjacent labels
344
+ stroke: The stroke color of axis
345
+ text_anchor: The text anchor of axis
334
346
  style: The style of the component.
335
347
  key: A unique key for the component.
336
348
  id: The id for the component.
@@ -353,8 +365,9 @@ class YAxis(Axis):
353
365
  orientation: Optional[
354
366
  Union[Var[Literal["left", "right"]], Literal["left", "right"]]
355
367
  ] = None,
356
- data_key: Optional[Union[Var[Union[int, str]], str, int]] = None,
357
368
  y_axis_id: Optional[Union[Var[Union[int, str]], str, int]] = None,
369
+ domain: Optional[Union[Var[List], List]] = None,
370
+ data_key: Optional[Union[Var[Union[int, str]], str, int]] = None,
358
371
  hide: Optional[Union[Var[bool], bool]] = None,
359
372
  width: Optional[Union[Var[Union[int, str]], str, int]] = None,
360
373
  height: Optional[Union[Var[Union[int, str]], str, int]] = None,
@@ -367,6 +380,9 @@ class YAxis(Axis):
367
380
  axis_line: Optional[Union[Var[bool], bool]] = None,
368
381
  mirror: Optional[Union[Var[bool], bool]] = None,
369
382
  reversed: Optional[Union[Var[bool], bool]] = None,
383
+ label: Optional[
384
+ Union[Var[Union[Dict[str, Any], int, str]], str, int, Dict[str, Any]]
385
+ ] = None,
370
386
  scale: Optional[
371
387
  Union[
372
388
  Var[
@@ -417,6 +433,8 @@ class YAxis(Axis):
417
433
  tick_line: Optional[Union[Var[bool], bool]] = None,
418
434
  tick_size: Optional[Union[Var[int], int]] = None,
419
435
  min_tick_gap: Optional[Union[Var[int], int]] = None,
436
+ stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
437
+ text_anchor: Optional[Union[Var[str], str]] = None,
420
438
  style: Optional[Style] = None,
421
439
  key: Optional[Any] = None,
422
440
  id: Optional[Any] = None,
@@ -474,9 +492,10 @@ class YAxis(Axis):
474
492
 
475
493
  Args:
476
494
  *children: The children of the component.
477
- orientation: The orientation of axis 'top' | 'bottom'
478
- data_key: The key of a group of data which should be unique in an area chart.
495
+ orientation: The orientation of axis 'left' | 'right'
479
496
  y_axis_id: The id of y-axis which is corresponding to the data.
497
+ domain: The range of the axis. Work best in conjuction with allow_data_overflow.
498
+ data_key: The key of data displayed in the axis.
480
499
  hide: If set true, the axis do not display in the chart.
481
500
  width: The width of axis which is usually calculated internally.
482
501
  height: The height of axis, which can be setted by user.
@@ -487,6 +506,7 @@ class YAxis(Axis):
487
506
  axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line.
488
507
  mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside.
489
508
  reversed: Reverse the ticks or not.
509
+ label: The label of axis, which appears next to the axis.
490
510
  scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function
491
511
  unit: The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart.
492
512
  name: The name of data displayed in the axis. This option will be used to represent an index in a scatter chart.
@@ -496,6 +516,8 @@ class YAxis(Axis):
496
516
  tick_line: If set false, no axis tick lines will be drawn.
497
517
  tick_size: The length of tick line.
498
518
  min_tick_gap: The minimum gap between two adjacent labels
519
+ stroke: The stroke color of axis
520
+ text_anchor: The text anchor of axis
499
521
  style: The style of the component.
500
522
  key: A unique key for the component.
501
523
  id: The id for the component.
@@ -641,7 +663,6 @@ class Brush(Recharts):
641
663
  def create( # type: ignore
642
664
  cls,
643
665
  *children,
644
- stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
645
666
  data_key: Optional[Union[Var[Union[int, str]], str, int]] = None,
646
667
  x: Optional[Union[Var[int], int]] = None,
647
668
  y: Optional[Union[Var[int], int]] = None,
@@ -652,6 +673,8 @@ class Brush(Recharts):
652
673
  gap: Optional[Union[Var[int], int]] = None,
653
674
  start_index: Optional[Union[Var[int], int]] = None,
654
675
  end_index: Optional[Union[Var[int], int]] = None,
676
+ fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
677
+ stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
655
678
  style: Optional[Style] = None,
656
679
  key: Optional[Any] = None,
657
680
  id: Optional[Any] = None,
@@ -667,7 +690,6 @@ class Brush(Recharts):
667
690
 
668
691
  Args:
669
692
  *children: The children of the component.
670
- stroke: Stroke color
671
693
  data_key: The key of data displayed in the axis.
672
694
  x: The x-coordinate of brush.
673
695
  y: The y-coordinate of brush.
@@ -678,6 +700,8 @@ class Brush(Recharts):
678
700
  gap: The data with gap of refreshing chart. If the option is not set, the chart will be refreshed every time
679
701
  start_index: The default start index of brush. If the option is not set, the start index will be 0.
680
702
  end_index: The default end index of brush. If the option is not set, the end index will be 1.
703
+ fill: The fill color of brush
704
+ stroke: The stroke color of brush
681
705
  style: The style of the component.
682
706
  key: A unique key for the component.
683
707
  id: The id for the component.
@@ -970,9 +994,9 @@ class Area(Cartesian):
970
994
  stroke_width: The width of the line stroke.
971
995
  fill: The color of the area fill.
972
996
  type_: The interpolation type of area. And customized interpolation function can be set to type. 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' |
973
- dot: If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally.
974
- active_dot: The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally.
975
- label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally.
997
+ dot: If set false, dots will not be drawn. If set true, dots will be drawn which have the props calculated internally.
998
+ active_dot: The dot is shown when a user enters an area chart and this chart has a tooltip. If set false, no active dot will be drawn. If set true, an active dot will be drawn which will have the props calculated internally.
999
+ label: If set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally.
976
1000
  stack_id: The stack id of area, when two areas have the same value axis and same stack_id, then the two areas are stacked in order.
977
1001
  unit: The unit of data. This option will be used in tooltip.
978
1002
  name: The name of data. This option will be used in tooltip and legend to represent a bar. If no value was set to this option, the value of dataKey will be used alternatively.
@@ -1067,10 +1091,10 @@ class Bar(Cartesian):
1067
1091
  class_name: Optional[Any] = None,
1068
1092
  autofocus: Optional[bool] = None,
1069
1093
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
1070
- on_animation_begin: Optional[
1094
+ on_animation_end: Optional[
1071
1095
  Union[EventHandler, EventSpec, list, Callable, BaseVar]
1072
1096
  ] = None,
1073
- on_animation_end: Optional[
1097
+ on_animation_start: Optional[
1074
1098
  Union[EventHandler, EventSpec, list, Callable, BaseVar]
1075
1099
  ] = None,
1076
1100
  on_blur: Optional[
@@ -1313,8 +1337,8 @@ class Line(Cartesian):
1313
1337
  type_: The interpolation type of line. And customized interpolation function can be set to type. It's the same as type in Area.
1314
1338
  stroke: The color of the line stroke.
1315
1339
  stoke_width: The width of the line stroke.
1316
- dot: The dot is shown when mouse enter a line chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally.
1317
- active_dot: The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally.
1340
+ dot: If set false, dots will not be drawn. If set true, dots will be drawn which have the props calculated internally.
1341
+ active_dot: The dot is shown when a user enters an area chart and this chart has a tooltip. If set false, no active dot will be drawn. If set true, an active dot will be drawn which will have the props calculated internally.
1318
1342
  label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally.
1319
1343
  hide: Hides the line when true, useful when toggling visibility state via legend.
1320
1344
  connect_nulls: Whether to connect a graph line across null points.
@@ -105,7 +105,7 @@ class CategoricalChartBase(ChartBase):
105
105
  # The source data, in which each element is an object.
106
106
  data: Var[List[Dict[str, Any]]]
107
107
 
108
- # The sizes of whitespace around the chart.
108
+ # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
109
109
  margin: Var[Dict[str, Any]]
110
110
 
111
111
  # If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush.
@@ -255,7 +255,7 @@ class PieChart(ChartBase):
255
255
 
256
256
  alias = "RechartsPieChart"
257
257
 
258
- # The sizes of whitespace around the chart.
258
+ # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
259
259
  margin: Var[Dict[str, Any]]
260
260
 
261
261
  # Valid children components
@@ -291,7 +291,7 @@ class RadarChart(ChartBase):
291
291
  # The source data, in which each element is an object.
292
292
  data: Var[List[Dict[str, Any]]]
293
293
 
294
- # The sizes of whitespace around the chart.
294
+ # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
295
295
  margin: Var[Dict[str, Any]]
296
296
 
297
297
  # The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage
@@ -345,7 +345,7 @@ class RadialBarChart(ChartBase):
345
345
  # The source data which each element is an object.
346
346
  data: Var[List[Dict[str, Any]]]
347
347
 
348
- # The sizes of whitespace around the chart.
348
+ # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
349
349
  margin: Var[Dict[str, Any]]
350
350
 
351
351
  # The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage
@@ -393,7 +393,7 @@ class ScatterChart(ChartBase):
393
393
 
394
394
  alias = "RechartsScatterChart"
395
395
 
396
- # The sizes of whitespace around the chart.
396
+ # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
397
397
  margin: Var[Dict[str, Any]]
398
398
 
399
399
  # Valid children components
@@ -439,7 +439,7 @@ class FunnelChart(ChartBase):
439
439
  # The layout of bars in the chart. centeric
440
440
  layout: Var[str]
441
441
 
442
- # The sizes of whitespace around the chart.
442
+ # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
443
443
  margin: Var[Dict[str, Any]]
444
444
 
445
445
  # Valid children components
@@ -177,7 +177,7 @@ class CategoricalChartBase(ChartBase):
177
177
  Args:
178
178
  *children: The children of the chart component.
179
179
  data: The source data, in which each element is an object.
180
- margin: The sizes of whitespace around the chart.
180
+ margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
181
181
  sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush.
182
182
  sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function
183
183
  layout: The layout of area in the chart. 'horizontal' | 'vertical'
@@ -289,7 +289,7 @@ class AreaChart(CategoricalChartBase):
289
289
  *children: The children of the chart component.
290
290
  base_value: The base value of area. Number | 'dataMin' | 'dataMax' | 'auto'
291
291
  data: The source data, in which each element is an object.
292
- margin: The sizes of whitespace around the chart.
292
+ margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
293
293
  sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush.
294
294
  sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function
295
295
  layout: The layout of area in the chart. 'horizontal' | 'vertical'
@@ -404,7 +404,7 @@ class BarChart(CategoricalChartBase):
404
404
  stack_offset: The type of offset function used to generate the lower and upper values in the series array. The four types are built-in offsets in d3-shape. 'expand' | 'none' | 'wiggle' | 'silhouette'
405
405
  reverse_stack_order: If false set, stacked items will be rendered left to right. If true set, stacked items will be rendered right to left. (Render direction affects SVG layering, not x position.)
406
406
  data: The source data, in which each element is an object.
407
- margin: The sizes of whitespace around the chart.
407
+ margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
408
408
  sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush.
409
409
  sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function
410
410
  layout: The layout of area in the chart. 'horizontal' | 'vertical'
@@ -507,7 +507,7 @@ class LineChart(CategoricalChartBase):
507
507
  Args:
508
508
  *children: The children of the chart component.
509
509
  data: The source data, in which each element is an object.
510
- margin: The sizes of whitespace around the chart.
510
+ margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
511
511
  sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush.
512
512
  sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function
513
513
  layout: The layout of area in the chart. 'horizontal' | 'vertical'
@@ -627,7 +627,7 @@ class ComposedChart(CategoricalChartBase):
627
627
  bar_size: The width of all the bars in the chart. Number
628
628
  reverse_stack_order: If false set, stacked items will be rendered left to right. If true set, stacked items will be rendered right to left. (Render direction affects SVG layering, not x position.)
629
629
  data: The source data, in which each element is an object.
630
- margin: The sizes of whitespace around the chart.
630
+ margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
631
631
  sync_id: If any two categorical charts(rx.line_chart, rx.area_chart, rx.bar_chart, rx.composed_chart) have the same sync_id, these two charts can sync the position GraphingTooltip, and the start_index, end_index of Brush.
632
632
  sync_method: When sync_id is provided, allows customisation of how the charts will synchronize GraphingTooltips and brushes. Using 'index' (default setting), other charts will reuse current datum's index within the data array. In cases where data does not have the same length, this might yield unexpected results. In that case use 'value' which will try to match other charts values, or a fully custom function which will receive tick, data as argument and should return an index. 'index' | 'value' | function
633
633
  layout: The layout of area in the chart. 'horizontal' | 'vertical'
@@ -713,7 +713,7 @@ class PieChart(ChartBase):
713
713
 
714
714
  Args:
715
715
  *children: The children of the chart component.
716
- margin: The sizes of whitespace around the chart.
716
+ margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
717
717
  width: The width of chart container. String or Integer
718
718
  height: The height of chart container.
719
719
  style: The style of the component.
@@ -768,7 +768,7 @@ class RadarChart(ChartBase):
768
768
  Args:
769
769
  *children: The children of the chart component.
770
770
  data: The source data, in which each element is an object.
771
- margin: The sizes of whitespace around the chart.
771
+ margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
772
772
  cx: The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage
773
773
  cy: The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage
774
774
  start_angle: The angle of first radial direction line.
@@ -867,7 +867,7 @@ class RadialBarChart(ChartBase):
867
867
  Args:
868
868
  *children: The children of the chart component.
869
869
  data: The source data which each element is an object.
870
- margin: The sizes of whitespace around the chart.
870
+ margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
871
871
  cx: The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage
872
872
  cy: The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage
873
873
  start_angle: The angle of first radial direction line.
@@ -938,7 +938,7 @@ class ScatterChart(ChartBase):
938
938
 
939
939
  Args:
940
940
  *children: The children of the chart component.
941
- margin: The sizes of whitespace around the chart.
941
+ margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
942
942
  width: The width of chart container. String or Integer
943
943
  height: The height of chart container.
944
944
  style: The style of the component.
@@ -1022,7 +1022,7 @@ class FunnelChart(ChartBase):
1022
1022
  Args:
1023
1023
  *children: The children of the chart component.
1024
1024
  layout: The layout of bars in the chart. centeric
1025
- margin: The sizes of whitespace around the chart.
1025
+ margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
1026
1026
  width: The width of chart container. String or Integer
1027
1027
  height: The height of chart container.
1028
1028
  style: The style of the component.
@@ -5,6 +5,7 @@ from __future__ import annotations
5
5
  from typing import Any, Dict, List, Union
6
6
 
7
7
  from reflex.components.component import MemoizationLeaf
8
+ from reflex.constants.colors import Color
8
9
  from reflex.event import EventHandler
9
10
  from reflex.vars import Var
10
11
 
@@ -215,6 +216,12 @@ class LabelList(Recharts):
215
216
  # The offset to the specified "position"
216
217
  offset: Var[int]
217
218
 
219
+ # The color of the line stroke.
220
+ stroke: Var[Union[str, Color]]
221
+
222
+ # The width of the line stroke.
223
+ fill: Var[Union[str, Color]]
224
+
218
225
 
219
226
  responsive_container = ResponsiveContainer.create
220
227
  legend = Legend.create
@@ -6,6 +6,7 @@
6
6
  from typing import Any, Callable, Dict, Literal, Optional, Union, overload
7
7
 
8
8
  from reflex.components.component import MemoizationLeaf
9
+ from reflex.constants.colors import Color
9
10
  from reflex.event import EventHandler, EventSpec
10
11
  from reflex.style import Style
11
12
  from reflex.vars import BaseVar, Var
@@ -540,6 +541,8 @@ class LabelList(Recharts):
540
541
  ]
541
542
  ] = None,
542
543
  offset: Optional[Union[Var[int], int]] = None,
544
+ stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
545
+ fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
543
546
  style: Optional[Style] = None,
544
547
  key: Optional[Any] = None,
545
548
  id: Optional[Any] = None,
@@ -600,6 +603,8 @@ class LabelList(Recharts):
600
603
  data_key: The key of a group of label values in data.
601
604
  position: The position of each label relative to it view box。"Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center"
602
605
  offset: The offset to the specified "position"
606
+ stroke: The color of the line stroke.
607
+ fill: The width of the line stroke.
603
608
  style: The style of the component.
604
609
  key: A unique key for the component.
605
610
  id: The id for the component.
@@ -1,8 +1,9 @@
1
1
  """A component that wraps a recharts lib."""
2
2
 
3
- from typing import Literal
3
+ from typing import Dict, Literal
4
4
 
5
5
  from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent
6
+ from reflex.utils import console
6
7
 
7
8
 
8
9
  class Recharts(Component):
@@ -10,6 +11,20 @@ class Recharts(Component):
10
11
 
11
12
  library = "recharts@2.12.7"
12
13
 
14
+ def render(self) -> Dict:
15
+ """Render the tag.
16
+
17
+ Returns:
18
+ The rendered tag.
19
+ """
20
+ tag = super().render()
21
+ if any(p.startswith("css") for p in tag["props"]):
22
+ console.warn(
23
+ f"CSS props do not work for {self.__class__.__name__}. Consult docs to style it with its own prop."
24
+ )
25
+ tag["props"] = [p for p in tag["props"] if not p.startswith("css")]
26
+ return tag
27
+
13
28
 
14
29
  class RechartsCharts(NoSSRComponent, MemoizationLeaf):
15
30
  """A component that wraps a recharts lib."""
@@ -11,6 +11,7 @@ from reflex.style import Style
11
11
  from reflex.vars import BaseVar, Var
12
12
 
13
13
  class Recharts(Component):
14
+ def render(self) -> Dict: ...
14
15
  @overload
15
16
  @classmethod
16
17
  def create( # type: ignore
reflex/config.py CHANGED
@@ -277,7 +277,8 @@ class Config(Base):
277
277
  if env_var is not None:
278
278
  if key.upper() != "DB_URL":
279
279
  console.info(
280
- f"Overriding config value {key} with env var {key.upper()}={env_var}"
280
+ f"Overriding config value {key} with env var {key.upper()}={env_var}",
281
+ dedupe=True,
281
282
  )
282
283
 
283
284
  # Convert the env var to the expected type.