charts.pyi 47 KB

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