general.pyi 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. """Stub file for reflex/components/recharts/general.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.components.component import MemoizationLeaf
  7. from reflex.constants.colors import Color
  8. from reflex.event import EventType
  9. from reflex.style import Style
  10. from reflex.vars.base import Var
  11. from .recharts import Recharts
  12. class ResponsiveContainer(Recharts, MemoizationLeaf):
  13. @overload
  14. @classmethod
  15. def create( # type: ignore
  16. cls,
  17. *children,
  18. aspect: Var[int] | int | None = None,
  19. width: Var[int | str] | int | str | None = None,
  20. height: Var[int | str] | int | str | None = None,
  21. min_width: Var[int | str] | int | str | None = None,
  22. min_height: Var[int | str] | int | str | None = None,
  23. debounce: Var[int] | int | None = None,
  24. style: Style | None = None,
  25. key: Any | None = None,
  26. id: Any | None = None,
  27. class_name: Any | None = None,
  28. autofocus: bool | None = None,
  29. custom_attrs: dict[str, Var | Any] | None = None,
  30. on_blur: Optional[EventType[()]] = None,
  31. on_click: Optional[EventType[()]] = None,
  32. on_context_menu: Optional[EventType[()]] = None,
  33. on_double_click: Optional[EventType[()]] = None,
  34. on_focus: Optional[EventType[()]] = None,
  35. on_mount: Optional[EventType[()]] = None,
  36. on_mouse_down: Optional[EventType[()]] = None,
  37. on_mouse_enter: Optional[EventType[()]] = None,
  38. on_mouse_leave: Optional[EventType[()]] = None,
  39. on_mouse_move: Optional[EventType[()]] = None,
  40. on_mouse_out: Optional[EventType[()]] = None,
  41. on_mouse_over: Optional[EventType[()]] = None,
  42. on_mouse_up: Optional[EventType[()]] = None,
  43. on_resize: Optional[EventType[()]] = None,
  44. on_scroll: Optional[EventType[()]] = None,
  45. on_unmount: Optional[EventType[()]] = None,
  46. **props,
  47. ) -> "ResponsiveContainer":
  48. """Create a new memoization leaf component.
  49. Args:
  50. *children: The children of the component.
  51. aspect: The aspect ratio of the container. The final aspect ratio of the SVG element will be (width / height) * aspect. Number
  52. width: The width of chart container. Can be a number or string. Default: "100%"
  53. height: The height of chart container. Can be a number or string. Default: "100%"
  54. min_width: The minimum width of chart container. Number or string.
  55. min_height: The minimum height of chart container. Number or string.
  56. debounce: If specified a positive number, debounced function will be used to handle the resize event. Default: 0
  57. on_resize: If specified provides a callback providing the updated chart width and height values.
  58. style: The style of the component.
  59. key: A unique key for the component.
  60. id: The id for the component.
  61. class_name: The class name for the component.
  62. autofocus: Whether the component should take the focus once the page is loaded
  63. custom_attrs: custom attribute
  64. **props: The props of the component.
  65. Returns:
  66. The memoization leaf
  67. """
  68. ...
  69. class Legend(Recharts):
  70. @overload
  71. @classmethod
  72. def create( # type: ignore
  73. cls,
  74. *children,
  75. width: Var[int] | int | None = None,
  76. height: Var[int] | int | None = None,
  77. layout: Literal["horizontal", "vertical"]
  78. | Var[Literal["horizontal", "vertical"]]
  79. | None = None,
  80. align: Literal["center", "left", "right"]
  81. | Var[Literal["center", "left", "right"]]
  82. | None = None,
  83. vertical_align: Literal["bottom", "middle", "top"]
  84. | Var[Literal["bottom", "middle", "top"]]
  85. | None = None,
  86. icon_size: Var[int] | int | None = None,
  87. icon_type: Literal[
  88. "circle",
  89. "cross",
  90. "diamond",
  91. "line",
  92. "plainline",
  93. "rect",
  94. "square",
  95. "star",
  96. "triangle",
  97. "wye",
  98. ]
  99. | Var[
  100. Literal[
  101. "circle",
  102. "cross",
  103. "diamond",
  104. "line",
  105. "plainline",
  106. "rect",
  107. "square",
  108. "star",
  109. "triangle",
  110. "wye",
  111. ]
  112. ]
  113. | None = None,
  114. payload: Sequence[dict[str, Any]] | Var[Sequence[dict[str, Any]]] | None = None,
  115. chart_width: Var[int] | int | None = None,
  116. chart_height: Var[int] | int | None = None,
  117. margin: Var[dict[str, Any]] | dict[str, Any] | None = None,
  118. style: Style | None = None,
  119. key: Any | None = None,
  120. id: Any | None = None,
  121. class_name: Any | None = None,
  122. autofocus: bool | None = None,
  123. custom_attrs: dict[str, Var | Any] | None = None,
  124. on_blur: Optional[EventType[()]] = None,
  125. on_click: Optional[EventType[()]] = None,
  126. on_context_menu: Optional[EventType[()]] = None,
  127. on_double_click: Optional[EventType[()]] = None,
  128. on_focus: Optional[EventType[()]] = None,
  129. on_mount: Optional[EventType[()]] = None,
  130. on_mouse_down: Optional[EventType[()]] = None,
  131. on_mouse_enter: Optional[EventType[()]] = None,
  132. on_mouse_leave: Optional[EventType[()]] = None,
  133. on_mouse_move: Optional[EventType[()]] = None,
  134. on_mouse_out: Optional[EventType[()]] = None,
  135. on_mouse_over: Optional[EventType[()]] = None,
  136. on_mouse_up: Optional[EventType[()]] = None,
  137. on_scroll: Optional[EventType[()]] = None,
  138. on_unmount: Optional[EventType[()]] = None,
  139. **props,
  140. ) -> "Legend":
  141. """Create the component.
  142. Args:
  143. *children: The children of the component.
  144. width: The width of legend container. Number
  145. height: The height of legend container. Number
  146. layout: The layout of legend items. 'horizontal' | 'vertical'. Default: "horizontal"
  147. align: The alignment of legend items in 'horizontal' direction, which can be 'left', 'center', 'right'. Default: "center"
  148. vertical_align: The alignment of legend items in 'vertical' direction, which can be 'top', 'middle', 'bottom'. Default: "bottom"
  149. icon_size: The size of icon in each legend item. Default: 14
  150. icon_type: The type of icon in each legend item. 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye'
  151. payload: The source data of the content to be displayed in the legend, usually calculated internally. Default: []
  152. chart_width: The width of chart container, usually calculated internally.
  153. chart_height: The height of chart container, usually calculated internally.
  154. margin: The margin of chart container, usually calculated internally.
  155. on_click: The customized event handler of click on the items in this group
  156. on_mouse_down: The customized event handler of mousedown on the items in this group
  157. on_mouse_up: The customized event handler of mouseup on the items in this group
  158. on_mouse_move: The customized event handler of mousemove on the items in this group
  159. on_mouse_over: The customized event handler of mouseover on the items in this group
  160. on_mouse_out: The customized event handler of mouseout on the items in this group
  161. on_mouse_enter: The customized event handler of mouseenter on the items in this group
  162. on_mouse_leave: The customized event handler of mouseleave on the items in this group
  163. style: The style of the component.
  164. key: A unique key for the component.
  165. id: The id for the component.
  166. class_name: The class name for the component.
  167. autofocus: Whether the component should take the focus once the page is loaded
  168. custom_attrs: custom attribute
  169. **props: The props of the component.
  170. Returns:
  171. The component.
  172. """
  173. ...
  174. class GraphingTooltip(Recharts):
  175. @overload
  176. @classmethod
  177. def create( # type: ignore
  178. cls,
  179. *children,
  180. separator: Var[str] | str | None = None,
  181. offset: Var[int] | int | None = None,
  182. filter_null: Var[bool] | bool | None = None,
  183. cursor: Var[bool | dict[str, Any]] | bool | dict[str, Any] | None = None,
  184. view_box: Var[dict[str, Any]] | dict[str, Any] | None = None,
  185. item_style: Var[dict[str, Any]] | dict[str, Any] | None = None,
  186. wrapper_style: Var[dict[str, Any]] | dict[str, Any] | None = None,
  187. content_style: Var[dict[str, Any]] | dict[str, Any] | None = None,
  188. label_style: Var[dict[str, Any]] | dict[str, Any] | None = None,
  189. allow_escape_view_box: Var[dict[str, bool]] | dict[str, bool] | None = None,
  190. active: Var[bool] | bool | None = None,
  191. position: Var[dict[str, Any]] | dict[str, Any] | None = None,
  192. coordinate: Var[dict[str, Any]] | dict[str, Any] | None = None,
  193. is_animation_active: Var[bool] | bool | None = None,
  194. animation_duration: Var[int] | int | None = None,
  195. animation_easing: Literal[
  196. "ease", "ease-in", "ease-in-out", "ease-out", "linear"
  197. ]
  198. | Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]]
  199. | None = None,
  200. style: Style | None = None,
  201. key: Any | None = None,
  202. id: Any | None = None,
  203. class_name: Any | None = None,
  204. autofocus: bool | None = None,
  205. custom_attrs: dict[str, Var | Any] | None = None,
  206. on_blur: Optional[EventType[()]] = None,
  207. on_click: Optional[EventType[()]] = None,
  208. on_context_menu: Optional[EventType[()]] = None,
  209. on_double_click: Optional[EventType[()]] = None,
  210. on_focus: Optional[EventType[()]] = None,
  211. on_mount: Optional[EventType[()]] = None,
  212. on_mouse_down: Optional[EventType[()]] = None,
  213. on_mouse_enter: Optional[EventType[()]] = None,
  214. on_mouse_leave: Optional[EventType[()]] = None,
  215. on_mouse_move: Optional[EventType[()]] = None,
  216. on_mouse_out: Optional[EventType[()]] = None,
  217. on_mouse_over: Optional[EventType[()]] = None,
  218. on_mouse_up: Optional[EventType[()]] = None,
  219. on_scroll: Optional[EventType[()]] = None,
  220. on_unmount: Optional[EventType[()]] = None,
  221. **props,
  222. ) -> "GraphingTooltip":
  223. """Create the component.
  224. Args:
  225. *children: The children of the component.
  226. separator: The separator between name and value. Default: ":"
  227. offset: The offset size of tooltip. Number. Default: 10
  228. filter_null: When an item of the payload has value null or undefined, this item won't be displayed. Default: True
  229. cursor: If set false, no cursor will be drawn when tooltip is active. Default: {"strokeWidth": 1, "fill": rx.color("gray", 3)}
  230. view_box: The box of viewing area, which has the shape of {x: someVal, y: someVal, width: someVal, height: someVal}, usually calculated internally.
  231. item_style: The style of default tooltip content item which is a li element. Default: {"color": rx.color("gray", 12)}
  232. wrapper_style: The style of tooltip wrapper which is a dom element. Default: {}
  233. content_style: The style of tooltip content which is a dom element. Default: {"background": rx.color("gray", 1), "borderColor": rx.color("gray", 4), "borderRadius": "8px"}
  234. label_style: The style of default tooltip label which is a p element. Default: {"color": rx.color("gray", 11)}
  235. allow_escape_view_box: This option allows the tooltip to extend beyond the viewBox of the chart itself. Default: {"x": False, "y": False}
  236. active: If set true, the tooltip is displayed. If set false, the tooltip is hidden, usually calculated internally. Default: False
  237. position: If this field is set, the tooltip position will be fixed and will not move anymore.
  238. coordinate: The coordinate of tooltip which is usually calculated internally. Default: {"x": 0, "y": 0}
  239. is_animation_active: If set false, animation of tooltip will be disabled. Default: True
  240. animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500
  241. animation_easing: The type of easing function. Default: "ease"
  242. style: The style of the component.
  243. key: A unique key for the component.
  244. id: The id for the component.
  245. class_name: The class name for the component.
  246. autofocus: Whether the component should take the focus once the page is loaded
  247. custom_attrs: custom attribute
  248. **props: The props of the component.
  249. Returns:
  250. The component.
  251. """
  252. ...
  253. class Label(Recharts):
  254. @overload
  255. @classmethod
  256. def create( # type: ignore
  257. cls,
  258. *children,
  259. view_box: Var[dict[str, Any]] | dict[str, Any] | None = None,
  260. value: Var[str] | str | None = None,
  261. offset: Var[int] | int | None = None,
  262. position: Literal[
  263. "bottom",
  264. "center",
  265. "end",
  266. "inside",
  267. "insideBottom",
  268. "insideBottomLeft",
  269. "insideBottomRight",
  270. "insideEnd",
  271. "insideLeft",
  272. "insideRight",
  273. "insideStart",
  274. "insideTop",
  275. "insideTopLeft",
  276. "insideTopRight",
  277. "left",
  278. "outside",
  279. "right",
  280. "top",
  281. ]
  282. | Var[
  283. Literal[
  284. "bottom",
  285. "center",
  286. "end",
  287. "inside",
  288. "insideBottom",
  289. "insideBottomLeft",
  290. "insideBottomRight",
  291. "insideEnd",
  292. "insideLeft",
  293. "insideRight",
  294. "insideStart",
  295. "insideTop",
  296. "insideTopLeft",
  297. "insideTopRight",
  298. "left",
  299. "outside",
  300. "right",
  301. "top",
  302. ]
  303. ]
  304. | None = None,
  305. style: Style | None = None,
  306. key: Any | None = None,
  307. id: Any | None = None,
  308. class_name: Any | None = None,
  309. autofocus: bool | None = None,
  310. custom_attrs: dict[str, Var | Any] | None = None,
  311. on_blur: Optional[EventType[()]] = None,
  312. on_click: Optional[EventType[()]] = None,
  313. on_context_menu: Optional[EventType[()]] = None,
  314. on_double_click: Optional[EventType[()]] = None,
  315. on_focus: Optional[EventType[()]] = None,
  316. on_mount: Optional[EventType[()]] = None,
  317. on_mouse_down: Optional[EventType[()]] = None,
  318. on_mouse_enter: Optional[EventType[()]] = None,
  319. on_mouse_leave: Optional[EventType[()]] = None,
  320. on_mouse_move: Optional[EventType[()]] = None,
  321. on_mouse_out: Optional[EventType[()]] = None,
  322. on_mouse_over: Optional[EventType[()]] = None,
  323. on_mouse_up: Optional[EventType[()]] = None,
  324. on_scroll: Optional[EventType[()]] = None,
  325. on_unmount: Optional[EventType[()]] = None,
  326. **props,
  327. ) -> "Label":
  328. """Create the component.
  329. Args:
  330. *children: The children of the component.
  331. view_box: The box of viewing area, which has the shape of {x: someVal, y: someVal, width: someVal, height: someVal}, usually calculated internally.
  332. value: The value of label, which can be specified by this props or the children of <Label />
  333. offset: The offset of label which can be specified by this props or the children of <Label />
  334. position: The position of label which can be specified by this props or the children of <Label />
  335. style: The style of the component.
  336. key: A unique key for the component.
  337. id: The id for the component.
  338. class_name: The class name for the component.
  339. autofocus: Whether the component should take the focus once the page is loaded
  340. custom_attrs: custom attribute
  341. **props: The props of the component.
  342. Returns:
  343. The component.
  344. """
  345. ...
  346. class LabelList(Recharts):
  347. @overload
  348. @classmethod
  349. def create( # type: ignore
  350. cls,
  351. *children,
  352. data_key: Var[int | str] | int | str | None = None,
  353. position: Literal[
  354. "bottom",
  355. "center",
  356. "end",
  357. "inside",
  358. "insideBottom",
  359. "insideBottomLeft",
  360. "insideBottomRight",
  361. "insideEnd",
  362. "insideLeft",
  363. "insideRight",
  364. "insideStart",
  365. "insideTop",
  366. "insideTopLeft",
  367. "insideTopRight",
  368. "left",
  369. "outside",
  370. "right",
  371. "top",
  372. ]
  373. | Var[
  374. Literal[
  375. "bottom",
  376. "center",
  377. "end",
  378. "inside",
  379. "insideBottom",
  380. "insideBottomLeft",
  381. "insideBottomRight",
  382. "insideEnd",
  383. "insideLeft",
  384. "insideRight",
  385. "insideStart",
  386. "insideTop",
  387. "insideTopLeft",
  388. "insideTopRight",
  389. "left",
  390. "outside",
  391. "right",
  392. "top",
  393. ]
  394. ]
  395. | None = None,
  396. offset: Var[int] | int | None = None,
  397. fill: Color | Var[Color | str] | str | None = None,
  398. stroke: Color | Var[Color | str] | str | None = None,
  399. style: Style | None = None,
  400. key: Any | None = None,
  401. id: Any | None = None,
  402. class_name: Any | None = None,
  403. autofocus: bool | None = None,
  404. custom_attrs: dict[str, Var | Any] | None = None,
  405. on_blur: Optional[EventType[()]] = None,
  406. on_click: Optional[EventType[()]] = None,
  407. on_context_menu: Optional[EventType[()]] = None,
  408. on_double_click: Optional[EventType[()]] = None,
  409. on_focus: Optional[EventType[()]] = None,
  410. on_mount: Optional[EventType[()]] = None,
  411. on_mouse_down: Optional[EventType[()]] = None,
  412. on_mouse_enter: Optional[EventType[()]] = None,
  413. on_mouse_leave: Optional[EventType[()]] = None,
  414. on_mouse_move: Optional[EventType[()]] = None,
  415. on_mouse_out: Optional[EventType[()]] = None,
  416. on_mouse_over: Optional[EventType[()]] = None,
  417. on_mouse_up: Optional[EventType[()]] = None,
  418. on_scroll: Optional[EventType[()]] = None,
  419. on_unmount: Optional[EventType[()]] = None,
  420. **props,
  421. ) -> "LabelList":
  422. """Create the component.
  423. Args:
  424. *children: The children of the component.
  425. data_key: The key of a group of label values in data.
  426. position: The position of each label relative to it view box. "Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center"
  427. offset: The offset to the specified "position". Default: 5
  428. fill: The fill color of each label. Default: rx.color("gray", 10)
  429. stroke: The stroke color of each label. Default: "none"
  430. style: The style of the component.
  431. key: A unique key for the component.
  432. id: The id for the component.
  433. class_name: The class name for the component.
  434. autofocus: Whether the component should take the focus once the page is loaded
  435. custom_attrs: custom attribute
  436. **props: The props of the component.
  437. Returns:
  438. The component.
  439. """
  440. ...
  441. class Cell(Recharts):
  442. @overload
  443. @classmethod
  444. def create( # type: ignore
  445. cls,
  446. *children,
  447. fill: Color | Var[Color | str] | str | None = None,
  448. stroke: Color | Var[Color | str] | str | None = None,
  449. style: Style | None = None,
  450. key: Any | None = None,
  451. id: Any | None = None,
  452. class_name: Any | None = None,
  453. autofocus: bool | None = None,
  454. custom_attrs: dict[str, Var | Any] | None = None,
  455. on_blur: Optional[EventType[()]] = None,
  456. on_click: Optional[EventType[()]] = None,
  457. on_context_menu: Optional[EventType[()]] = None,
  458. on_double_click: Optional[EventType[()]] = None,
  459. on_focus: Optional[EventType[()]] = None,
  460. on_mount: Optional[EventType[()]] = None,
  461. on_mouse_down: Optional[EventType[()]] = None,
  462. on_mouse_enter: Optional[EventType[()]] = None,
  463. on_mouse_leave: Optional[EventType[()]] = None,
  464. on_mouse_move: Optional[EventType[()]] = None,
  465. on_mouse_out: Optional[EventType[()]] = None,
  466. on_mouse_over: Optional[EventType[()]] = None,
  467. on_mouse_up: Optional[EventType[()]] = None,
  468. on_scroll: Optional[EventType[()]] = None,
  469. on_unmount: Optional[EventType[()]] = None,
  470. **props,
  471. ) -> "Cell":
  472. """Create the component.
  473. Args:
  474. *children: The children of the component.
  475. fill: The presentation attribute of a rectangle in bar or a sector in pie.
  476. stroke: The presentation attribute of a rectangle in bar or a sector in pie.
  477. style: The style of the component.
  478. key: A unique key for the component.
  479. id: The id for the component.
  480. class_name: The class name for the component.
  481. autofocus: Whether the component should take the focus once the page is loaded
  482. custom_attrs: custom attribute
  483. **props: The props of the component.
  484. Returns:
  485. The component.
  486. """
  487. ...
  488. responsive_container = ResponsiveContainer.create
  489. legend = Legend.create
  490. graphing_tooltip = GraphingTooltip.create
  491. label = Label.create
  492. label_list = LabelList.create
  493. cell = Cell.create