reflex 0.5.4a3__py3-none-any.whl → 0.5.5__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 (260) hide show
  1. reflex/.templates/apps/demo/code/demo.py +1 -0
  2. reflex/.templates/apps/demo/code/pages/__init__.py +1 -0
  3. reflex/.templates/apps/demo/code/pages/datatable.py +1 -0
  4. reflex/.templates/apps/demo/code/pages/forms.py +1 -0
  5. reflex/.templates/apps/demo/code/pages/graphing.py +1 -0
  6. reflex/.templates/apps/demo/code/pages/home.py +1 -0
  7. reflex/.templates/apps/demo/code/styles.py +1 -0
  8. reflex/.templates/apps/demo/code/webui/components/loading_icon.py +1 -8
  9. reflex/.templates/web/components/reflex/chakra_color_mode_provider.js +27 -12
  10. reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +19 -5
  11. reflex/.templates/web/utils/state.js +73 -7
  12. reflex/__init__.py +3 -0
  13. reflex/__init__.pyi +3 -0
  14. reflex/admin.py +1 -0
  15. reflex/app.py +8 -6
  16. reflex/app_module_for_backend.py +2 -1
  17. reflex/base.py +4 -4
  18. reflex/compiler/compiler.py +4 -3
  19. reflex/compiler/templates.py +2 -0
  20. reflex/compiler/utils.py +58 -35
  21. reflex/components/__init__.py +1 -0
  22. reflex/components/base/__init__.py +1 -0
  23. reflex/components/base/app_wrap.py +1 -0
  24. reflex/components/base/fragment.py +1 -0
  25. reflex/components/base/link.py +0 -1
  26. reflex/components/base/script.py +11 -15
  27. reflex/components/base/script.pyi +1 -2
  28. reflex/components/chakra/base.py +15 -13
  29. reflex/components/chakra/base.pyi +3 -1
  30. reflex/components/chakra/datadisplay/code.py +1 -0
  31. reflex/components/chakra/datadisplay/divider.py +1 -0
  32. reflex/components/chakra/datadisplay/table.py +1 -0
  33. reflex/components/chakra/datadisplay/table.pyi +3 -0
  34. reflex/components/chakra/datadisplay/tag.py +1 -0
  35. reflex/components/chakra/disclosure/transition.py +1 -0
  36. reflex/components/chakra/feedback/circularprogress.py +1 -0
  37. reflex/components/chakra/forms/button.py +1 -0
  38. reflex/components/chakra/forms/checkbox.py +4 -13
  39. reflex/components/chakra/forms/checkbox.pyi +1 -3
  40. reflex/components/chakra/forms/colormodeswitch.py +1 -0
  41. reflex/components/chakra/forms/editable.py +13 -16
  42. reflex/components/chakra/forms/editable.pyi +1 -3
  43. reflex/components/chakra/forms/form.py +1 -0
  44. reflex/components/chakra/forms/input.py +22 -21
  45. reflex/components/chakra/forms/input.pyi +4 -4
  46. reflex/components/chakra/forms/multiselect.py +1 -0
  47. reflex/components/chakra/forms/numberinput.py +3 -12
  48. reflex/components/chakra/forms/numberinput.pyi +1 -3
  49. reflex/components/chakra/forms/pininput.py +8 -14
  50. reflex/components/chakra/forms/pininput.pyi +2 -3
  51. reflex/components/chakra/forms/radio.py +4 -13
  52. reflex/components/chakra/forms/radio.pyi +2 -3
  53. reflex/components/chakra/forms/rangeslider.py +10 -13
  54. reflex/components/chakra/forms/rangeslider.pyi +2 -3
  55. reflex/components/chakra/forms/select.py +4 -12
  56. reflex/components/chakra/forms/select.pyi +2 -3
  57. reflex/components/chakra/forms/slider.py +10 -13
  58. reflex/components/chakra/forms/slider.pyi +2 -3
  59. reflex/components/chakra/forms/switch.py +4 -13
  60. reflex/components/chakra/forms/switch.pyi +1 -3
  61. reflex/components/chakra/forms/textarea.py +16 -17
  62. reflex/components/chakra/forms/textarea.pyi +1 -3
  63. reflex/components/chakra/media/avatar.py +4 -12
  64. reflex/components/chakra/media/avatar.pyi +1 -2
  65. reflex/components/chakra/media/icon.py +1 -0
  66. reflex/components/chakra/media/image.py +7 -11
  67. reflex/components/chakra/media/image.pyi +2 -2
  68. reflex/components/chakra/navigation/link.py +8 -4
  69. reflex/components/chakra/navigation/link.pyi +2 -1
  70. reflex/components/chakra/overlay/alertdialog.py +12 -14
  71. reflex/components/chakra/overlay/alertdialog.pyi +1 -2
  72. reflex/components/chakra/overlay/drawer.py +12 -14
  73. reflex/components/chakra/overlay/drawer.pyi +1 -2
  74. reflex/components/chakra/overlay/menu.py +7 -11
  75. reflex/components/chakra/overlay/menu.pyi +2 -2
  76. reflex/components/chakra/overlay/modal.py +13 -13
  77. reflex/components/chakra/overlay/modal.pyi +2 -2
  78. reflex/components/chakra/overlay/popover.py +6 -12
  79. reflex/components/chakra/overlay/popover.pyi +1 -2
  80. reflex/components/chakra/overlay/tooltip.py +7 -13
  81. reflex/components/chakra/overlay/tooltip.pyi +1 -2
  82. reflex/components/chakra/typography/heading.py +0 -1
  83. reflex/components/chakra/typography/span.py +1 -0
  84. reflex/components/chakra/typography/text.py +1 -0
  85. reflex/components/component.py +70 -43
  86. reflex/components/core/__init__.py +1 -0
  87. reflex/components/core/banner.py +27 -24
  88. reflex/components/core/banner.pyi +6 -2
  89. reflex/components/core/client_side_routing.py +1 -0
  90. reflex/components/core/cond.py +19 -17
  91. reflex/components/core/debounce.py +4 -11
  92. reflex/components/core/debounce.pyi +1 -1
  93. reflex/components/core/foreach.py +1 -0
  94. reflex/components/core/html.py +1 -0
  95. reflex/components/core/match.py +9 -6
  96. reflex/components/core/upload.py +26 -25
  97. reflex/components/core/upload.pyi +3 -4
  98. reflex/components/datadisplay/__init__.py +1 -0
  99. reflex/components/datadisplay/code.py +27 -23
  100. reflex/components/datadisplay/code.pyi +4 -2
  101. reflex/components/datadisplay/dataeditor.py +73 -80
  102. reflex/components/datadisplay/dataeditor.pyi +52 -4
  103. reflex/components/datadisplay/logo.py +1 -0
  104. reflex/components/el/__init__.py +1 -0
  105. reflex/components/el/__init__.pyi +8 -0
  106. reflex/components/el/element.py +0 -1
  107. reflex/components/el/elements/__init__.py +5 -0
  108. reflex/components/el/elements/__init__.pyi +12 -1
  109. reflex/components/el/elements/base.py +1 -0
  110. reflex/components/el/elements/forms.py +44 -61
  111. reflex/components/el/elements/forms.pyi +4 -6
  112. reflex/components/el/elements/inline.py +1 -0
  113. reflex/components/el/elements/media.py +53 -0
  114. reflex/components/el/elements/media.pyi +428 -0
  115. reflex/components/el/elements/metadata.py +11 -0
  116. reflex/components/el/elements/metadata.pyi +80 -0
  117. reflex/components/el/elements/other.py +1 -0
  118. reflex/components/el/elements/scripts.py +1 -0
  119. reflex/components/el/elements/tables.py +1 -0
  120. reflex/components/el/elements/typography.py +1 -0
  121. reflex/components/gridjs/datatable.py +9 -6
  122. reflex/components/gridjs/datatable.pyi +4 -1
  123. reflex/components/markdown/markdown.py +36 -41
  124. reflex/components/markdown/markdown.pyi +4 -3
  125. reflex/components/media/icon.py +1 -0
  126. reflex/components/moment/moment.py +11 -17
  127. reflex/components/moment/moment.pyi +4 -3
  128. reflex/components/next/base.py +1 -0
  129. reflex/components/next/image.py +6 -11
  130. reflex/components/next/image.pyi +2 -2
  131. reflex/components/plotly/plotly.py +1 -0
  132. reflex/components/props.py +1 -0
  133. reflex/components/radix/__init__.py +1 -0
  134. reflex/components/radix/primitives/__init__.py +1 -0
  135. reflex/components/radix/primitives/accordion.py +7 -15
  136. reflex/components/radix/primitives/accordion.pyi +7 -4
  137. reflex/components/radix/primitives/base.py +1 -0
  138. reflex/components/radix/primitives/drawer.py +17 -27
  139. reflex/components/radix/primitives/drawer.pyi +2 -4
  140. reflex/components/radix/primitives/form.py +4 -12
  141. reflex/components/radix/primitives/form.pyi +2 -3
  142. reflex/components/radix/primitives/slider.py +6 -11
  143. reflex/components/radix/primitives/slider.pyi +2 -2
  144. reflex/components/radix/themes/__init__.py +1 -0
  145. reflex/components/radix/themes/base.py +3 -3
  146. reflex/components/radix/themes/base.pyi +3 -2
  147. reflex/components/radix/themes/color_mode.py +31 -2
  148. reflex/components/radix/themes/color_mode.pyi +10 -1
  149. reflex/components/radix/themes/components/__init__.py +1 -0
  150. reflex/components/radix/themes/components/alert_dialog.py +13 -24
  151. reflex/components/radix/themes/components/alert_dialog.pyi +2 -4
  152. reflex/components/radix/themes/components/aspect_ratio.py +1 -0
  153. reflex/components/radix/themes/components/card.py +1 -0
  154. reflex/components/radix/themes/components/checkbox.py +6 -22
  155. reflex/components/radix/themes/components/checkbox.pyi +2 -4
  156. reflex/components/radix/themes/components/checkbox_group.py +15 -3
  157. reflex/components/radix/themes/components/checkbox_group.pyi +10 -2
  158. reflex/components/radix/themes/components/context_menu.py +29 -38
  159. reflex/components/radix/themes/components/context_menu.pyi +2 -5
  160. reflex/components/radix/themes/components/dialog.py +18 -26
  161. reflex/components/radix/themes/components/dialog.pyi +2 -4
  162. reflex/components/radix/themes/components/dropdown_menu.py +32 -57
  163. reflex/components/radix/themes/components/dropdown_menu.pyi +2 -7
  164. reflex/components/radix/themes/components/hover_card.py +5 -12
  165. reflex/components/radix/themes/components/hover_card.pyi +2 -3
  166. reflex/components/radix/themes/components/icon_button.py +1 -0
  167. reflex/components/radix/themes/components/icon_button.pyi +1 -0
  168. reflex/components/radix/themes/components/inset.py +1 -0
  169. reflex/components/radix/themes/components/popover.py +22 -27
  170. reflex/components/radix/themes/components/popover.pyi +2 -4
  171. reflex/components/radix/themes/components/radio_group.py +25 -17
  172. reflex/components/radix/themes/components/radio_group.pyi +2 -3
  173. reflex/components/radix/themes/components/scroll_area.py +1 -0
  174. reflex/components/radix/themes/components/segmented_control.py +18 -5
  175. reflex/components/radix/themes/components/segmented_control.pyi +16 -7
  176. reflex/components/radix/themes/components/select.py +13 -23
  177. reflex/components/radix/themes/components/select.pyi +1 -4
  178. reflex/components/radix/themes/components/separator.py +1 -0
  179. reflex/components/radix/themes/components/slider.py +7 -12
  180. reflex/components/radix/themes/components/slider.pyi +2 -3
  181. reflex/components/radix/themes/components/switch.py +5 -12
  182. reflex/components/radix/themes/components/switch.pyi +2 -3
  183. reflex/components/radix/themes/components/table.py +1 -0
  184. reflex/components/radix/themes/components/tabs.py +4 -11
  185. reflex/components/radix/themes/components/tabs.pyi +2 -2
  186. reflex/components/radix/themes/components/text_area.py +19 -18
  187. reflex/components/radix/themes/components/text_area.pyi +2 -3
  188. reflex/components/radix/themes/components/text_field.py +19 -18
  189. reflex/components/radix/themes/components/text_field.pyi +3 -3
  190. reflex/components/radix/themes/components/tooltip.py +10 -13
  191. reflex/components/radix/themes/components/tooltip.pyi +2 -3
  192. reflex/components/radix/themes/layout/__init__.py +1 -0
  193. reflex/components/radix/themes/layout/box.py +1 -0
  194. reflex/components/radix/themes/layout/container.py +1 -0
  195. reflex/components/radix/themes/layout/list.py +1 -0
  196. reflex/components/radix/themes/layout/list.pyi +1 -0
  197. reflex/components/radix/themes/layout/section.py +1 -0
  198. reflex/components/radix/themes/typography/__init__.py +1 -0
  199. reflex/components/radix/themes/typography/base.py +1 -0
  200. reflex/components/radix/themes/typography/blockquote.py +1 -0
  201. reflex/components/radix/themes/typography/code.py +1 -0
  202. reflex/components/radix/themes/typography/heading.py +1 -0
  203. reflex/components/radix/themes/typography/link.py +8 -3
  204. reflex/components/radix/themes/typography/link.pyi +2 -1
  205. reflex/components/react_player/audio.py +1 -0
  206. reflex/components/react_player/audio.pyi +48 -0
  207. reflex/components/react_player/react_player.py +49 -0
  208. reflex/components/react_player/react_player.pyi +49 -0
  209. reflex/components/react_player/video.py +1 -0
  210. reflex/components/react_player/video.pyi +48 -0
  211. reflex/components/recharts/__init__.py +1 -0
  212. reflex/components/recharts/cartesian.py +264 -74
  213. reflex/components/recharts/cartesian.pyi +573 -58
  214. reflex/components/recharts/charts.py +68 -78
  215. reflex/components/recharts/charts.pyi +373 -156
  216. reflex/components/recharts/general.py +52 -20
  217. reflex/components/recharts/general.pyi +52 -6
  218. reflex/components/recharts/polar.py +30 -18
  219. reflex/components/recharts/polar.pyi +66 -5
  220. reflex/components/recharts/recharts.py +5 -3
  221. reflex/components/recharts/recharts.pyi +2 -1
  222. reflex/components/sonner/toast.py +2 -2
  223. reflex/components/sonner/toast.pyi +1 -1
  224. reflex/components/suneditor/editor.py +39 -26
  225. reflex/components/suneditor/editor.pyi +4 -4
  226. reflex/components/tags/iter_tag.py +1 -0
  227. reflex/constants/__init__.py +3 -2
  228. reflex/constants/base.py +20 -21
  229. reflex/constants/compiler.py +3 -1
  230. reflex/constants/config.py +1 -0
  231. reflex/constants/event.py +1 -0
  232. reflex/constants/installer.py +3 -2
  233. reflex/constants/style.py +2 -8
  234. reflex/event.py +36 -6
  235. reflex/experimental/assets.py +1 -0
  236. reflex/experimental/client_state.py +9 -3
  237. reflex/experimental/hooks.py +1 -0
  238. reflex/experimental/misc.py +12 -3
  239. reflex/middleware/hydrate_middleware.py +1 -0
  240. reflex/middleware/middleware.py +1 -0
  241. reflex/state.py +38 -1
  242. reflex/style.py +67 -20
  243. reflex/testing.py +6 -2
  244. reflex/utils/build.py +76 -72
  245. reflex/utils/exec.py +17 -9
  246. reflex/utils/export.py +13 -9
  247. reflex/utils/imports.py +34 -5
  248. reflex/utils/lazy_loader.py +1 -0
  249. reflex/utils/path_ops.py +39 -33
  250. reflex/utils/prerequisites.py +38 -29
  251. reflex/utils/processes.py +1 -1
  252. reflex/utils/serializers.py +3 -6
  253. reflex/utils/watch.py +3 -1
  254. reflex/vars.py +26 -10
  255. reflex/vars.pyi +3 -3
  256. {reflex-0.5.4a3.dist-info → reflex-0.5.5.dist-info}/METADATA +3 -3
  257. {reflex-0.5.4a3.dist-info → reflex-0.5.5.dist-info}/RECORD +260 -260
  258. {reflex-0.5.4a3.dist-info → reflex-0.5.5.dist-info}/LICENSE +0 -0
  259. {reflex-0.5.4a3.dist-info → reflex-0.5.5.dist-info}/WHEEL +0 -0
  260. {reflex-0.5.4a3.dist-info → reflex-0.5.5.dist-info}/entry_points.txt +0 -0
@@ -1,4 +1,5 @@
1
1
  """A module that defines the chart components in Recharts."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  from typing import Any, Dict, List, Union
@@ -22,42 +23,23 @@ from .recharts import (
22
23
  class ChartBase(RechartsCharts):
23
24
  """A component that wraps a Recharts charts."""
24
25
 
25
- # The source data, in which each element is an object.
26
- data: Var[List[Dict[str, Any]]]
27
-
28
- # 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.
29
- sync_id: Var[str]
30
-
31
- # 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
32
- sync_method: Var[LiteralSyncMethod]
33
-
34
26
  # The width of chart container. String or Integer
35
27
  width: Var[Union[str, int]] = "100%" # type: ignore
36
28
 
37
29
  # The height of chart container.
38
30
  height: Var[Union[str, int]] = "100%" # type: ignore
39
31
 
40
- # The layout of area in the chart. 'horizontal' | 'vertical'
41
- layout: Var[LiteralLayout]
32
+ # The customized event handler of click on the component in this chart
33
+ on_click: EventHandler[lambda: []]
42
34
 
43
- # The sizes of whitespace around the chart.
44
- margin: Var[Dict[str, Any]]
35
+ # The customized event handler of mouseenter on the component in this chart
36
+ on_mouse_enter: EventHandler[lambda: []]
45
37
 
46
- # 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'
47
- stack_offset: Var[LiteralStackOffset]
48
-
49
- def get_event_triggers(self) -> dict[str, Union[Var, Any]]:
50
- """Get the event triggers that pass the component's value to the handler.
38
+ # The customized event handler of mousemove on the component in this chart
39
+ on_mouse_move: EventHandler[lambda: []]
51
40
 
52
- Returns:
53
- A dict mapping the event trigger to the var that is passed to the handler.
54
- """
55
- return {
56
- EventTriggers.ON_CLICK: lambda: [],
57
- EventTriggers.ON_MOUSE_ENTER: lambda: [],
58
- EventTriggers.ON_MOUSE_MOVE: lambda: [],
59
- EventTriggers.ON_MOUSE_LEAVE: lambda: [],
60
- }
41
+ # The customized event handler of mouseleave on the component in this chart
42
+ on_mouse_leave: EventHandler[lambda: []]
61
43
 
62
44
  @staticmethod
63
45
  def _ensure_valid_dimension(name: str, value: Any) -> None:
@@ -117,7 +99,29 @@ class ChartBase(RechartsCharts):
117
99
  )
118
100
 
119
101
 
120
- class AreaChart(ChartBase):
102
+ class CategoricalChartBase(ChartBase):
103
+ """A component that wraps a Categorical Recharts charts."""
104
+
105
+ # The source data, in which each element is an object.
106
+ data: Var[List[Dict[str, Any]]]
107
+
108
+ # The sizes of whitespace around the chart.
109
+ margin: Var[Dict[str, Any]]
110
+
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.
112
+ sync_id: Var[str]
113
+
114
+ # 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
115
+ sync_method: Var[LiteralSyncMethod]
116
+
117
+ # The layout of area in the chart. 'horizontal' | 'vertical'
118
+ layout: Var[LiteralLayout]
119
+
120
+ # 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'
121
+ stack_offset: Var[LiteralStackOffset]
122
+
123
+
124
+ class AreaChart(CategoricalChartBase):
121
125
  """An Area chart component in Recharts."""
122
126
 
123
127
  tag = "AreaChart"
@@ -139,10 +143,11 @@ class AreaChart(ChartBase):
139
143
  "Legend",
140
144
  "GraphingTooltip",
141
145
  "Area",
146
+ "Defs",
142
147
  ]
143
148
 
144
149
 
145
- class BarChart(ChartBase):
150
+ class BarChart(CategoricalChartBase):
146
151
  """A Bar chart component in Recharts."""
147
152
 
148
153
  tag = "BarChart"
@@ -182,7 +187,7 @@ class BarChart(ChartBase):
182
187
  ]
183
188
 
184
189
 
185
- class LineChart(ChartBase):
190
+ class LineChart(CategoricalChartBase):
186
191
  """A Line chart component in Recharts."""
187
192
 
188
193
  tag = "LineChart"
@@ -204,7 +209,7 @@ class LineChart(ChartBase):
204
209
  ]
205
210
 
206
211
 
207
- class ComposedChart(ChartBase):
212
+ class ComposedChart(CategoricalChartBase):
208
213
  """A Composed chart component in Recharts."""
209
214
 
210
215
  tag = "ComposedChart"
@@ -218,7 +223,7 @@ class ComposedChart(ChartBase):
218
223
  bar_category_gap: Var[Union[str, int]] # type: ignore
219
224
 
220
225
  # The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number
221
- bar_gap: Var[int]
226
+ bar_gap: Var[Union[str, int]] # type: ignore
222
227
 
223
228
  # The width of all the bars in the chart. Number
224
229
  bar_size: Var[int]
@@ -250,6 +255,9 @@ class PieChart(ChartBase):
250
255
 
251
256
  alias = "RechartsPieChart"
252
257
 
258
+ # The sizes of whitespace around the chart.
259
+ margin: Var[Dict[str, Any]]
260
+
253
261
  # Valid children components
254
262
  _valid_children: List[str] = [
255
263
  "PolarAngleAxis",
@@ -260,17 +268,17 @@ class PieChart(ChartBase):
260
268
  "Pie",
261
269
  ]
262
270
 
263
- def get_event_triggers(self) -> dict[str, Union[Var, Any]]:
264
- """Get the event triggers that pass the component's value to the handler.
271
+ # The customized event handler of mousedown on the sectors in this group
272
+ on_mouse_down: EventHandler[lambda: []]
265
273
 
266
- Returns:
267
- A dict mapping the event trigger to the var that is passed to the handler.
268
- """
269
- return {
270
- EventTriggers.ON_CLICK: lambda: [],
271
- EventTriggers.ON_MOUSE_ENTER: lambda: [],
272
- EventTriggers.ON_MOUSE_LEAVE: lambda: [],
273
- }
274
+ # The customized event handler of mouseup on the sectors in this group
275
+ on_mouse_up: EventHandler[lambda: []]
276
+
277
+ # The customized event handler of mouseover on the sectors in this group
278
+ on_mouse_over: EventHandler[lambda: []]
279
+
280
+ # The customized event handler of mouseout on the sectors in this group
281
+ on_mouse_out: EventHandler[lambda: []]
274
282
 
275
283
 
276
284
  class RadarChart(ChartBase):
@@ -280,6 +288,12 @@ class RadarChart(ChartBase):
280
288
 
281
289
  alias = "RechartsRadarChart"
282
290
 
291
+ # The source data, in which each element is an object.
292
+ data: Var[List[Dict[str, Any]]]
293
+
294
+ # The sizes of whitespace around the chart.
295
+ margin: Var[Dict[str, Any]]
296
+
283
297
  # The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage
284
298
  cx: Var[Union[int, str]]
285
299
 
@@ -328,6 +342,12 @@ class RadialBarChart(ChartBase):
328
342
 
329
343
  alias = "RechartsRadialBarChart"
330
344
 
345
+ # The source data which each element is an object.
346
+ data: Var[List[Dict[str, Any]]]
347
+
348
+ # The sizes of whitespace around the chart.
349
+ margin: Var[Dict[str, Any]]
350
+
331
351
  # The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage
332
352
  cx: Var[Union[int, str]]
333
353
 
@@ -365,18 +385,6 @@ class RadialBarChart(ChartBase):
365
385
  "RadialBar",
366
386
  ]
367
387
 
368
- def get_event_triggers(self) -> dict[str, Union[Var, Any]]:
369
- """Get the event triggers that pass the component's value to the handler.
370
-
371
- Returns:
372
- A dict mapping the event trigger to the var that is passed to the handler.
373
- """
374
- return {
375
- EventTriggers.ON_CLICK: lambda: [],
376
- EventTriggers.ON_MOUSE_ENTER: lambda: [],
377
- EventTriggers.ON_MOUSE_LEAVE: lambda: [],
378
- }
379
-
380
388
 
381
389
  class ScatterChart(ChartBase):
382
390
  """A Scatter chart component in Recharts."""
@@ -385,6 +393,9 @@ class ScatterChart(ChartBase):
385
393
 
386
394
  alias = "RechartsScatterChart"
387
395
 
396
+ # The sizes of whitespace around the chart.
397
+ margin: Var[Dict[str, Any]]
398
+
388
399
  # Valid children components
389
400
  _valid_children: List[str] = [
390
401
  "XAxis",
@@ -418,40 +429,19 @@ class ScatterChart(ChartBase):
418
429
  }
419
430
 
420
431
 
421
- class FunnelChart(RechartsCharts):
432
+ class FunnelChart(ChartBase):
422
433
  """A Funnel chart component in Recharts."""
423
434
 
424
435
  tag = "FunnelChart"
425
436
 
426
437
  alias = "RechartsFunnelChart"
427
438
 
428
- # The source data, in which each element is an object.
429
- data: Var[List[Dict[str, Any]]]
430
-
431
- # 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.
432
- sync_id: Var[str]
433
-
434
- # 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
435
- sync_method: Var[str]
436
-
437
- # The width of chart container. String or Integer
438
- width: Var[Union[str, int]] = "100%" # type: ignore
439
-
440
- # The height of chart container.
441
- height: Var[Union[str, int]] = "100%" # type: ignore
442
-
443
- # The layout of area in the chart. 'horizontal' | 'vertical'
444
- layout: Var[LiteralLayout]
439
+ # The layout of bars in the chart. centeric
440
+ layout: Var[str]
445
441
 
446
442
  # The sizes of whitespace around the chart.
447
443
  margin: Var[Dict[str, Any]]
448
444
 
449
- # 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'
450
- stack_offset: Var[LiteralStackOffset]
451
-
452
- # The layout of bars in the chart. centeric
453
- layout: Var[str]
454
-
455
445
  # Valid children components
456
446
  _valid_children: List[str] = ["Legend", "GraphingTooltip", "Funnel"]
457
447