Quellcode durchsuchen

default props comment for Line (#4117)

Carlos vor 7 Monaten
Ursprung
Commit
2652a04be8
2 geänderte Dateien mit 21 neuen und 16 gelöschten Zeilen
  1. 11 8
      reflex/components/recharts/cartesian.py
  2. 10 8
      reflex/components/recharts/cartesian.pyi

+ 11 - 8
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.
     # 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]
     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))
     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]
     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(
     dot: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create(
         {
         {
             "stroke": Color("accent", 10),
             "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(
     active_dot: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create(
         {
         {
             "stroke": Color("accent", 2),
             "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]
     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]
     hide: Var[bool]
 
 
     # Whether to connect a graph line across null points.
     # 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.
     # The unit of data. This option will be used in tooltip.
     unit: Var[Union[str, int]]
     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 components
     _valid_children: List[str] = ["LabelList", "ErrorBar"]
     _valid_children: List[str] = ["LabelList", "ErrorBar"]

+ 10 - 8
reflex/components/recharts/cartesian.pyi

@@ -1177,7 +1177,8 @@ class Line(Cartesian):
         hide: Optional[Union[Var[bool], bool]] = None,
         hide: Optional[Union[Var[bool], bool]] = None,
         connect_nulls: Optional[Union[Var[bool], bool]] = None,
         connect_nulls: Optional[Union[Var[bool], bool]] = None,
         unit: Optional[Union[Var[Union[int, str]], int, str]] = 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[
         layout: Optional[
             Union[
             Union[
                 Literal["horizontal", "vertical"],
                 Literal["horizontal", "vertical"],
@@ -1267,15 +1268,16 @@ class Line(Cartesian):
         Args:
         Args:
             *children: The children of the component.
             *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.
             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.
             connect_nulls: Whether to connect a graph line across null points.
             unit: The unit of data. This option will be used in tooltip.
             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'
             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.
             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.
             x_axis_id: The id of x-axis which is corresponding to the data.