Skip to content

Commit

Permalink
default props comment for ErrorBar (#4120)
Browse files Browse the repository at this point in the history
* default props comment for ErrorBar

* union int float

* update
  • Loading branch information
carlosabadia authored and simon committed Oct 23, 2024
1 parent 5db5668 commit e21bd99
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
10 changes: 5 additions & 5 deletions reflex/components/recharts/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,20 +596,20 @@ class ErrorBar(Recharts):

alias = "RechartsErrorBar"

# The direction of error bar. 'x' | 'y' | 'both'
# Only used for ScatterChart with error bars in two directions. Only accepts a value of "x" or "y" and makes the error bars lie in that direction.
direction: Var[LiteralDirection]

# The key of a group of data which should be unique in an area chart.
data_key: Var[Union[str, int]]

# The width of the error bar ends.
# The width of the error bar ends. Default: 5
width: Var[int]

# The stroke color of error bar.
# The stroke color of error bar. Default: rx.color("gray", 8)
stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 8))

# The stroke width of error bar.
stroke_width: Var[int]
# The stroke width of error bar. Default: 1.5
stroke_width: Var[Union[int, float]]


class Reference(Recharts):
Expand Down
14 changes: 6 additions & 8 deletions reflex/components/recharts/cartesian.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1566,13 +1566,11 @@ class ErrorBar(Recharts):
def create( # type: ignore
cls,
*children,
direction: Optional[
Union[Literal["both", "x", "y"], Var[Literal["both", "x", "y"]]]
] = None,
direction: Optional[Union[Literal["x", "y"], Var[Literal["x", "y"]]]] = None,
data_key: Optional[Union[Var[Union[int, str]], int, str]] = None,
width: Optional[Union[Var[int], int]] = None,
stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None,
stroke_width: Optional[Union[Var[int], int]] = None,
stroke_width: Optional[Union[Var[Union[float, int]], float, int]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
Expand Down Expand Up @@ -1620,11 +1618,11 @@ class ErrorBar(Recharts):
Args:
*children: The children of the component.
direction: The direction of error bar. 'x' | 'y' | 'both'
direction: Only used for ScatterChart with error bars in two directions. Only accepts a value of "x" or "y" and makes the error bars lie in that direction.
data_key: The key of a group of data which should be unique in an area chart.
width: The width of the error bar ends.
stroke: The stroke color of error bar.
stroke_width: The stroke width of error bar.
width: The width of the error bar ends. Default: 5
stroke: The stroke color of error bar. Default: rx.color("gray", 8)
stroke_width: The stroke width of error bar. Default: 1.5
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down
2 changes: 1 addition & 1 deletion reflex/components/recharts/recharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf):
"stepBefore",
"stepAfter",
]
LiteralDirection = Literal["x", "y", "both"]
LiteralDirection = Literal["x", "y"]
LiteralInterval = Literal["preserveStart", "preserveEnd", "preserveStartEnd"]
LiteralSyncMethod = Literal["index", "value"]
2 changes: 1 addition & 1 deletion reflex/components/recharts/recharts.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,6 @@ LiteralAreaType = Literal[
"stepBefore",
"stepAfter",
]
LiteralDirection = Literal["x", "y", "both"]
LiteralDirection = Literal["x", "y"]
LiteralInterval = Literal["preserveStart", "preserveEnd", "preserveStartEnd"]
LiteralSyncMethod = Literal["index", "value"]

0 comments on commit e21bd99

Please sign in to comment.