reflex 0.7.1a4__py3-none-any.whl → 0.7.2__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 (227) hide show
  1. reflex/.templates/jinja/web/utils/context.js.jinja2 +8 -8
  2. reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +3 -3
  3. reflex/.templates/web/utils/state.js +18 -18
  4. reflex/admin.py +1 -2
  5. reflex/app.py +46 -49
  6. reflex/app_mixins/lifespan.py +2 -2
  7. reflex/app_mixins/middleware.py +1 -2
  8. reflex/assets.py +1 -2
  9. reflex/base.py +2 -2
  10. reflex/compiler/compiler.py +51 -16
  11. reflex/compiler/utils.py +4 -13
  12. reflex/components/base/app_wrap.pyi +7 -7
  13. reflex/components/base/bare.py +3 -3
  14. reflex/components/base/body.pyi +7 -7
  15. reflex/components/base/document.py +1 -3
  16. reflex/components/base/document.pyi +32 -32
  17. reflex/components/base/error_boundary.py +2 -4
  18. reflex/components/base/error_boundary.pyi +11 -13
  19. reflex/components/base/fragment.pyi +7 -7
  20. reflex/components/base/head.pyi +13 -13
  21. reflex/components/base/link.pyi +22 -22
  22. reflex/components/base/meta.py +5 -7
  23. reflex/components/base/meta.pyi +40 -40
  24. reflex/components/base/script.pyi +11 -14
  25. reflex/components/base/strict_mode.pyi +7 -7
  26. reflex/components/component.py +188 -113
  27. reflex/components/core/auto_scroll.py +8 -1
  28. reflex/components/core/auto_scroll.pyi +183 -210
  29. reflex/components/core/banner.py +2 -4
  30. reflex/components/core/banner.pyi +390 -444
  31. reflex/components/core/breakpoints.py +5 -5
  32. reflex/components/core/client_side_routing.pyi +14 -14
  33. reflex/components/core/clipboard.py +4 -4
  34. reflex/components/core/clipboard.pyi +12 -14
  35. reflex/components/core/cond.py +17 -25
  36. reflex/components/core/debounce.py +3 -3
  37. reflex/components/core/debounce.pyi +14 -14
  38. reflex/components/core/foreach.py +7 -2
  39. reflex/components/core/html.py +1 -3
  40. reflex/components/core/html.pyi +184 -213
  41. reflex/components/core/match.py +15 -19
  42. reflex/components/core/sticky.pyi +930 -1078
  43. reflex/components/core/upload.py +4 -4
  44. reflex/components/core/upload.pyi +62 -62
  45. reflex/components/datadisplay/code.py +6 -6
  46. reflex/components/datadisplay/code.pyi +1159 -1165
  47. reflex/components/datadisplay/dataeditor.py +49 -49
  48. reflex/components/datadisplay/dataeditor.pyi +95 -123
  49. reflex/components/datadisplay/logo.py +1 -3
  50. reflex/components/datadisplay/shiki_code_block.py +8 -10
  51. reflex/components/datadisplay/shiki_code_block.pyi +1678 -1720
  52. reflex/components/el/element.pyi +7 -7
  53. reflex/components/el/elements/base.pyi +183 -210
  54. reflex/components/el/elements/forms.py +24 -24
  55. reflex/components/el/elements/forms.pyi +2572 -2934
  56. reflex/components/el/elements/inline.py +4 -4
  57. reflex/components/el/elements/inline.pyi +5191 -5953
  58. reflex/components/el/elements/media.py +47 -47
  59. reflex/components/el/elements/media.pyi +4802 -5500
  60. reflex/components/el/elements/metadata.py +1 -3
  61. reflex/components/el/elements/metadata.pyi +782 -896
  62. reflex/components/el/elements/other.pyi +1278 -1467
  63. reflex/components/el/elements/scripts.pyi +580 -667
  64. reflex/components/el/elements/sectioning.pyi +2761 -3166
  65. reflex/components/el/elements/tables.pyi +1840 -2119
  66. reflex/components/el/elements/typography.pyi +2772 -3179
  67. reflex/components/gridjs/datatable.py +7 -7
  68. reflex/components/gridjs/datatable.pyi +19 -19
  69. reflex/components/lucide/icon.pyi +21 -21
  70. reflex/components/markdown/markdown.py +2 -2
  71. reflex/components/markdown/markdown.pyi +9 -9
  72. reflex/components/moment/moment.py +11 -12
  73. reflex/components/moment/moment.pyi +44 -47
  74. reflex/components/next/base.pyi +7 -7
  75. reflex/components/next/image.py +3 -3
  76. reflex/components/next/image.pyi +19 -21
  77. reflex/components/next/link.pyi +9 -9
  78. reflex/components/next/video.py +1 -3
  79. reflex/components/next/video.pyi +9 -9
  80. reflex/components/plotly/plotly.py +22 -45
  81. reflex/components/plotly/plotly.pyi +164 -164
  82. reflex/components/radix/primitives/accordion.py +14 -14
  83. reflex/components/radix/primitives/accordion.pyi +439 -487
  84. reflex/components/radix/primitives/base.py +1 -3
  85. reflex/components/radix/primitives/base.pyi +15 -15
  86. reflex/components/radix/primitives/drawer.py +3 -3
  87. reflex/components/radix/primitives/drawer.pyi +110 -116
  88. reflex/components/radix/primitives/form.py +1 -1
  89. reflex/components/radix/primitives/form.pyi +668 -752
  90. reflex/components/radix/primitives/progress.py +6 -6
  91. reflex/components/radix/primitives/progress.pyi +225 -243
  92. reflex/components/radix/primitives/slider.py +6 -6
  93. reflex/components/radix/primitives/slider.pyi +52 -55
  94. reflex/components/radix/themes/base.py +3 -6
  95. reflex/components/radix/themes/base.pyi +197 -303
  96. reflex/components/radix/themes/color_mode.py +5 -5
  97. reflex/components/radix/themes/color_mode.pyi +366 -436
  98. reflex/components/radix/themes/components/alert_dialog.pyi +229 -262
  99. reflex/components/radix/themes/components/aspect_ratio.py +1 -3
  100. reflex/components/radix/themes/components/aspect_ratio.pyi +8 -8
  101. reflex/components/radix/themes/components/avatar.pyi +79 -94
  102. reflex/components/radix/themes/components/badge.pyi +252 -295
  103. reflex/components/radix/themes/components/button.pyi +269 -314
  104. reflex/components/radix/themes/components/callout.py +2 -2
  105. reflex/components/radix/themes/components/callout.pyi +1116 -1290
  106. reflex/components/radix/themes/components/card.pyi +194 -229
  107. reflex/components/radix/themes/components/checkbox.pyi +243 -278
  108. reflex/components/radix/themes/components/checkbox_cards.py +3 -7
  109. reflex/components/radix/themes/components/checkbox_cards.pyi +101 -135
  110. reflex/components/radix/themes/components/checkbox_group.py +2 -2
  111. reflex/components/radix/themes/components/checkbox_group.pyi +83 -96
  112. reflex/components/radix/themes/components/context_menu.py +18 -15
  113. reflex/components/radix/themes/components/context_menu.pyi +408 -458
  114. reflex/components/radix/themes/components/data_list.pyi +122 -147
  115. reflex/components/radix/themes/components/dialog.pyi +231 -264
  116. reflex/components/radix/themes/components/dropdown_menu.py +16 -13
  117. reflex/components/radix/themes/components/dropdown_menu.pyi +223 -246
  118. reflex/components/radix/themes/components/hover_card.py +2 -2
  119. reflex/components/radix/themes/components/hover_card.pyi +237 -282
  120. reflex/components/radix/themes/components/icon_button.pyi +269 -314
  121. reflex/components/radix/themes/components/inset.py +8 -8
  122. reflex/components/radix/themes/components/inset.pyi +232 -292
  123. reflex/components/radix/themes/components/popover.py +2 -2
  124. reflex/components/radix/themes/components/popover.pyi +229 -271
  125. reflex/components/radix/themes/components/progress.pyi +80 -96
  126. reflex/components/radix/themes/components/radio.pyi +73 -86
  127. reflex/components/radix/themes/components/radio_cards.py +4 -8
  128. reflex/components/radix/themes/components/radio_cards.pyi +117 -154
  129. reflex/components/radix/themes/components/radio_group.py +3 -3
  130. reflex/components/radix/themes/components/radio_group.pyi +250 -291
  131. reflex/components/radix/themes/components/scroll_area.pyi +14 -20
  132. reflex/components/radix/themes/components/segmented_control.py +6 -6
  133. reflex/components/radix/themes/components/segmented_control.pyi +89 -108
  134. reflex/components/radix/themes/components/select.py +7 -7
  135. reflex/components/radix/themes/components/select.pyi +376 -444
  136. reflex/components/radix/themes/components/separator.pyi +79 -93
  137. reflex/components/radix/themes/components/skeleton.pyi +32 -26
  138. reflex/components/radix/themes/components/slider.py +8 -8
  139. reflex/components/radix/themes/components/slider.pyi +99 -122
  140. reflex/components/radix/themes/components/spinner.pyi +12 -19
  141. reflex/components/radix/themes/components/switch.pyi +84 -99
  142. reflex/components/radix/themes/components/table.py +9 -9
  143. reflex/components/radix/themes/components/table.pyi +1440 -1794
  144. reflex/components/radix/themes/components/tabs.py +4 -4
  145. reflex/components/radix/themes/components/tabs.pyi +120 -132
  146. reflex/components/radix/themes/components/text_area.pyi +281 -331
  147. reflex/components/radix/themes/components/text_field.py +2 -2
  148. reflex/components/radix/themes/components/text_field.pyi +639 -734
  149. reflex/components/radix/themes/components/tooltip.py +6 -6
  150. reflex/components/radix/themes/components/tooltip.pyi +34 -43
  151. reflex/components/radix/themes/layout/base.pyi +85 -182
  152. reflex/components/radix/themes/layout/box.pyi +183 -210
  153. reflex/components/radix/themes/layout/center.pyi +225 -286
  154. reflex/components/radix/themes/layout/container.pyi +191 -224
  155. reflex/components/radix/themes/layout/flex.py +2 -2
  156. reflex/components/radix/themes/layout/flex.pyi +225 -286
  157. reflex/components/radix/themes/layout/grid.py +2 -2
  158. reflex/components/radix/themes/layout/grid.pyi +245 -315
  159. reflex/components/radix/themes/layout/list.py +2 -2
  160. reflex/components/radix/themes/layout/list.pyi +712 -815
  161. reflex/components/radix/themes/layout/section.pyi +187 -221
  162. reflex/components/radix/themes/layout/spacer.pyi +225 -286
  163. reflex/components/radix/themes/layout/stack.pyi +625 -768
  164. reflex/components/radix/themes/typography/blockquote.pyi +257 -299
  165. reflex/components/radix/themes/typography/code.pyi +259 -304
  166. reflex/components/radix/themes/typography/heading.pyi +272 -324
  167. reflex/components/radix/themes/typography/link.pyi +302 -358
  168. reflex/components/radix/themes/typography/text.pyi +1669 -1945
  169. reflex/components/react_player/audio.pyi +20 -22
  170. reflex/components/react_player/react_player.pyi +19 -19
  171. reflex/components/react_player/video.pyi +20 -22
  172. reflex/components/recharts/cartesian.py +100 -97
  173. reflex/components/recharts/cartesian.pyi +891 -1007
  174. reflex/components/recharts/charts.py +42 -42
  175. reflex/components/recharts/charts.pyi +212 -249
  176. reflex/components/recharts/general.py +22 -21
  177. reflex/components/recharts/general.pyi +198 -223
  178. reflex/components/recharts/polar.py +42 -45
  179. reflex/components/recharts/polar.pyi +254 -288
  180. reflex/components/recharts/recharts.pyi +13 -13
  181. reflex/components/sonner/toast.py +20 -20
  182. reflex/components/sonner/toast.pyi +58 -61
  183. reflex/components/suneditor/editor.py +9 -9
  184. reflex/components/suneditor/editor.pyi +78 -83
  185. reflex/components/tags/cond_tag.py +2 -2
  186. reflex/components/tags/iter_tag.py +10 -14
  187. reflex/components/tags/match_tag.py +2 -2
  188. reflex/components/tags/tag.py +10 -10
  189. reflex/config.py +36 -35
  190. reflex/constants/__init__.py +56 -53
  191. reflex/custom_components/custom_components.py +6 -7
  192. reflex/event.py +38 -42
  193. reflex/experimental/client_state.py +2 -4
  194. reflex/experimental/layout.py +2 -2
  195. reflex/experimental/layout.pyi +579 -663
  196. reflex/istate/data.py +4 -5
  197. reflex/middleware/hydrate_middleware.py +2 -2
  198. reflex/middleware/middleware.py +2 -2
  199. reflex/model.py +3 -5
  200. reflex/page.py +2 -2
  201. reflex/reflex.py +9 -10
  202. reflex/state.py +77 -49
  203. reflex/style.py +11 -5
  204. reflex/testing.py +21 -24
  205. reflex/utils/console.py +1 -1
  206. reflex/utils/decorator.py +26 -1
  207. reflex/utils/exec.py +6 -11
  208. reflex/utils/export.py +2 -3
  209. reflex/utils/format.py +4 -4
  210. reflex/utils/imports.py +12 -12
  211. reflex/utils/prerequisites.py +35 -84
  212. reflex/utils/processes.py +5 -5
  213. reflex/utils/pyi_generator.py +33 -22
  214. reflex/utils/serializers.py +60 -15
  215. reflex/utils/types.py +237 -56
  216. reflex/vars/base.py +122 -72
  217. reflex/vars/datetime.py +2 -2
  218. reflex/vars/function.py +52 -55
  219. reflex/vars/number.py +59 -5
  220. reflex/vars/object.py +57 -26
  221. reflex/vars/sequence.py +983 -958
  222. {reflex-0.7.1a4.dist-info → reflex-0.7.2.dist-info}/METADATA +3 -6
  223. reflex-0.7.2.dist-info/RECORD +405 -0
  224. {reflex-0.7.1a4.dist-info → reflex-0.7.2.dist-info}/WHEEL +1 -1
  225. reflex-0.7.1a4.dist-info/RECORD +0 -405
  226. {reflex-0.7.1a4.dist-info → reflex-0.7.2.dist-info}/LICENSE +0 -0
  227. {reflex-0.7.1a4.dist-info → reflex-0.7.2.dist-info}/entry_points.txt +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Any, Dict, List, Union
5
+ from typing import Any, ClassVar, Sequence, Union
6
6
 
7
7
  from reflex.constants import EventTriggers
8
8
  from reflex.constants.colors import Color
@@ -34,22 +34,22 @@ class Axis(Recharts):
34
34
  """A base class for axes in Recharts."""
35
35
 
36
36
  # The key of data displayed in the axis.
37
- data_key: Var[Union[str, int]]
37
+ data_key: Var[str | int]
38
38
 
39
39
  # If set true, the axis do not display in the chart. Default: False
40
40
  hide: Var[bool]
41
41
 
42
42
  # The width of axis which is usually calculated internally.
43
- width: Var[Union[str, int]]
43
+ width: Var[str | int]
44
44
 
45
45
  # The height of axis, which can be set by user.
46
- height: Var[Union[str, int]]
46
+ height: Var[str | int]
47
47
 
48
48
  # The type of axis 'number' | 'category'
49
49
  type_: Var[LiteralPolarRadiusType]
50
50
 
51
51
  # If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd"
52
- interval: Var[Union[LiteralIntervalAxis, int]]
52
+ interval: Var[LiteralIntervalAxis | int]
53
53
 
54
54
  # Allow the ticks of Axis to be decimals or not. Default: True
55
55
  allow_decimals: Var[bool]
@@ -61,7 +61,7 @@ class Axis(Recharts):
61
61
  allow_duplicated_category: Var[bool]
62
62
 
63
63
  # The range of the axis. Work best in conjunction with allow_data_overflow. Default: [0, "auto"]
64
- domain: Var[List]
64
+ domain: Var[Sequence]
65
65
 
66
66
  # If set false, no axis line will be drawn. Default: True
67
67
  axis_line: Var[bool]
@@ -73,19 +73,19 @@ class Axis(Recharts):
73
73
  reversed: Var[bool]
74
74
 
75
75
  # The label of axis, which appears next to the axis.
76
- label: Var[Union[str, int, Dict[str, Any]]]
76
+ label: Var[Union[str, int, dict[str, Any]]]
77
77
 
78
78
  # 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'. Default: "auto"
79
79
  scale: Var[LiteralScale]
80
80
 
81
81
  # The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart.
82
- unit: Var[Union[str, int]]
82
+ unit: Var[str | int]
83
83
 
84
84
  # The name of data displayed in the axis. This option will be used to represent an index in a scatter chart.
85
- name: Var[Union[str, int]]
85
+ name: Var[str | int]
86
86
 
87
87
  # Set the values of axis ticks manually.
88
- ticks: Var[List[Union[str, int]]]
88
+ ticks: Var[Sequence[str | int]]
89
89
 
90
90
  # If set false, no ticks will be drawn.
91
91
  tick: Var[bool]
@@ -103,7 +103,7 @@ class Axis(Recharts):
103
103
  min_tick_gap: Var[int]
104
104
 
105
105
  # The stroke color of axis. Default: rx.color("gray", 9)
106
- stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 9))
106
+ stroke: Var[str | Color] = LiteralVar.create(Color("gray", 9))
107
107
 
108
108
  # The text anchor of axis. Default: "middle"
109
109
  text_anchor: Var[LiteralTextAnchor]
@@ -141,7 +141,7 @@ class XAxis(Axis):
141
141
  orientation: Var[LiteralOrientationTopBottom]
142
142
 
143
143
  # The id of x-axis which is corresponding to the data. Default: 0
144
- x_axis_id: Var[Union[str, int]]
144
+ x_axis_id: Var[str | int]
145
145
 
146
146
  # Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden. Default: False
147
147
  include_hidden: Var[bool]
@@ -150,7 +150,7 @@ class XAxis(Axis):
150
150
  angle: Var[int]
151
151
 
152
152
  # Specify the padding of x-axis. Default: {"left": 0, "right": 0}
153
- padding: Var[Dict[str, int]]
153
+ padding: Var[dict[str, int]]
154
154
 
155
155
 
156
156
  class YAxis(Axis):
@@ -164,10 +164,10 @@ class YAxis(Axis):
164
164
  orientation: Var[LiteralOrientationLeftRight]
165
165
 
166
166
  # The id of y-axis which is corresponding to the data. Default: 0
167
- y_axis_id: Var[Union[str, int]]
167
+ y_axis_id: Var[str | int]
168
168
 
169
169
  # Specify the padding of y-axis. Default: {"top": 0, "bottom": 0}
170
- padding: Var[Dict[str, int]]
170
+ padding: Var[dict[str, int]]
171
171
 
172
172
 
173
173
  class ZAxis(Recharts):
@@ -178,19 +178,19 @@ class ZAxis(Recharts):
178
178
  alias = "RechartsZAxis"
179
179
 
180
180
  # The key of data displayed in the axis.
181
- data_key: Var[Union[str, int]]
181
+ data_key: Var[str | int]
182
182
 
183
183
  # The unique id of z-axis. Default: 0
184
- z_axis_id: Var[Union[str, int]]
184
+ z_axis_id: Var[str | int]
185
185
 
186
- # The range of axis. Default: [10, 10]
187
- range: Var[List[int]]
186
+ # The range of axis. Default: [60, 400]
187
+ range: Var[Sequence[int]] = LiteralVar.create([60, 400])
188
188
 
189
189
  # The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart.
190
- unit: Var[Union[str, int]]
190
+ unit: Var[str | int]
191
191
 
192
192
  # The name of data displayed in the axis. This option will be used to represent an index in a scatter chart.
193
- name: Var[Union[str, int]]
193
+ name: Var[str | int]
194
194
 
195
195
  # If 'auto' set, the scale function is decided by the type of chart, and the props type. Default: "auto"
196
196
  scale: Var[LiteralScale]
@@ -204,13 +204,13 @@ class Brush(Recharts):
204
204
  alias = "RechartsBrush"
205
205
 
206
206
  # Stroke color. Default: rx.color("gray", 9)
207
- stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 9))
207
+ stroke: Var[str | Color] = LiteralVar.create(Color("gray", 9))
208
208
 
209
209
  # The fill color of brush. Default: rx.color("gray", 2)
210
- fill: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 2))
210
+ fill: Var[str | Color] = LiteralVar.create(Color("gray", 2))
211
211
 
212
212
  # The key of data displayed in the axis.
213
- data_key: Var[Union[str, int]]
213
+ data_key: Var[str | int]
214
214
 
215
215
  # The x-coordinate of brush. Default: 0
216
216
  x: Var[int]
@@ -225,7 +225,7 @@ class Brush(Recharts):
225
225
  height: Var[int]
226
226
 
227
227
  # The original data of a LineChart, a BarChart or an AreaChart.
228
- data: Var[List[Any]]
228
+ data: Var[Sequence[Any]]
229
229
 
230
230
  # The width of each traveller. Default: 5
231
231
  traveller_width: Var[int]
@@ -240,12 +240,12 @@ class Brush(Recharts):
240
240
  end_index: Var[int]
241
241
 
242
242
  # The fill color of brush
243
- fill: Var[Union[str, Color]]
243
+ fill: Var[str | Color]
244
244
 
245
245
  # The stroke color of brush
246
- stroke: Var[Union[str, Color]]
246
+ stroke: Var[str | Color]
247
247
 
248
- def get_event_triggers(self) -> dict[str, Union[Var, Any]]:
248
+ def get_event_triggers(self) -> dict[str, Var | Any]:
249
249
  """Get the event triggers that pass the component's value to the handler.
250
250
 
251
251
  Returns:
@@ -263,13 +263,13 @@ class Cartesian(Recharts):
263
263
  layout: Var[LiteralLayout]
264
264
 
265
265
  # The key of a group of data which should be unique in an area chart.
266
- data_key: Var[Union[str, int]]
266
+ data_key: Var[str | int]
267
267
 
268
268
  # The id of x-axis which is corresponding to the data. Default: 0
269
- x_axis_id: Var[Union[str, int]]
269
+ x_axis_id: Var[str | int]
270
270
 
271
271
  # The id of y-axis which is corresponding to the data. Default: 0
272
- y_axis_id: Var[Union[str, int]]
272
+ y_axis_id: Var[str | int]
273
273
 
274
274
  # The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' | 'none' optional
275
275
  legend_type: Var[LiteralLegendType]
@@ -287,10 +287,10 @@ class Cartesian(Recharts):
287
287
  animation_easing: Var[LiteralAnimationEasing]
288
288
 
289
289
  # The unit of data. This option will be used in tooltip.
290
- unit: Var[Union[str, int]]
290
+ unit: Var[str | int]
291
291
 
292
292
  # The name of data. This option will be used in tooltip and legend to represent the component. If no value was set to this option, the value of dataKey will be used alternatively.
293
- name: Var[Union[str, int]]
293
+ name: Var[str | int]
294
294
 
295
295
  # The customized event handler of animation start
296
296
  on_animation_start: EventHandler[no_args_event_spec]
@@ -331,22 +331,22 @@ class Area(Cartesian):
331
331
  alias = "RechartsArea"
332
332
 
333
333
  # The color of the line stroke. Default: rx.color("accent", 9)
334
- stroke: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9))
334
+ stroke: Var[str | Color] = LiteralVar.create(Color("accent", 9))
335
335
 
336
336
  # The width of the line stroke. Default: 1
337
337
  stroke_width: Var[int]
338
338
 
339
339
  # The color of the area fill. Default: rx.color("accent", 5)
340
- fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 5))
340
+ fill: Var[str | Color] = LiteralVar.create(Color("accent", 5))
341
341
 
342
342
  # 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'. Default: "monotone"
343
343
  type_: Var[LiteralAreaType] = LiteralVar.create("monotone")
344
344
 
345
345
  # If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally. Default: False
346
- dot: Var[Union[bool, Dict[str, Any]]]
346
+ dot: Var[Union[bool, dict[str, Any]]]
347
347
 
348
348
  # 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. Default: {stroke: rx.color("accent", 2), fill: rx.color("accent", 10)}
349
- active_dot: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create(
349
+ active_dot: Var[Union[bool, dict[str, Any]]] = LiteralVar.create(
350
350
  {
351
351
  "stroke": Color("accent", 2),
352
352
  "fill": Color("accent", 10),
@@ -357,19 +357,19 @@ class Area(Cartesian):
357
357
  label: Var[bool]
358
358
 
359
359
  # The value which can describle the line, usually calculated internally.
360
- base_line: Var[Union[str, List[Dict[str, Any]]]]
360
+ base_line: Var[str | Sequence[dict[str, Any]]]
361
361
 
362
362
  # The coordinates of all the points in the area, usually calculated internally.
363
- points: Var[List[Dict[str, Any]]]
363
+ points: Var[Sequence[dict[str, Any]]]
364
364
 
365
365
  # 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.
366
- stack_id: Var[Union[str, int]]
366
+ stack_id: Var[str | int]
367
367
 
368
368
  # Whether to connect a graph area across null points. Default: False
369
369
  connect_nulls: Var[bool]
370
370
 
371
371
  # Valid children components
372
- _valid_children: List[str] = ["LabelList"]
372
+ _valid_children: ClassVar[list[str]] = ["LabelList"]
373
373
 
374
374
 
375
375
  class Bar(Cartesian):
@@ -380,13 +380,13 @@ class Bar(Cartesian):
380
380
  alias = "RechartsBar"
381
381
 
382
382
  # The color of the line stroke.
383
- stroke: Var[Union[str, Color]]
383
+ stroke: Var[str | Color]
384
384
 
385
385
  # The width of the line stroke.
386
386
  stroke_width: Var[int]
387
387
 
388
388
  # The width of the line stroke. Default: Color("accent", 9)
389
- fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9))
389
+ fill: Var[str | Color] = LiteralVar.create(Color("accent", 9))
390
390
 
391
391
  # If false set, background of bars will not be drawn. If true set, background of bars will be drawn which have the props calculated internally. Default: False
392
392
  background: Var[bool]
@@ -398,13 +398,13 @@ class Bar(Cartesian):
398
398
  stack_id: Var[str]
399
399
 
400
400
  # The unit of data. This option will be used in tooltip.
401
- unit: Var[Union[str, int]]
401
+ unit: Var[str | int]
402
402
 
403
403
  # The minimal height of a bar in a horizontal BarChart, or the minimal width of a bar in a vertical BarChart. By default, 0 values are not shown. To visualize a 0 (or close to zero) point, set the minimal point size to a pixel value like 3. In stacked bar charts, minPointSize might not be respected for tightly packed values. So we strongly recommend not using this prop in stacked BarCharts.
404
404
  min_point_size: Var[int]
405
405
 
406
406
  # 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.
407
- name: Var[Union[str, int]]
407
+ name: Var[str | int]
408
408
 
409
409
  # Size of the bar (if one bar_size is set then a bar_size must be set for all bars)
410
410
  bar_size: Var[int]
@@ -413,13 +413,13 @@ class Bar(Cartesian):
413
413
  max_bar_size: Var[int]
414
414
 
415
415
  # If set a value, the option is the radius of all the rounded corners. If set a array, the option are in turn the radiuses of top-left corner, top-right corner, bottom-right corner, bottom-left corner. Default: 0
416
- radius: Var[Union[int, List[int]]]
416
+ radius: Var[int | Sequence[int]]
417
417
 
418
418
  # 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.
419
- # active_bar: Var[Union[bool, Dict[str, Any]]] #noqa: ERA001
419
+ # active_bar: Var[Union[bool, dict[str, Any]]] #noqa: ERA001
420
420
 
421
421
  # Valid children components
422
- _valid_children: List[str] = ["Cell", "LabelList", "ErrorBar"]
422
+ _valid_children: ClassVar[list[str]] = ["Cell", "LabelList", "ErrorBar"]
423
423
 
424
424
 
425
425
  class Line(Cartesian):
@@ -433,13 +433,13 @@ class Line(Cartesian):
433
433
  type_: Var[LiteralAreaType]
434
434
 
435
435
  # The color of the line stroke. Default: rx.color("accent", 9)
436
- stroke: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9))
436
+ stroke: Var[str | Color] = LiteralVar.create(Color("accent", 9))
437
437
 
438
438
  # The width of the line stroke. Default: 1
439
439
  stroke_width: Var[int]
440
440
 
441
441
  # 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. Default: {"stroke": rx.color("accent", 10), "fill": rx.color("accent", 4)}
442
- dot: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create(
442
+ dot: Var[Union[bool, dict[str, Any]]] = LiteralVar.create(
443
443
  {
444
444
  "stroke": Color("accent", 10),
445
445
  "fill": Color("accent", 4),
@@ -447,7 +447,7 @@ class Line(Cartesian):
447
447
  )
448
448
 
449
449
  # 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. Default: {"stroke": rx.color("accent", 2), "fill": rx.color("accent", 10)}
450
- active_dot: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create(
450
+ active_dot: Var[Union[bool, dict[str, Any]]] = LiteralVar.create(
451
451
  {
452
452
  "stroke": Color("accent", 2),
453
453
  "fill": Color("accent", 10),
@@ -464,16 +464,16 @@ class Line(Cartesian):
464
464
  connect_nulls: Var[bool]
465
465
 
466
466
  # The unit of data. This option will be used in tooltip.
467
- unit: Var[Union[str, int]]
467
+ unit: Var[str | int]
468
468
 
469
469
  # The coordinates of all the points in the line, usually calculated internally.
470
- points: Var[List[Dict[str, Any]]]
470
+ points: Var[Sequence[dict[str, Any]]]
471
471
 
472
472
  # The pattern of dashes and gaps used to paint the line.
473
473
  stroke_dasharray: Var[str]
474
474
 
475
475
  # Valid children components
476
- _valid_children: List[str] = ["LabelList", "ErrorBar"]
476
+ _valid_children: ClassVar[list[str]] = ["LabelList", "ErrorBar"]
477
477
 
478
478
 
479
479
  class Scatter(Recharts):
@@ -484,19 +484,22 @@ class Scatter(Recharts):
484
484
  alias = "RechartsScatter"
485
485
 
486
486
  # The source data, in which each element is an object.
487
- data: Var[List[Dict[str, Any]]]
487
+ data: Var[Sequence[dict[str, Any]]]
488
+
489
+ # The name of the data. It is used to represent the scatter in legend.
490
+ name: Var[str]
488
491
 
489
492
  # The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'. Default: "circle"
490
493
  legend_type: Var[LiteralLegendType]
491
494
 
492
495
  # The id of x-axis which is corresponding to the data. Default: 0
493
- x_axis_id: Var[Union[str, int]]
496
+ x_axis_id: Var[str | int]
494
497
 
495
498
  # The id of y-axis which is corresponding to the data. Default: 0
496
- y_axis_id: Var[Union[str, int]]
499
+ y_axis_id: Var[str | int]
497
500
 
498
501
  # The id of z-axis which is corresponding to the data. Default: 0
499
- z_axis_id: Var[Union[str, int]]
502
+ z_axis_id: Var[str | int]
500
503
 
501
504
  # If false set, line will not be drawn. If true set, line will be drawn which have the props calculated internally. Default: False
502
505
  line: Var[bool]
@@ -508,10 +511,10 @@ class Scatter(Recharts):
508
511
  line_type: Var[LiteralLineType]
509
512
 
510
513
  # The fill color of the scatter. Default: rx.color("accent", 9)
511
- fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9))
514
+ fill: Var[str | Color] = LiteralVar.create(Color("accent", 9))
512
515
 
513
516
  # Valid children components.
514
- _valid_children: List[str] = ["LabelList", "ErrorBar"]
517
+ _valid_children: ClassVar[list[str]] = ["LabelList", "ErrorBar"]
515
518
 
516
519
  # If set false, animation of bar will be disabled. Default: True in CSR, False in SSR
517
520
  is_animation_active: Var[bool]
@@ -558,10 +561,10 @@ class Funnel(Recharts):
558
561
  alias = "RechartsFunnel"
559
562
 
560
563
  # The source data, in which each element is an object.
561
- data: Var[List[Dict[str, Any]]]
564
+ data: Var[Sequence[dict[str, Any]]]
562
565
 
563
566
  # The key or getter of a group of data which should be unique in a FunnelChart.
564
- data_key: Var[Union[str, int]]
567
+ data_key: Var[str | int]
565
568
 
566
569
  # The key of each sector's name. Default: "name"
567
570
  name_key: Var[str]
@@ -582,13 +585,13 @@ class Funnel(Recharts):
582
585
  animation_easing: Var[LiteralAnimationEasing]
583
586
 
584
587
  # Stroke color. Default: rx.color("gray", 3)
585
- stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 3))
588
+ stroke: Var[str | Color] = LiteralVar.create(Color("gray", 3))
586
589
 
587
590
  # The coordinates of all the trapezoids in the funnel, usually calculated internally.
588
- trapezoids: Var[List[Dict[str, Any]]]
591
+ trapezoids: Var[Sequence[dict[str, Any]]]
589
592
 
590
593
  # Valid children components
591
- _valid_children: List[str] = ["LabelList", "Cell"]
594
+ _valid_children: ClassVar[list[str]] = ["LabelList", "Cell"]
592
595
 
593
596
  # The customized event handler of animation start
594
597
  on_animation_start: EventHandler[no_args_event_spec]
@@ -632,32 +635,32 @@ class ErrorBar(Recharts):
632
635
  direction: Var[LiteralDirection]
633
636
 
634
637
  # The key of a group of data which should be unique in an area chart.
635
- data_key: Var[Union[str, int]]
638
+ data_key: Var[str | int]
636
639
 
637
640
  # The width of the error bar ends. Default: 5
638
641
  width: Var[int]
639
642
 
640
643
  # The stroke color of error bar. Default: rx.color("gray", 8)
641
- stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 8))
644
+ stroke: Var[str | Color] = LiteralVar.create(Color("gray", 8))
642
645
 
643
646
  # The stroke width of error bar. Default: 1.5
644
- stroke_width: Var[Union[int, float]]
647
+ stroke_width: Var[int | float]
645
648
 
646
649
 
647
650
  class Reference(Recharts):
648
651
  """A base class for reference components in Reference."""
649
652
 
650
653
  # The id of x-axis which is corresponding to the data. Default: 0
651
- x_axis_id: Var[Union[str, int]]
654
+ x_axis_id: Var[str | int]
652
655
 
653
656
  # The id of y-axis which is corresponding to the data. Default: 0
654
- y_axis_id: Var[Union[str, int]]
657
+ y_axis_id: Var[str | int]
655
658
 
656
659
  # Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard"
657
660
  if_overflow: Var[LiteralIfOverflow]
658
661
 
659
662
  # If set a string or a number, default label will be drawn, and the option is content.
660
- label: Var[Union[str, int]]
663
+ label: Var[str | int]
661
664
 
662
665
  # If set true, the line will be rendered in front of bars in BarChart, etc. Default: False
663
666
  is_front: Var[bool]
@@ -671,22 +674,22 @@ class ReferenceLine(Reference):
671
674
  alias = "RechartsReferenceLine"
672
675
 
673
676
  # If set a string or a number, a vertical line perpendicular to the x-axis specified by xAxisId will be drawn. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys, otherwise no line will be drawn.
674
- x: Var[Union[str, int]]
677
+ x: Var[str | int]
675
678
 
676
679
  # If set a string or a number, a horizontal line perpendicular to the y-axis specified by yAxisId will be drawn. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys, otherwise no line will be drawn.
677
- y: Var[Union[str, int]]
680
+ y: Var[str | int]
678
681
 
679
682
  # The color of the reference line.
680
- stroke: Var[Union[str, Color]]
683
+ stroke: Var[str | Color]
681
684
 
682
685
  # The width of the stroke. Default: 1
683
- stroke_width: Var[Union[str, int]]
686
+ stroke_width: Var[str | int]
684
687
 
685
688
  # Valid children components
686
- _valid_children: List[str] = ["Label"]
689
+ _valid_children: ClassVar[list[str]] = ["Label"]
687
690
 
688
691
  # Array of endpoints in { x, y } format. These endpoints would be used to draw the ReferenceLine.
689
- segment: List[Any] = []
692
+ segment: Sequence[Any] = []
690
693
 
691
694
 
692
695
  class ReferenceDot(Reference):
@@ -697,22 +700,22 @@ class ReferenceDot(Reference):
697
700
  alias = "RechartsReferenceDot"
698
701
 
699
702
  # If set a string or a number, a vertical line perpendicular to the x-axis specified by xAxisId will be drawn. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys, otherwise no line will be drawn.
700
- x: Var[Union[str, int]]
703
+ x: Var[str | int]
701
704
 
702
705
  # If set a string or a number, a horizontal line perpendicular to the y-axis specified by yAxisId will be drawn. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys, otherwise no line will be drawn.
703
- y: Var[Union[str, int]]
706
+ y: Var[str | int]
704
707
 
705
708
  # The radius of dot.
706
709
  r: Var[int]
707
710
 
708
711
  # The color of the area fill.
709
- fill: Var[Union[str, Color]]
712
+ fill: Var[str | Color]
710
713
 
711
714
  # The color of the line stroke.
712
- stroke: Var[Union[str, Color]]
715
+ stroke: Var[str | Color]
713
716
 
714
717
  # Valid children components
715
- _valid_children: List[str] = ["Label"]
718
+ _valid_children: ClassVar[list[str]] = ["Label"]
716
719
 
717
720
  # The customized event handler of click on the component in this chart
718
721
  on_click: EventHandler[no_args_event_spec]
@@ -747,31 +750,31 @@ class ReferenceArea(Recharts):
747
750
  alias = "RechartsReferenceArea"
748
751
 
749
752
  # Stroke color
750
- stroke: Var[Union[str, Color]]
753
+ stroke: Var[str | Color]
751
754
 
752
755
  # Fill color
753
- fill: Var[Union[str, Color]]
756
+ fill: Var[str | Color]
754
757
 
755
758
  # The opacity of area.
756
759
  fill_opacity: Var[float]
757
760
 
758
761
  # The id of x-axis which is corresponding to the data.
759
- x_axis_id: Var[Union[str, int]]
762
+ x_axis_id: Var[str | int]
760
763
 
761
764
  # The id of y-axis which is corresponding to the data.
762
- y_axis_id: Var[Union[str, int]]
765
+ y_axis_id: Var[str | int]
763
766
 
764
767
  # A boundary value of the area. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys. If one of x1 or x2 is invalidate, the area will cover along x-axis.
765
- x1: Var[Union[str, int]]
768
+ x1: Var[str | int]
766
769
 
767
770
  # A boundary value of the area. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys. If one of x1 or x2 is invalidate, the area will cover along x-axis.
768
- x2: Var[Union[str, int]]
771
+ x2: Var[str | int]
769
772
 
770
773
  # A boundary value of the area. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys. If one of y1 or y2 is invalidate, the area will cover along y-axis.
771
- y1: Var[Union[str, int]]
774
+ y1: Var[str | int]
772
775
 
773
776
  # A boundary value of the area. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys. If one of y1 or y2 is invalidate, the area will cover along y-axis.
774
- y2: Var[Union[str, int]]
777
+ y2: Var[str | int]
775
778
 
776
779
  # Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard"
777
780
  if_overflow: Var[LiteralIfOverflow]
@@ -780,7 +783,7 @@ class ReferenceArea(Recharts):
780
783
  is_front: Var[bool]
781
784
 
782
785
  # Valid children components
783
- _valid_children: List[str] = ["Label"]
786
+ _valid_children: ClassVar[list[str]] = ["Label"]
784
787
 
785
788
 
786
789
  class Grid(Recharts):
@@ -813,13 +816,13 @@ class CartesianGrid(Grid):
813
816
  vertical: Var[bool]
814
817
 
815
818
  # The x-coordinates in pixel values of all vertical lines. Default: []
816
- vertical_points: Var[List[Union[str, int]]]
819
+ vertical_points: Var[Sequence[str | int]]
817
820
 
818
821
  # The x-coordinates in pixel values of all vertical lines. Default: []
819
- horizontal_points: Var[List[Union[str, int]]]
822
+ horizontal_points: Var[Sequence[str | int]]
820
823
 
821
824
  # The background of grid.
822
- fill: Var[Union[str, Color]]
825
+ fill: Var[str | Color]
823
826
 
824
827
  # The opacity of the background used to fill the space between grid lines.
825
828
  fill_opacity: Var[float]
@@ -828,7 +831,7 @@ class CartesianGrid(Grid):
828
831
  stroke_dasharray: Var[str]
829
832
 
830
833
  # the stroke color of grid. Default: rx.color("gray", 7)
831
- stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 7))
834
+ stroke: Var[str | Color] = LiteralVar.create(Color("gray", 7))
832
835
 
833
836
 
834
837
  class CartesianAxis(Grid):
@@ -842,7 +845,7 @@ class CartesianAxis(Grid):
842
845
  orientation: Var[LiteralOrientationTopBottomLeftRight]
843
846
 
844
847
  # The box of viewing area. Default: {"x": 0, "y": 0, "width": 0, "height": 0}
845
- view_box: Var[Dict[str, Any]]
848
+ view_box: Var[dict[str, Any]]
846
849
 
847
850
  # If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. Default: True
848
851
  axis_line: Var[bool]
@@ -860,7 +863,7 @@ class CartesianAxis(Grid):
860
863
  interval: Var[LiteralInterval]
861
864
 
862
865
  # If set a string or a number, default label will be drawn, and the option is content.
863
- label: Var[Union[str, int]]
866
+ label: Var[str | int]
864
867
 
865
868
  # If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False
866
869
  mirror: Var[bool]