Skip to content

Commit

Permalink
default props comment for Line (#4117)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosabadia authored Oct 8, 2024
1 parent abf0329 commit 2652a04
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
19 changes: 11 additions & 8 deletions reflex/components/recharts/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,32 +411,32 @@ class Line(Cartesian):
# The interpolation type of line. And customized interpolation function can be set to type. It's the same as type in Area.
type_: Var[LiteralAreaType]

# The color of the line stroke.
# The color of the line stroke. Default: rx.color("accent", 9)
stroke: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9))

# The width of the line stroke.
# The width of the line stroke. Default: 1
stroke_width: Var[int]

# The dot is shown when mouse enter a line chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally.
# The dot is shown when mouse enter a line chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. Default: {"stroke": rx.color("accent", 10), "fill": rx.color("accent", 4)}
dot: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create(
{
"stroke": Color("accent", 10),
"fill": Color("accent", 4),
}
)

# The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally.
# The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. Default: {"stroke": rx.color("accent", 2), "fill": rx.color("accent", 10)}
active_dot: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create(
{
"stroke": Color("accent", 2),
"fill": Color("accent", 10),
}
)

# If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally.
# If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False
label: Var[bool]

# Hides the line when true, useful when toggling visibility state via legend.
# Hides the line when true, useful when toggling visibility state via legend. Default: False
hide: Var[bool]

# Whether to connect a graph line across null points.
Expand All @@ -445,8 +445,11 @@ class Line(Cartesian):
# The unit of data. This option will be used in tooltip.
unit: Var[Union[str, int]]

# The name of data displayed in the axis. This option will be used to represent an index in a scatter chart.
name: Var[Union[str, int]]
# The coordinates of all the points in the line, usually calculated internally.
points: Var[List[Dict[str, Any]]]

# The pattern of dashes and gaps used to paint the line.
stroke_dasharray: Var[str]

# Valid children components
_valid_children: List[str] = ["LabelList", "ErrorBar"]
Expand Down
18 changes: 10 additions & 8 deletions reflex/components/recharts/cartesian.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,8 @@ class Line(Cartesian):
hide: Optional[Union[Var[bool], bool]] = None,
connect_nulls: Optional[Union[Var[bool], bool]] = None,
unit: Optional[Union[Var[Union[int, str]], int, str]] = None,
name: Optional[Union[Var[Union[int, str]], int, str]] = None,
points: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None,
stroke_dasharray: Optional[Union[Var[str], str]] = None,
layout: Optional[
Union[
Literal["horizontal", "vertical"],
Expand Down Expand Up @@ -1267,15 +1268,16 @@ class Line(Cartesian):
Args:
*children: The children of the component.
type_: The interpolation type of line. And customized interpolation function can be set to type. It's the same as type in Area.
stroke: The color of the line stroke.
stroke_width: The width of the line stroke.
dot: The dot is shown when mouse enter a line chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally.
active_dot: The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally.
label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally.
hide: Hides the line when true, useful when toggling visibility state via legend.
stroke: The color of the line stroke. Default: rx.color("accent", 9)
stroke_width: The width of the line stroke. Default: 1
dot: The dot is shown when mouse enter a line chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. Default: {"stroke": rx.color("accent", 10), "fill": rx.color("accent", 4)}
active_dot: The dot is shown when user enter an area chart and this chart has tooltip. If false set, no active dot will not be drawn. If true set, active dot will be drawn which have the props calculated internally. Default: {"stroke": rx.color("accent", 2), "fill": rx.color("accent", 10)}
label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False
hide: Hides the line when true, useful when toggling visibility state via legend. Default: False
connect_nulls: Whether to connect a graph line across null points.
unit: The unit of data. This option will be used in tooltip.
name: The name of data displayed in the axis. This option will be used to represent an index in a scatter chart.
points: The coordinates of all the points in the line, usually calculated internally.
stroke_dasharray: The pattern of dashes and gaps used to paint the line.
layout: The layout of bar in the chart, usually inherited from parent. 'horizontal' | 'vertical'
data_key: The key of a group of data which should be unique in an area chart.
x_axis_id: The id of x-axis which is corresponding to the data.
Expand Down

0 comments on commit 2652a04

Please sign in to comment.