Skip to content

Commit 80966db

Browse files
LineIndentLendemor
andauthored
[ENG-4406] cell component wrapper (#4670)
* cell component wrapper * add pyi files changes --------- Co-authored-by: pourhakimi <[email protected]> Co-authored-by: Lendemor <[email protected]>
1 parent 0484161 commit 80966db

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

reflex/components/recharts/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
"Label",
7171
"label_list",
7272
"LabelList",
73+
"cell",
74+
"Cell",
7375
],
7476
"polar": [
7577
"pie",

reflex/components/recharts/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ from .charts import radar_chart as radar_chart
5353
from .charts import radial_bar_chart as radial_bar_chart
5454
from .charts import scatter_chart as scatter_chart
5555
from .charts import treemap as treemap
56+
from .general import Cell as Cell
5657
from .general import GraphingTooltip as GraphingTooltip
5758
from .general import Label as Label
5859
from .general import LabelList as LabelList
5960
from .general import Legend as Legend
6061
from .general import ResponsiveContainer as ResponsiveContainer
62+
from .general import cell as cell
6163
from .general import graphing_tooltip as graphing_tooltip
6264
from .general import label as label
6365
from .general import label_list as label_list

reflex/components/recharts/general.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,23 @@ class LabelList(Recharts):
242242
stroke: Var[Union[str, Color]] = LiteralVar.create("none")
243243

244244

245+
class Cell(Recharts):
246+
"""A Cell component in Recharts."""
247+
248+
tag = "Cell"
249+
250+
alias = "RechartsCell"
251+
252+
# The presentation attribute of a rectangle in bar or a sector in pie.
253+
fill: Var[str]
254+
255+
# The presentation attribute of a rectangle in bar or a sector in pie.
256+
stroke: Var[str]
257+
258+
245259
responsive_container = ResponsiveContainer.create
246260
legend = Legend.create
247261
graphing_tooltip = GraphingTooltip.create
248262
label = Label.create
249263
label_list = LabelList.create
264+
cell = Cell.create

reflex/components/recharts/general.pyi

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,59 @@ class LabelList(Recharts):
482482
"""
483483
...
484484

485+
class Cell(Recharts):
486+
@overload
487+
@classmethod
488+
def create( # type: ignore
489+
cls,
490+
*children,
491+
fill: Optional[Union[Var[str], str]] = None,
492+
stroke: Optional[Union[Var[str], str]] = None,
493+
style: Optional[Style] = None,
494+
key: Optional[Any] = None,
495+
id: Optional[Any] = None,
496+
class_name: Optional[Any] = None,
497+
autofocus: Optional[bool] = None,
498+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
499+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
500+
on_click: Optional[EventType[[], BASE_STATE]] = None,
501+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
502+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
503+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
504+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
505+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
506+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
507+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
508+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
509+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
510+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
511+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
512+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
513+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
514+
**props,
515+
) -> "Cell":
516+
"""Create the component.
517+
518+
Args:
519+
*children: The children of the component.
520+
fill: The presentation attribute of a rectangle in bar or a sector in pie.
521+
stroke: The presentation attribute of a rectangle in bar or a sector in pie.
522+
style: The style of the component.
523+
key: A unique key for the component.
524+
id: The id for the component.
525+
class_name: The class name for the component.
526+
autofocus: Whether the component should take the focus once the page is loaded
527+
custom_attrs: custom attribute
528+
**props: The props of the component.
529+
530+
Returns:
531+
The component.
532+
"""
533+
...
534+
485535
responsive_container = ResponsiveContainer.create
486536
legend = Legend.create
487537
graphing_tooltip = GraphingTooltip.create
488538
label = Label.create
489539
label_list = LabelList.create
540+
cell = Cell.create

0 commit comments

Comments
 (0)