charts.pyi 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  1. """Stub file for reflex/components/recharts/charts.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, List, Literal, Optional, Union, overload
  6. from reflex.constants.colors import Color
  7. from reflex.event import EventType
  8. from reflex.style import Style
  9. from reflex.vars.base import Var
  10. from .recharts import RechartsCharts
  11. class ChartBase(RechartsCharts):
  12. @overload
  13. @classmethod
  14. def create( # type: ignore
  15. cls,
  16. *children,
  17. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  18. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  19. style: Optional[Style] = None,
  20. key: Optional[Any] = None,
  21. id: Optional[Any] = None,
  22. class_name: Optional[Any] = None,
  23. autofocus: Optional[bool] = None,
  24. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  25. on_blur: Optional[EventType[()]] = None,
  26. on_click: Optional[EventType[()]] = None,
  27. on_context_menu: Optional[EventType[()]] = None,
  28. on_double_click: Optional[EventType[()]] = None,
  29. on_focus: Optional[EventType[()]] = None,
  30. on_mount: Optional[EventType[()]] = None,
  31. on_mouse_down: Optional[EventType[()]] = None,
  32. on_mouse_enter: Optional[EventType[()]] = None,
  33. on_mouse_leave: Optional[EventType[()]] = None,
  34. on_mouse_move: Optional[EventType[()]] = None,
  35. on_mouse_out: Optional[EventType[()]] = None,
  36. on_mouse_over: Optional[EventType[()]] = None,
  37. on_mouse_up: Optional[EventType[()]] = None,
  38. on_scroll: Optional[EventType[()]] = None,
  39. on_unmount: Optional[EventType[()]] = None,
  40. **props,
  41. ) -> "ChartBase":
  42. """Create a chart component.
  43. Args:
  44. *children: The children of the chart component.
  45. width: The width of chart container. String or Integer
  46. height: The height of chart container.
  47. on_click: The customized event handler of click on the component in this chart
  48. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  49. on_mouse_move: The customized event handler of mousemove on the component in this chart
  50. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  51. style: The style of the component.
  52. key: A unique key for the component.
  53. id: The id for the component.
  54. class_name: The class name for the component.
  55. autofocus: Whether the component should take the focus once the page is loaded
  56. custom_attrs: custom attribute
  57. **props: The properties of the chart component.
  58. Returns:
  59. The chart component wrapped in a responsive container.
  60. """
  61. ...
  62. class CategoricalChartBase(ChartBase):
  63. @overload
  64. @classmethod
  65. def create( # type: ignore
  66. cls,
  67. *children,
  68. data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None,
  69. margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None,
  70. sync_id: Optional[Union[Var[str], str]] = None,
  71. sync_method: Optional[
  72. Union[Literal["index", "value"], Var[Literal["index", "value"]]]
  73. ] = None,
  74. layout: Optional[
  75. Union[
  76. Literal["horizontal", "vertical"],
  77. Var[Literal["horizontal", "vertical"]],
  78. ]
  79. ] = None,
  80. stack_offset: Optional[
  81. Union[
  82. Literal["expand", "none", "silhouette", "wiggle"],
  83. Var[Literal["expand", "none", "silhouette", "wiggle"]],
  84. ]
  85. ] = None,
  86. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  87. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  88. style: Optional[Style] = None,
  89. key: Optional[Any] = None,
  90. id: Optional[Any] = None,
  91. class_name: Optional[Any] = None,
  92. autofocus: Optional[bool] = None,
  93. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  94. on_blur: Optional[EventType[()]] = None,
  95. on_click: Optional[EventType[()]] = None,
  96. on_context_menu: Optional[EventType[()]] = None,
  97. on_double_click: Optional[EventType[()]] = None,
  98. on_focus: Optional[EventType[()]] = None,
  99. on_mount: Optional[EventType[()]] = None,
  100. on_mouse_down: Optional[EventType[()]] = None,
  101. on_mouse_enter: Optional[EventType[()]] = None,
  102. on_mouse_leave: Optional[EventType[()]] = None,
  103. on_mouse_move: Optional[EventType[()]] = None,
  104. on_mouse_out: Optional[EventType[()]] = None,
  105. on_mouse_over: Optional[EventType[()]] = None,
  106. on_mouse_up: Optional[EventType[()]] = None,
  107. on_scroll: Optional[EventType[()]] = None,
  108. on_unmount: Optional[EventType[()]] = None,
  109. **props,
  110. ) -> "CategoricalChartBase":
  111. """Create a chart component.
  112. Args:
  113. *children: The children of the chart component.
  114. data: The source data, in which each element is an object.
  115. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
  116. 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.
  117. 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. Default: "index"
  118. layout: The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal"
  119. 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'
  120. width: The width of chart container. String or Integer
  121. height: The height of chart container.
  122. on_click: The customized event handler of click on the component in this chart
  123. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  124. on_mouse_move: The customized event handler of mousemove on the component in this chart
  125. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  126. style: The style of the component.
  127. key: A unique key for the component.
  128. id: The id for the component.
  129. class_name: The class name for the component.
  130. autofocus: Whether the component should take the focus once the page is loaded
  131. custom_attrs: custom attribute
  132. **props: The properties of the chart component.
  133. Returns:
  134. The chart component wrapped in a responsive container.
  135. """
  136. ...
  137. class AreaChart(CategoricalChartBase):
  138. @overload
  139. @classmethod
  140. def create( # type: ignore
  141. cls,
  142. *children,
  143. base_value: Optional[
  144. Union[
  145. Literal["auto", "dataMax", "dataMin"],
  146. Var[Union[Literal["auto", "dataMax", "dataMin"], int]],
  147. int,
  148. ]
  149. ] = None,
  150. data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None,
  151. margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None,
  152. sync_id: Optional[Union[Var[str], str]] = None,
  153. sync_method: Optional[
  154. Union[Literal["index", "value"], Var[Literal["index", "value"]]]
  155. ] = None,
  156. layout: Optional[
  157. Union[
  158. Literal["horizontal", "vertical"],
  159. Var[Literal["horizontal", "vertical"]],
  160. ]
  161. ] = None,
  162. stack_offset: Optional[
  163. Union[
  164. Literal["expand", "none", "silhouette", "wiggle"],
  165. Var[Literal["expand", "none", "silhouette", "wiggle"]],
  166. ]
  167. ] = None,
  168. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  169. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  170. style: Optional[Style] = None,
  171. key: Optional[Any] = None,
  172. id: Optional[Any] = None,
  173. class_name: Optional[Any] = None,
  174. autofocus: Optional[bool] = None,
  175. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  176. on_blur: Optional[EventType[()]] = None,
  177. on_click: Optional[EventType[()]] = None,
  178. on_context_menu: Optional[EventType[()]] = None,
  179. on_double_click: Optional[EventType[()]] = None,
  180. on_focus: Optional[EventType[()]] = None,
  181. on_mount: Optional[EventType[()]] = None,
  182. on_mouse_down: Optional[EventType[()]] = None,
  183. on_mouse_enter: Optional[EventType[()]] = None,
  184. on_mouse_leave: Optional[EventType[()]] = None,
  185. on_mouse_move: Optional[EventType[()]] = None,
  186. on_mouse_out: Optional[EventType[()]] = None,
  187. on_mouse_over: Optional[EventType[()]] = None,
  188. on_mouse_up: Optional[EventType[()]] = None,
  189. on_scroll: Optional[EventType[()]] = None,
  190. on_unmount: Optional[EventType[()]] = None,
  191. **props,
  192. ) -> "AreaChart":
  193. """Create a chart component.
  194. Args:
  195. *children: The children of the chart component.
  196. base_value: The base value of area. Number | 'dataMin' | 'dataMax' | 'auto'. Default: "auto"
  197. data: The source data, in which each element is an object.
  198. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
  199. 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.
  200. 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. Default: "index"
  201. layout: The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal"
  202. 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'
  203. width: The width of chart container. String or Integer
  204. height: The height of chart container.
  205. on_click: The customized event handler of click on the component in this chart
  206. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  207. on_mouse_move: The customized event handler of mousemove on the component in this chart
  208. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  209. style: The style of the component.
  210. key: A unique key for the component.
  211. id: The id for the component.
  212. class_name: The class name for the component.
  213. autofocus: Whether the component should take the focus once the page is loaded
  214. custom_attrs: custom attribute
  215. **props: The properties of the chart component.
  216. Returns:
  217. The chart component wrapped in a responsive container.
  218. """
  219. ...
  220. class BarChart(CategoricalChartBase):
  221. @overload
  222. @classmethod
  223. def create( # type: ignore
  224. cls,
  225. *children,
  226. bar_category_gap: Optional[Union[Var[Union[int, str]], int, str]] = None,
  227. bar_gap: Optional[Union[Var[Union[int, str]], int, str]] = None,
  228. bar_size: Optional[Union[Var[int], int]] = None,
  229. max_bar_size: Optional[Union[Var[int], int]] = None,
  230. stack_offset: Optional[
  231. Union[
  232. Literal["expand", "none", "silhouette", "wiggle"],
  233. Var[Literal["expand", "none", "silhouette", "wiggle"]],
  234. ]
  235. ] = None,
  236. reverse_stack_order: Optional[Union[Var[bool], bool]] = None,
  237. data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None,
  238. margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None,
  239. sync_id: Optional[Union[Var[str], str]] = None,
  240. sync_method: Optional[
  241. Union[Literal["index", "value"], Var[Literal["index", "value"]]]
  242. ] = None,
  243. layout: Optional[
  244. Union[
  245. Literal["horizontal", "vertical"],
  246. Var[Literal["horizontal", "vertical"]],
  247. ]
  248. ] = None,
  249. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  250. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  251. style: Optional[Style] = None,
  252. key: Optional[Any] = None,
  253. id: Optional[Any] = None,
  254. class_name: Optional[Any] = None,
  255. autofocus: Optional[bool] = None,
  256. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  257. on_blur: Optional[EventType[()]] = None,
  258. on_click: Optional[EventType[()]] = None,
  259. on_context_menu: Optional[EventType[()]] = None,
  260. on_double_click: Optional[EventType[()]] = None,
  261. on_focus: Optional[EventType[()]] = None,
  262. on_mount: Optional[EventType[()]] = None,
  263. on_mouse_down: Optional[EventType[()]] = None,
  264. on_mouse_enter: Optional[EventType[()]] = None,
  265. on_mouse_leave: Optional[EventType[()]] = None,
  266. on_mouse_move: Optional[EventType[()]] = None,
  267. on_mouse_out: Optional[EventType[()]] = None,
  268. on_mouse_over: Optional[EventType[()]] = None,
  269. on_mouse_up: Optional[EventType[()]] = None,
  270. on_scroll: Optional[EventType[()]] = None,
  271. on_unmount: Optional[EventType[()]] = None,
  272. **props,
  273. ) -> "BarChart":
  274. """Create a chart component.
  275. Args:
  276. *children: The children of the chart component.
  277. bar_category_gap: The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number. Default: "10%"
  278. bar_gap: The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number. Default: 4
  279. bar_size: The width of all the bars in the chart. Number
  280. max_bar_size: The maximum width of all the bars in a horizontal BarChart, or maximum height in a vertical BarChart.
  281. 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'
  282. 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.) Default: False
  283. data: The source data, in which each element is an object.
  284. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
  285. 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.
  286. 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. Default: "index"
  287. layout: The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal"
  288. width: The width of chart container. String or Integer
  289. height: The height of chart container.
  290. on_click: The customized event handler of click on the component in this chart
  291. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  292. on_mouse_move: The customized event handler of mousemove on the component in this chart
  293. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  294. style: The style of the component.
  295. key: A unique key for the component.
  296. id: The id for the component.
  297. class_name: The class name for the component.
  298. autofocus: Whether the component should take the focus once the page is loaded
  299. custom_attrs: custom attribute
  300. **props: The properties of the chart component.
  301. Returns:
  302. The chart component wrapped in a responsive container.
  303. """
  304. ...
  305. class LineChart(CategoricalChartBase):
  306. @overload
  307. @classmethod
  308. def create( # type: ignore
  309. cls,
  310. *children,
  311. data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None,
  312. margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None,
  313. sync_id: Optional[Union[Var[str], str]] = None,
  314. sync_method: Optional[
  315. Union[Literal["index", "value"], Var[Literal["index", "value"]]]
  316. ] = None,
  317. layout: Optional[
  318. Union[
  319. Literal["horizontal", "vertical"],
  320. Var[Literal["horizontal", "vertical"]],
  321. ]
  322. ] = None,
  323. stack_offset: Optional[
  324. Union[
  325. Literal["expand", "none", "silhouette", "wiggle"],
  326. Var[Literal["expand", "none", "silhouette", "wiggle"]],
  327. ]
  328. ] = None,
  329. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  330. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  331. style: Optional[Style] = None,
  332. key: Optional[Any] = None,
  333. id: Optional[Any] = None,
  334. class_name: Optional[Any] = None,
  335. autofocus: Optional[bool] = None,
  336. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  337. on_blur: Optional[EventType[()]] = None,
  338. on_click: Optional[EventType[()]] = None,
  339. on_context_menu: Optional[EventType[()]] = None,
  340. on_double_click: Optional[EventType[()]] = None,
  341. on_focus: Optional[EventType[()]] = None,
  342. on_mount: Optional[EventType[()]] = None,
  343. on_mouse_down: Optional[EventType[()]] = None,
  344. on_mouse_enter: Optional[EventType[()]] = None,
  345. on_mouse_leave: Optional[EventType[()]] = None,
  346. on_mouse_move: Optional[EventType[()]] = None,
  347. on_mouse_out: Optional[EventType[()]] = None,
  348. on_mouse_over: Optional[EventType[()]] = None,
  349. on_mouse_up: Optional[EventType[()]] = None,
  350. on_scroll: Optional[EventType[()]] = None,
  351. on_unmount: Optional[EventType[()]] = None,
  352. **props,
  353. ) -> "LineChart":
  354. """Create a chart component.
  355. Args:
  356. *children: The children of the chart component.
  357. data: The source data, in which each element is an object.
  358. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
  359. 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.
  360. 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. Default: "index"
  361. layout: The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal"
  362. 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'
  363. width: The width of chart container. String or Integer
  364. height: The height of chart container.
  365. on_click: The customized event handler of click on the component in this chart
  366. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  367. on_mouse_move: The customized event handler of mousemove on the component in this chart
  368. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  369. style: The style of the component.
  370. key: A unique key for the component.
  371. id: The id for the component.
  372. class_name: The class name for the component.
  373. autofocus: Whether the component should take the focus once the page is loaded
  374. custom_attrs: custom attribute
  375. **props: The properties of the chart component.
  376. Returns:
  377. The chart component wrapped in a responsive container.
  378. """
  379. ...
  380. class ComposedChart(CategoricalChartBase):
  381. @overload
  382. @classmethod
  383. def create( # type: ignore
  384. cls,
  385. *children,
  386. base_value: Optional[
  387. Union[
  388. Literal["auto", "dataMax", "dataMin"],
  389. Var[Union[Literal["auto", "dataMax", "dataMin"], int]],
  390. int,
  391. ]
  392. ] = None,
  393. bar_category_gap: Optional[Union[Var[Union[int, str]], int, str]] = None,
  394. bar_gap: Optional[Union[Var[int], int]] = None,
  395. bar_size: Optional[Union[Var[int], int]] = None,
  396. reverse_stack_order: Optional[Union[Var[bool], bool]] = None,
  397. data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None,
  398. margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None,
  399. sync_id: Optional[Union[Var[str], str]] = None,
  400. sync_method: Optional[
  401. Union[Literal["index", "value"], Var[Literal["index", "value"]]]
  402. ] = None,
  403. layout: Optional[
  404. Union[
  405. Literal["horizontal", "vertical"],
  406. Var[Literal["horizontal", "vertical"]],
  407. ]
  408. ] = None,
  409. stack_offset: Optional[
  410. Union[
  411. Literal["expand", "none", "silhouette", "wiggle"],
  412. Var[Literal["expand", "none", "silhouette", "wiggle"]],
  413. ]
  414. ] = None,
  415. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  416. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  417. style: Optional[Style] = None,
  418. key: Optional[Any] = None,
  419. id: Optional[Any] = None,
  420. class_name: Optional[Any] = None,
  421. autofocus: Optional[bool] = None,
  422. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  423. on_blur: Optional[EventType[()]] = None,
  424. on_click: Optional[EventType[()]] = None,
  425. on_context_menu: Optional[EventType[()]] = None,
  426. on_double_click: Optional[EventType[()]] = None,
  427. on_focus: Optional[EventType[()]] = None,
  428. on_mount: Optional[EventType[()]] = None,
  429. on_mouse_down: Optional[EventType[()]] = None,
  430. on_mouse_enter: Optional[EventType[()]] = None,
  431. on_mouse_leave: Optional[EventType[()]] = None,
  432. on_mouse_move: Optional[EventType[()]] = None,
  433. on_mouse_out: Optional[EventType[()]] = None,
  434. on_mouse_over: Optional[EventType[()]] = None,
  435. on_mouse_up: Optional[EventType[()]] = None,
  436. on_scroll: Optional[EventType[()]] = None,
  437. on_unmount: Optional[EventType[()]] = None,
  438. **props,
  439. ) -> "ComposedChart":
  440. """Create a chart component.
  441. Args:
  442. *children: The children of the chart component.
  443. base_value: The base value of area. Number | 'dataMin' | 'dataMax' | 'auto'. Default: "auto"
  444. bar_category_gap: The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number. Default: "10%"
  445. bar_gap: The gap between two bars in the same category. Default: 4
  446. bar_size: The width or height of each bar. If the barSize is not specified, the size of the bar will be calculated by the barCategoryGap, barGap and the quantity of bar groups.
  447. 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). Default: False
  448. data: The source data, in which each element is an object.
  449. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
  450. 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.
  451. 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. Default: "index"
  452. layout: The layout of area in the chart. 'horizontal' | 'vertical'. Default: "horizontal"
  453. 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'
  454. width: The width of chart container. String or Integer
  455. height: The height of chart container.
  456. on_click: The customized event handler of click on the component in this chart
  457. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  458. on_mouse_move: The customized event handler of mousemove on the component in this chart
  459. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  460. style: The style of the component.
  461. key: A unique key for the component.
  462. id: The id for the component.
  463. class_name: The class name for the component.
  464. autofocus: Whether the component should take the focus once the page is loaded
  465. custom_attrs: custom attribute
  466. **props: The properties of the chart component.
  467. Returns:
  468. The chart component wrapped in a responsive container.
  469. """
  470. ...
  471. class PieChart(ChartBase):
  472. @overload
  473. @classmethod
  474. def create( # type: ignore
  475. cls,
  476. *children,
  477. margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None,
  478. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  479. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  480. style: Optional[Style] = None,
  481. key: Optional[Any] = None,
  482. id: Optional[Any] = None,
  483. class_name: Optional[Any] = None,
  484. autofocus: Optional[bool] = None,
  485. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  486. on_blur: Optional[EventType[()]] = None,
  487. on_click: Optional[EventType[()]] = None,
  488. on_context_menu: Optional[EventType[()]] = None,
  489. on_double_click: Optional[EventType[()]] = None,
  490. on_focus: Optional[EventType[()]] = None,
  491. on_mount: Optional[EventType[()]] = None,
  492. on_mouse_down: Optional[EventType[()]] = None,
  493. on_mouse_enter: Optional[EventType[()]] = None,
  494. on_mouse_leave: Optional[EventType[()]] = None,
  495. on_mouse_move: Optional[EventType[()]] = None,
  496. on_mouse_out: Optional[EventType[()]] = None,
  497. on_mouse_over: Optional[EventType[()]] = None,
  498. on_mouse_up: Optional[EventType[()]] = None,
  499. on_scroll: Optional[EventType[()]] = None,
  500. on_unmount: Optional[EventType[()]] = None,
  501. **props,
  502. ) -> "PieChart":
  503. """Create a chart component.
  504. Args:
  505. *children: The children of the chart component.
  506. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
  507. on_mouse_down: The customized event handler of mousedown on the sectors in this group
  508. on_mouse_up: The customized event handler of mouseup on the sectors in this group
  509. on_mouse_over: The customized event handler of mouseover on the sectors in this group
  510. on_mouse_out: The customized event handler of mouseout on the sectors in this group
  511. width: The width of chart container. String or Integer
  512. height: The height of chart container.
  513. on_click: The customized event handler of click on the component in this chart
  514. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  515. on_mouse_move: The customized event handler of mousemove on the component in this chart
  516. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  517. style: The style of the component.
  518. key: A unique key for the component.
  519. id: The id for the component.
  520. class_name: The class name for the component.
  521. autofocus: Whether the component should take the focus once the page is loaded
  522. custom_attrs: custom attribute
  523. **props: The properties of the chart component.
  524. Returns:
  525. The chart component wrapped in a responsive container.
  526. """
  527. ...
  528. class RadarChart(ChartBase):
  529. def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ...
  530. @overload
  531. @classmethod
  532. def create( # type: ignore
  533. cls,
  534. *children,
  535. data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None,
  536. margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None,
  537. cx: Optional[Union[Var[Union[int, str]], int, str]] = None,
  538. cy: Optional[Union[Var[Union[int, str]], int, str]] = None,
  539. start_angle: Optional[Union[Var[int], int]] = None,
  540. end_angle: Optional[Union[Var[int], int]] = None,
  541. inner_radius: Optional[Union[Var[Union[int, str]], int, str]] = None,
  542. outer_radius: Optional[Union[Var[Union[int, str]], int, str]] = None,
  543. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  544. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  545. style: Optional[Style] = None,
  546. key: Optional[Any] = None,
  547. id: Optional[Any] = None,
  548. class_name: Optional[Any] = None,
  549. autofocus: Optional[bool] = None,
  550. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  551. on_click: Optional[EventType[()]] = None,
  552. on_mouse_enter: Optional[EventType[()]] = None,
  553. on_mouse_leave: Optional[EventType[()]] = None,
  554. **props,
  555. ) -> "RadarChart":
  556. """Create a chart component.
  557. Args:
  558. *children: The children of the chart component.
  559. data: The source data, in which each element is an object.
  560. margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. Default: {"top": 0, "right": 0, "left": 0, "bottom": 0}
  561. cx: The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage. Default: "50%"
  562. cy: The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage. Default: "50%"
  563. start_angle: The angle of first radial direction line. Default: 90
  564. end_angle: The angle of last point in the circle which should be startAngle - 360 or startAngle + 360. We'll calculate the direction of chart by 'startAngle' and 'endAngle'. Default: -270
  565. inner_radius: The inner radius of first circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: 0
  566. outer_radius: The outer radius of last circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: "80%"
  567. width: The width of chart container. String or Integer
  568. height: The height of chart container.
  569. on_click: The customized event handler of click on the component in this chart
  570. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  571. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  572. style: The style of the component.
  573. key: A unique key for the component.
  574. id: The id for the component.
  575. class_name: The class name for the component.
  576. autofocus: Whether the component should take the focus once the page is loaded
  577. custom_attrs: custom attribute
  578. **props: The properties of the chart component.
  579. Returns:
  580. The chart component wrapped in a responsive container.
  581. """
  582. ...
  583. class RadialBarChart(ChartBase):
  584. @overload
  585. @classmethod
  586. def create( # type: ignore
  587. cls,
  588. *children,
  589. data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None,
  590. margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None,
  591. cx: Optional[Union[Var[Union[int, str]], int, str]] = None,
  592. cy: Optional[Union[Var[Union[int, str]], int, str]] = None,
  593. start_angle: Optional[Union[Var[int], int]] = None,
  594. end_angle: Optional[Union[Var[int], int]] = None,
  595. inner_radius: Optional[Union[Var[Union[int, str]], int, str]] = None,
  596. outer_radius: Optional[Union[Var[Union[int, str]], int, str]] = None,
  597. bar_category_gap: Optional[Union[Var[Union[int, str]], int, str]] = None,
  598. bar_gap: Optional[Union[Var[str], str]] = None,
  599. bar_size: Optional[Union[Var[int], int]] = None,
  600. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  601. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  602. style: Optional[Style] = None,
  603. key: Optional[Any] = None,
  604. id: Optional[Any] = None,
  605. class_name: Optional[Any] = None,
  606. autofocus: Optional[bool] = None,
  607. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  608. on_blur: Optional[EventType[()]] = None,
  609. on_click: Optional[EventType[()]] = None,
  610. on_context_menu: Optional[EventType[()]] = None,
  611. on_double_click: Optional[EventType[()]] = None,
  612. on_focus: Optional[EventType[()]] = None,
  613. on_mount: Optional[EventType[()]] = None,
  614. on_mouse_down: Optional[EventType[()]] = None,
  615. on_mouse_enter: Optional[EventType[()]] = None,
  616. on_mouse_leave: Optional[EventType[()]] = None,
  617. on_mouse_move: Optional[EventType[()]] = None,
  618. on_mouse_out: Optional[EventType[()]] = None,
  619. on_mouse_over: Optional[EventType[()]] = None,
  620. on_mouse_up: Optional[EventType[()]] = None,
  621. on_scroll: Optional[EventType[()]] = None,
  622. on_unmount: Optional[EventType[()]] = None,
  623. **props,
  624. ) -> "RadialBarChart":
  625. """Create a chart component.
  626. Args:
  627. *children: The children of the chart component.
  628. data: The source data which each element is an object.
  629. margin: The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "left": 5 "bottom": 5}
  630. cx: The The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of width. Number | Percentage. Default: "50%"
  631. cy: The The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of height. Number | Percentage. Default: "50%"
  632. start_angle: The angle of first radial direction line. Default: 0
  633. end_angle: The angle of last point in the circle which should be startAngle - 360 or startAngle + 360. We'll calculate the direction of chart by 'startAngle' and 'endAngle'. Default: 360
  634. inner_radius: The inner radius of first circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: "30%"
  635. outer_radius: The outer radius of last circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. Number | Percentage. Default: "100%"
  636. bar_category_gap: The gap between two bar categories, which can be a percent value or a fixed value. Percentage | Number. Default: "10%"
  637. bar_gap: The gap between two bars in the same category, which can be a percent value or a fixed value. Percentage | Number. Default: 4
  638. bar_size: The size of each bar. If the barSize is not specified, the size of bar will be calculated by the barCategoryGap, barGap and the quantity of bar groups.
  639. width: The width of chart container. String or Integer
  640. height: The height of chart container.
  641. on_click: The customized event handler of click on the component in this chart
  642. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  643. on_mouse_move: The customized event handler of mousemove on the component in this chart
  644. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  645. style: The style of the component.
  646. key: A unique key for the component.
  647. id: The id for the component.
  648. class_name: The class name for the component.
  649. autofocus: Whether the component should take the focus once the page is loaded
  650. custom_attrs: custom attribute
  651. **props: The properties of the chart component.
  652. Returns:
  653. The chart component wrapped in a responsive container.
  654. """
  655. ...
  656. class ScatterChart(ChartBase):
  657. def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ...
  658. @overload
  659. @classmethod
  660. def create( # type: ignore
  661. cls,
  662. *children,
  663. margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None,
  664. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  665. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  666. style: Optional[Style] = None,
  667. key: Optional[Any] = None,
  668. id: Optional[Any] = None,
  669. class_name: Optional[Any] = None,
  670. autofocus: Optional[bool] = None,
  671. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  672. on_click: Optional[EventType[()]] = None,
  673. on_mouse_down: Optional[EventType[()]] = None,
  674. on_mouse_enter: Optional[EventType[()]] = None,
  675. on_mouse_leave: Optional[EventType[()]] = None,
  676. on_mouse_move: Optional[EventType[()]] = None,
  677. on_mouse_out: Optional[EventType[()]] = None,
  678. on_mouse_over: Optional[EventType[()]] = None,
  679. on_mouse_up: Optional[EventType[()]] = None,
  680. **props,
  681. ) -> "ScatterChart":
  682. """Create a chart component.
  683. Args:
  684. *children: The children of the chart component.
  685. margin: The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "bottom": 5, "left": 5}
  686. width: The width of chart container. String or Integer
  687. height: The height of chart container.
  688. on_click: The customized event handler of click on the component in this chart
  689. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  690. on_mouse_move: The customized event handler of mousemove on the component in this chart
  691. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  692. style: The style of the component.
  693. key: A unique key for the component.
  694. id: The id for the component.
  695. class_name: The class name for the component.
  696. autofocus: Whether the component should take the focus once the page is loaded
  697. custom_attrs: custom attribute
  698. **props: The properties of the chart component.
  699. Returns:
  700. The chart component wrapped in a responsive container.
  701. """
  702. ...
  703. class FunnelChart(ChartBase):
  704. @overload
  705. @classmethod
  706. def create( # type: ignore
  707. cls,
  708. *children,
  709. layout: Optional[Union[Var[str], str]] = None,
  710. margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None,
  711. stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None,
  712. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  713. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  714. style: Optional[Style] = None,
  715. key: Optional[Any] = None,
  716. id: Optional[Any] = None,
  717. class_name: Optional[Any] = None,
  718. autofocus: Optional[bool] = None,
  719. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  720. on_blur: Optional[EventType[()]] = None,
  721. on_click: Optional[EventType[()]] = None,
  722. on_context_menu: Optional[EventType[()]] = None,
  723. on_double_click: Optional[EventType[()]] = None,
  724. on_focus: Optional[EventType[()]] = None,
  725. on_mount: Optional[EventType[()]] = None,
  726. on_mouse_down: Optional[EventType[()]] = None,
  727. on_mouse_enter: Optional[EventType[()]] = None,
  728. on_mouse_leave: Optional[EventType[()]] = None,
  729. on_mouse_move: Optional[EventType[()]] = None,
  730. on_mouse_out: Optional[EventType[()]] = None,
  731. on_mouse_over: Optional[EventType[()]] = None,
  732. on_mouse_up: Optional[EventType[()]] = None,
  733. on_scroll: Optional[EventType[()]] = None,
  734. on_unmount: Optional[EventType[()]] = None,
  735. **props,
  736. ) -> "FunnelChart":
  737. """Create a chart component.
  738. Args:
  739. *children: The children of the chart component.
  740. layout: The layout of bars in the chart. Default: "centric"
  741. margin: The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "bottom": 5, "left": 5}
  742. stroke: The stroke color of each bar. String | Object
  743. width: The width of chart container. String or Integer
  744. height: The height of chart container.
  745. on_click: The customized event handler of click on the component in this chart
  746. on_mouse_enter: The customized event handler of mouseenter on the component in this chart
  747. on_mouse_move: The customized event handler of mousemove on the component in this chart
  748. on_mouse_leave: The customized event handler of mouseleave on the component in this chart
  749. style: The style of the component.
  750. key: A unique key for the component.
  751. id: The id for the component.
  752. class_name: The class name for the component.
  753. autofocus: Whether the component should take the focus once the page is loaded
  754. custom_attrs: custom attribute
  755. **props: The properties of the chart component.
  756. Returns:
  757. The chart component wrapped in a responsive container.
  758. """
  759. ...
  760. class Treemap(RechartsCharts):
  761. @overload
  762. @classmethod
  763. def create( # type: ignore
  764. cls,
  765. *children,
  766. width: Optional[Union[Var[Union[int, str]], int, str]] = None,
  767. height: Optional[Union[Var[Union[int, str]], int, str]] = None,
  768. data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None,
  769. data_key: Optional[Union[Var[Union[int, str]], int, str]] = None,
  770. name_key: Optional[Union[Var[str], str]] = None,
  771. aspect_ratio: Optional[Union[Var[int], int]] = None,
  772. is_animation_active: Optional[Union[Var[bool], bool]] = None,
  773. animation_begin: Optional[Union[Var[int], int]] = None,
  774. animation_duration: Optional[Union[Var[int], int]] = None,
  775. animation_easing: Optional[
  776. Union[
  777. Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"],
  778. Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]],
  779. ]
  780. ] = None,
  781. style: Optional[Style] = None,
  782. key: Optional[Any] = None,
  783. id: Optional[Any] = None,
  784. class_name: Optional[Any] = None,
  785. autofocus: Optional[bool] = None,
  786. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  787. on_animation_end: Optional[EventType[()]] = None,
  788. on_animation_start: Optional[EventType[()]] = None,
  789. on_blur: Optional[EventType[()]] = None,
  790. on_click: Optional[EventType[()]] = None,
  791. on_context_menu: Optional[EventType[()]] = None,
  792. on_double_click: Optional[EventType[()]] = None,
  793. on_focus: Optional[EventType[()]] = None,
  794. on_mount: Optional[EventType[()]] = None,
  795. on_mouse_down: Optional[EventType[()]] = None,
  796. on_mouse_enter: Optional[EventType[()]] = None,
  797. on_mouse_leave: Optional[EventType[()]] = None,
  798. on_mouse_move: Optional[EventType[()]] = None,
  799. on_mouse_out: Optional[EventType[()]] = None,
  800. on_mouse_over: Optional[EventType[()]] = None,
  801. on_mouse_up: Optional[EventType[()]] = None,
  802. on_scroll: Optional[EventType[()]] = None,
  803. on_unmount: Optional[EventType[()]] = None,
  804. **props,
  805. ) -> "Treemap":
  806. """Create a chart component.
  807. Args:
  808. *children: The children of the chart component.
  809. width: The width of chart container. String or Integer. Default: "100%"
  810. height: The height of chart container. String or Integer. Default: "100%"
  811. data: data of treemap. Array
  812. data_key: The key of a group of data which should be unique in a treemap. String | Number. Default: "value"
  813. name_key: The key of each sector's name. String. Default: "name"
  814. aspect_ratio: The treemap will try to keep every single rectangle's aspect ratio near the aspectRatio given. Number
  815. is_animation_active: If set false, animation of area will be disabled. Default: True
  816. animation_begin: Specifies when the animation should begin, the unit of this option is ms. Default: 0
  817. animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500
  818. animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default: "ease"
  819. on_animation_start: The customized event handler of animation start
  820. on_animation_end: The customized event handler of animation end
  821. style: The style of the component.
  822. key: A unique key for the component.
  823. id: The id for the component.
  824. class_name: The class name for the component.
  825. autofocus: Whether the component should take the focus once the page is loaded
  826. custom_attrs: custom attribute
  827. **props: The properties of the chart component.
  828. Returns:
  829. The Treemap component wrapped in a responsive container.
  830. """
  831. ...
  832. area_chart = AreaChart.create
  833. bar_chart = BarChart.create
  834. line_chart = LineChart.create
  835. composed_chart = ComposedChart.create
  836. pie_chart = PieChart.create
  837. radar_chart = RadarChart.create
  838. radial_bar_chart = RadialBarChart.create
  839. scatter_chart = ScatterChart.create
  840. funnel_chart = FunnelChart.create
  841. treemap = Treemap.create