Bladeren bron

default props comment for Bar (#4116)

Carlos 7 maanden geleden
bovenliggende
commit
7b88c54d13
2 gewijzigde bestanden met toevoegingen van 12 en 43 verwijderingen
  1. 7 21
      reflex/components/recharts/cartesian.py
  2. 5 22
      reflex/components/recharts/cartesian.pyi

+ 7 - 21
reflex/components/recharts/cartesian.py

@@ -350,12 +350,13 @@ class Bar(Cartesian):
     # The width of the line stroke.
     stroke_width: Var[int]
 
-    # The width of the line stroke.
+    # The width of the line stroke. Default: Color("accent", 9)
     fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9))
-    # If false set, background of bars will not be drawn. If true set, background of bars will be drawn which have the props calculated internally.
+
+    # If false set, background of bars will not be drawn. If true set, background of bars will be drawn which have the props calculated internally. Default: False
     background: Var[bool]
 
-    # 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]
 
     # The stack id of bar, when two bars have the same value axis and same stack_id, then the two bars are stacked in order.
@@ -376,30 +377,15 @@ class Bar(Cartesian):
     # Max size of the bar
     max_bar_size: Var[int]
 
+    # If set a value, the option is the radius of all the rounded corners. If set a array, the option are in turn the radiuses of top-left corner, top-right corner, bottom-right corner, bottom-left corner. Default: 0
+    radius: Var[Union[int, List[int]]]
+
     # The active bar is shown when a user enters a bar chart and this chart has tooltip. If set to false, no active bar will be drawn. If set to true, active bar will be drawn with the props calculated internally. If passed an object, active bar will be drawn, and the internally calculated props will be merged with the key value pairs of the passed object.
     # active_bar: Var[Union[bool, Dict[str, Any]]]
 
     # Valid children components
     _valid_children: List[str] = ["Cell", "LabelList", "ErrorBar"]
 
-    # If set false, animation of bar will be disabled.
-    is_animation_active: Var[bool]
-
-    # Specifies when the animation should begin, the unit of this option is ms, default 0.
-    animation_begin: Var[int]
-
-    # Specifies the duration of animation, the unit of this option is ms, default 1500.
-    animation_duration: Var[int]
-
-    # The type of easing function, default 'ease'
-    animation_easing: Var[LiteralAnimationEasing]
-
-    # The customized event handler of animation start
-    on_animation_start: EventHandler[lambda: []]
-
-    # The customized event handler of animation end
-    on_animation_end: EventHandler[lambda: []]
-
 
 class Line(Cartesian):
     """A Line component in Recharts."""

+ 5 - 22
reflex/components/recharts/cartesian.pyi

@@ -983,15 +983,7 @@ class Bar(Cartesian):
         name: Optional[Union[Var[Union[int, str]], int, str]] = None,
         bar_size: Optional[Union[Var[int], int]] = None,
         max_bar_size: Optional[Union[Var[int], int]] = None,
-        is_animation_active: Optional[Union[Var[bool], bool]] = None,
-        animation_begin: Optional[Union[Var[int], int]] = None,
-        animation_duration: Optional[Union[Var[int], int]] = None,
-        animation_easing: Optional[
-            Union[
-                Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"],
-                Var[Literal["ease", "ease-in", "ease-in-out", "ease-out", "linear"]],
-            ]
-        ] = None,
+        radius: Optional[Union[List[int], Var[Union[List[int], int]], int]] = None,
         layout: Optional[
             Union[
                 Literal["horizontal", "vertical"],
@@ -1039,12 +1031,6 @@ class Bar(Cartesian):
         class_name: Optional[Any] = None,
         autofocus: Optional[bool] = None,
         custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
-        on_animation_end: Optional[
-            Union[EventHandler, EventSpec, list, Callable, Var]
-        ] = None,
-        on_animation_start: Optional[
-            Union[EventHandler, EventSpec, list, Callable, Var]
-        ] = None,
         on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
         on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
         on_context_menu: Optional[
@@ -1088,19 +1074,16 @@ class Bar(Cartesian):
             *children: The children of the component.
             stroke: The color of the line stroke.
             stroke_width: The width of the line stroke.
-            fill: The width of the line stroke.
-            background: If false set, background of bars will not be drawn. If true set, background of bars 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.
+            fill: The width of the line stroke. Default: Color("accent", 9)
+            background: If false set, background of bars will not be drawn. If true set, background of bars will be drawn which have the props calculated internally. Default: False
+            label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. Default: False
             stack_id: The stack id of bar, when two bars have the same value axis and same stack_id, then the two bars are stacked in order.
             unit: The unit of data. This option will be used in tooltip.
             min_point_size: The minimal height of a bar in a horizontal BarChart, or the minimal width of a bar in a vertical BarChart. By default, 0 values are not shown. To visualize a 0 (or close to zero) point, set the minimal point size to a pixel value like 3. In stacked bar charts, minPointSize might not be respected for tightly packed values. So we strongly recommend not using this prop in stacked BarCharts.
             name: The name of data. This option will be used in tooltip and legend to represent a bar. If no value was set to this option, the value of dataKey will be used alternatively.
             bar_size: Size of the bar (if one bar_size is set then a bar_size must be set for all bars)
             max_bar_size: Max size of the bar
-            is_animation_active: If set false, animation of bar will be disabled.
-            animation_begin: Specifies when the animation should begin, the unit of this option is ms, default 0.
-            animation_duration: Specifies the duration of animation, the unit of this option is ms, default 1500.
-            animation_easing: The type of easing function, default 'ease'
+            radius: If set a value, the option is the radius of all the rounded corners. If set a array, the option are in turn the radiuses of top-left corner, top-right corner, bottom-right corner, bottom-left corner. Default: 0
             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.