From 2652a04be8d7914bf33f657531fbeca346f9787a Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:57:11 +0200 Subject: [PATCH] default props comment for Line (#4117) --- reflex/components/recharts/cartesian.py | 19 +++++++++++-------- reflex/components/recharts/cartesian.pyi | 18 ++++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index d982d1a0e..2d0655866 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -411,13 +411,13 @@ 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), @@ -425,7 +425,7 @@ class Line(Cartesian): } ) - # 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), @@ -433,10 +433,10 @@ class Line(Cartesian): } ) - # 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. @@ -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"] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 94b109531..26479b394 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -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"], @@ -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.