From 02d4428e390c86820124a38c6c60ccf7e510ea81 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:36:19 +0200 Subject: [PATCH 01/19] default props comment for CartesianAxis (#4127) --- reflex/components/recharts/cartesian.py | 23 +++++++++++++---------- reflex/components/recharts/cartesian.pyi | 20 +++++++++++--------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 06ca80dc5..a2c19df93 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -811,28 +811,31 @@ class CartesianAxis(Grid): alias = "RechartsCartesianAxis" - # The orientation of axis 'top' | 'bottom' | 'left' | 'right' + # The orientation of axis 'top' | 'bottom' | 'left' | 'right'. Default: "bottom" orientation: Var[LiteralOrientationTopBottomLeftRight] - # If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. + # The box of viewing area. Default: {"x": 0, "y": 0, "width": 0, "height": 0} + view_box: Var[Dict[str, Any]] + + # If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. Default: True axis_line: Var[bool] - # If set false, no axis tick lines will be drawn. If set a object, the option is the configuration of tick lines. + # If set false, no ticks will be drawn. + tick: Var[bool] + + # If set false, no axis tick lines will be drawn. If set a object, the option is the configuration of tick lines. Default: True tick_line: Var[bool] - # The length of tick line. + # The length of tick line. Default: 6 tick_size: Var[int] - # If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. + # If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" interval: Var[LiteralInterval] - # If set false, no ticks will be drawn. - ticks: Var[bool] - # If set a string or a number, default label will be drawn, and the option is content. - label: Var[str] + label: Var[Union[str, int]] - # If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. + # If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False mirror: Var[bool] # The margin between tick line and tick. diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index e7b186f6f..354e31db9 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -2179,7 +2179,9 @@ class CartesianAxis(Grid): Var[Literal["bottom", "left", "right", "top"]], ] ] = None, + view_box: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, axis_line: Optional[Union[Var[bool], bool]] = None, + tick: Optional[Union[Var[bool], bool]] = None, tick_line: Optional[Union[Var[bool], bool]] = None, tick_size: Optional[Union[Var[int], int]] = None, interval: Optional[ @@ -2188,8 +2190,7 @@ class CartesianAxis(Grid): Var[Literal["preserveEnd", "preserveStart", "preserveStartEnd"]], ] ] = None, - ticks: Optional[Union[Var[bool], bool]] = None, - label: Optional[Union[Var[str], str]] = None, + label: Optional[Union[Var[Union[int, str]], int, str]] = None, mirror: Optional[Union[Var[bool], bool]] = None, tick_margin: Optional[Union[Var[int], int]] = None, x: Optional[Union[Var[int], int]] = None, @@ -2243,14 +2244,15 @@ class CartesianAxis(Grid): Args: *children: The children of the component. - orientation: The orientation of axis 'top' | 'bottom' | 'left' | 'right' - axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. - tick_line: If set false, no axis tick lines will be drawn. If set a object, the option is the configuration of tick lines. - tick_size: The length of tick line. - interval: If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. - ticks: If set false, no ticks will be drawn. + orientation: The orientation of axis 'top' | 'bottom' | 'left' | 'right'. Default: "bottom" + view_box: The box of viewing area. Default: {"x": 0, "y": 0, "width": 0, "height": 0} + axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line. Default: True + tick: If set false, no ticks will be drawn. + tick_line: If set false, no axis tick lines will be drawn. If set a object, the option is the configuration of tick lines. Default: True + tick_size: The length of tick line. Default: 6 + interval: If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically. Default: "preserveEnd" label: If set a string or a number, default label will be drawn, and the option is content. - mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. + mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside. Default: False tick_margin: The margin between tick line and tick. x: The x-coordinate of grid. y: The y-coordinate of grid. From 4982b450fe6ac63049dc79b78d4154348773cc5f Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:36:27 +0200 Subject: [PATCH 02/19] default props comment for CartesianGrid (#4126) --- reflex/components/recharts/cartesian.py | 14 +++++++------- reflex/components/recharts/cartesian.pyi | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index a2c19df93..b44f3b22b 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -779,28 +779,28 @@ class CartesianGrid(Grid): alias = "RechartsCartesianGrid" - # The horizontal line configuration. + # The horizontal line configuration. Default: True horizontal: Var[bool] - # The vertical line configuration. + # The vertical line configuration. Default: True vertical: Var[bool] - # The x-coordinates in pixel values of all vertical lines. + # The x-coordinates in pixel values of all vertical lines. Default: [] vertical_points: Var[List[Union[str, int]]] - # The x-coordinates in pixel values of all vertical lines. + # The x-coordinates in pixel values of all vertical lines. Default: [] horizontal_points: Var[List[Union[str, int]]] # The background of grid. fill: Var[Union[str, Color]] - # The opacity of the background used to fill the space between grid lines + # The opacity of the background used to fill the space between grid lines. fill_opacity: Var[float] - # The pattern of dashes and gaps used to paint the lines of the grid + # The pattern of dashes and gaps used to paint the lines of the grid. stroke_dasharray: Var[str] - # the stroke color of grid + # the stroke color of grid. Default: rx.color("gray", 7) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 7)) diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 354e31db9..77d41e2c2 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -2142,14 +2142,14 @@ class CartesianGrid(Grid): Args: *children: The children of the component. - horizontal: The horizontal line configuration. - vertical: The vertical line configuration. - vertical_points: The x-coordinates in pixel values of all vertical lines. - horizontal_points: The x-coordinates in pixel values of all vertical lines. + horizontal: The horizontal line configuration. Default: True + vertical: The vertical line configuration. Default: True + vertical_points: The x-coordinates in pixel values of all vertical lines. Default: [] + horizontal_points: The x-coordinates in pixel values of all vertical lines. Default: [] fill: The background of grid. - fill_opacity: The opacity of the background used to fill the space between grid lines - stroke_dasharray: The pattern of dashes and gaps used to paint the lines of the grid - stroke: the stroke color of grid + fill_opacity: The opacity of the background used to fill the space between grid lines. + stroke_dasharray: The pattern of dashes and gaps used to paint the lines of the grid. + stroke: the stroke color of grid. Default: rx.color("gray", 7) x: The x-coordinate of grid. y: The y-coordinate of grid. width: The width of grid. From cb4ff24dc097f738a53c623fa9217dfbe5287ee8 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:37:10 +0200 Subject: [PATCH 03/19] default props comment for ReferenceLine (#4122) --- reflex/components/recharts/cartesian.py | 2 +- reflex/components/recharts/cartesian.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index b44f3b22b..3bec9335f 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -652,7 +652,7 @@ class ReferenceLine(Reference): # The color of the reference line. stroke: Var[Union[str, Color]] - # The width of the stroke. + # The width of the stroke. Default: 1 stroke_width: Var[Union[str, int]] # Valid children components diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 77d41e2c2..e52ac466d 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -1795,7 +1795,7 @@ class ReferenceLine(Reference): x: If set a string or a number, a vertical line perpendicular to the x-axis specified by xAxisId will be drawn. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys, otherwise no line will be drawn. y: If set a string or a number, a horizontal line perpendicular to the y-axis specified by yAxisId will be drawn. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys, otherwise no line will be drawn. stroke: The color of the reference line. - stroke_width: The width of the stroke. + stroke_width: The width of the stroke. Default: 1 segment: Array of endpoints in { x, y } format. These endpoints would be used to draw the ReferenceLine. x_axis_id: The id of x-axis which is corresponding to the data. y_axis_id: The id of y-axis which is corresponding to the data. From c619c722119e4c3033c32b91995262475e8ec6d9 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 8 Oct 2024 13:25:49 -0700 Subject: [PATCH 04/19] use system npm when REFLEX_USE_SYSTEM_NODE is passed (#4133) --- reflex/utils/path_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index 1de635b88..79596716c 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -196,7 +196,7 @@ def get_npm_path() -> str | None: The path to the npm binary file. """ npm_path = Path(constants.Node.NPM_PATH) - if not npm_path.exists(): + if use_system_node() or not npm_path.exists(): return str(which("npm")) return str(npm_path) From 567cf7ea380d45520b3a7c0eabcb6b0633277684 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:49:30 +0200 Subject: [PATCH 05/19] default props comment for ReferenceArea (#4124) --- reflex/components/recharts/cartesian.py | 4 ++-- reflex/components/recharts/cartesian.pyi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 3bec9335f..108024fa6 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -746,10 +746,10 @@ class ReferenceArea(Recharts): # A boundary value of the area. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys. If one of y1 or y2 is invalidate, the area will cover along y-axis. y2: Var[Union[str, int]] - # Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. + # Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard" if_overflow: Var[LiteralIfOverflow] - # If set true, the line will be rendered in front of bars in BarChart, etc. + # If set true, the line will be rendered in front of bars in BarChart, etc. Default: False is_front: Var[bool] # Valid children components diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index e52ac466d..05a7afee1 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -1984,8 +1984,8 @@ class ReferenceArea(Recharts): x2: A boundary value of the area. If the specified x-axis is a number axis, the type of x must be Number. If the specified x-axis is a category axis, the value of x must be one of the categorys. If one of x1 or x2 is invalidate, the area will cover along x-axis. y1: A boundary value of the area. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys. If one of y1 or y2 is invalidate, the area will cover along y-axis. y2: A boundary value of the area. If the specified y-axis is a number axis, the type of y must be Number. If the specified y-axis is a category axis, the value of y must be one of the categorys. If one of y1 or y2 is invalidate, the area will cover along y-axis. - if_overflow: Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. - is_front: If set true, the line will be rendered in front of bars in BarChart, etc. + if_overflow: Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard" + is_front: If set true, the line will be rendered in front of bars in BarChart, etc. Default: False style: The style of the component. key: A unique key for the component. id: The id for the component. From be980c6b1efb68e06c378e739a15d3a03ed9fe86 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:54:42 +0200 Subject: [PATCH 06/19] default props comment for Scatter (#4118) --- reflex/components/recharts/cartesian.py | 29 +++++++++++------------- reflex/components/recharts/cartesian.pyi | 28 +++++++++++------------ 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 108024fa6..627b42ea0 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -459,46 +459,43 @@ class Scatter(Recharts): # The source data, in which each element is an object. data: Var[List[Dict[str, Any]]] - # The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none' + # The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'. Default: "circle" legend_type: Var[LiteralLegendType] - # The id of x-axis which is corresponding to the data. + # The id of x-axis which is corresponding to the data. Default: 0 x_axis_id: Var[Union[str, int]] - # The id of y-axis which is corresponding to the data. + # The id of y-axis which is corresponding to the data. Default: 0 y_axis_id: Var[Union[str, int]] - # The id of z-axis which is corresponding to the data. - z_axis_id: Var[str] + # The id of z-axis which is corresponding to the data. Default: 0 + z_axis_id: Var[Union[str, int]] - # If false set, line will not be drawn. If true set, line will be drawn which have the props calculated internally. + # If false set, line will not be drawn. If true set, line will be drawn which have the props calculated internally. Default: False line: Var[bool] - # If a string set, specified symbol will be used to show scatter item. 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' + # If a string set, specified symbol will be used to show scatter item. 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'. Default: "circle" shape: Var[LiteralShape] - # If 'joint' set, line will generated by just jointing all the points. If 'fitting' set, line will be generated by fitting algorithm. 'joint' | 'fitting' + # If 'joint' set, line will generated by just jointing all the points. If 'fitting' set, line will be generated by fitting algorithm. 'joint' | 'fitting'. Default: "joint" line_type: Var[LiteralLineType] - # The fill + # The fill color of the scatter. Default: rx.color("accent", 9) fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 9)) - # the name - name: Var[Union[str, int]] - # Valid children components. _valid_children: List[str] = ["LabelList", "ErrorBar"] - # If set false, animation of bar will be disabled. + # If set false, animation of bar will be disabled. Default: True in CSR, False in SSR is_animation_active: Var[bool] - # Specifies when the animation should begin, the unit of this option is ms, default 0. + # 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. + # 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' + # The type of easing function. Default: "ease" animation_easing: Var[LiteralAnimationEasing] # The customized event handler of click on the component in this group diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 05a7afee1..9b61b46f8 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -1331,7 +1331,7 @@ class Scatter(Recharts): ] = None, x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, - z_axis_id: Optional[Union[Var[str], str]] = None, + z_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, line: Optional[Union[Var[bool], bool]] = None, shape: Optional[ Union[ @@ -1355,7 +1355,6 @@ class Scatter(Recharts): Union[Literal["fitting", "joint"], Var[Literal["fitting", "joint"]]] ] = None, fill: Optional[Union[Color, Var[Union[Color, str]], str]] = None, - name: Optional[Union[Var[Union[int, str]], int, str]] = 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, @@ -1413,19 +1412,18 @@ class Scatter(Recharts): Args: *children: The children of the component. data: The source data, in which each element is an object. - legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none' - x_axis_id: The id of x-axis which is corresponding to the data. - y_axis_id: The id of y-axis which is corresponding to the data. - z_axis_id: The id of z-axis which is corresponding to the data. - line: If false set, line will not be drawn. If true set, line will be drawn which have the props calculated internally. - shape: If a string set, specified symbol will be used to show scatter item. 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' - line_type: If 'joint' set, line will generated by just jointing all the points. If 'fitting' set, line will be generated by fitting algorithm. 'joint' | 'fitting' - fill: The fill - name: the name - 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' + legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered. 'line' | 'plainline' | 'square' | 'rect'| 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'. Default: "circle" + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + z_axis_id: The id of z-axis which is corresponding to the data. Default: 0 + line: If false set, line will not be drawn. If true set, line will be drawn which have the props calculated internally. Default: False + shape: If a string set, specified symbol will be used to show scatter item. 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye'. Default: "circle" + line_type: If 'joint' set, line will generated by just jointing all the points. If 'fitting' set, line will be generated by fitting algorithm. 'joint' | 'fitting'. Default: "joint" + fill: The fill color of the scatter. Default: rx.color("accent", 9) + is_animation_active: If set false, animation of bar will be disabled. Default: True in CSR, False in SSR + 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" style: The style of the component. key: A unique key for the component. id: The id for the component. From abf0329cd97f494e1d61cf289f8f9848ed8a3f61 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:56:11 +0200 Subject: [PATCH 07/19] default props comment for Area (#4115) --- reflex/components/recharts/cartesian.py | 29 +++++++++++++----------- reflex/components/recharts/cartesian.pyi | 26 ++++++++++++--------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 627b42ea0..d982d1a0e 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -295,22 +295,22 @@ class Area(Cartesian): alias = "RechartsArea" - # 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. - stroke_width: Var[int] = LiteralVar.create(1) + # The width of the line stroke. Default: 1 + stroke_width: Var[int] - # The color of the area fill. + # The color of the area fill. Default: rx.color("accent", 5) fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 5)) - # The interpolation type of area. And customized interpolation function can be set to type. 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | + # The interpolation type of area. And customized interpolation function can be set to type. 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter'. Default: "monotone" type_: Var[LiteralAreaType] = LiteralVar.create("monotone") - # If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally. + # If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally. Default: False dot: Var[Union[bool, Dict[str, Any]]] - # 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), @@ -318,17 +318,20 @@ class Area(Cartesian): } ) - # If set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally. + # If set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally. Default: False label: Var[bool] + # The value which can describle the line, usually calculated internally. + base_line: Var[Union[str, List[Dict[str, Any]]]] + + # The coordinates of all the points in the area, usually calculated internally. + points: Var[List[Dict[str, Any]]] + # The stack id of area, when two areas have the same value axis and same stack_id, then the two areas are stacked in order. stack_id: Var[Union[str, int]] - # The unit of data. This option will be used in tooltip. - unit: Var[Union[str, int]] - - # 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. - name: Var[Union[str, int]] + # Whether to connect a graph area across null points. Default: False + connect_nulls: Var[bool] # Valid children components _valid_children: List[str] = ["LabelList"] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 9b61b46f8..94b109531 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -843,9 +843,12 @@ class Area(Cartesian): Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, label: Optional[Union[Var[bool], bool]] = None, + base_line: Optional[ + Union[List[Dict[str, Any]], Var[Union[List[Dict[str, Any]], str]], str] + ] = None, + points: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, stack_id: 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, + connect_nulls: Optional[Union[Var[bool], bool]] = None, layout: Optional[ Union[ Literal["horizontal", "vertical"], @@ -934,16 +937,17 @@ class Area(Cartesian): Args: *children: The children of the component. - stroke: The color of the line stroke. - stroke_width: The width of the line stroke. - fill: The color of the area fill. - type_: The interpolation type of area. And customized interpolation function can be set to type. 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | - dot: If false set, dots will not be drawn. If true set, dots 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 set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally. + stroke: The color of the line stroke. Default: rx.color("accent", 9) + stroke_width: The width of the line stroke. Default: 1 + fill: The color of the area fill. Default: rx.color("accent", 5) + type_: The interpolation type of area. And customized interpolation function can be set to type. 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter'. Default: "monotone" + dot: If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally. Default: False + 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 set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally. Default: False + base_line: The value which can describle the line, usually calculated internally. + points: The coordinates of all the points in the area, usually calculated internally. stack_id: The stack id of area, when two areas have the same value axis and same stack_id, then the two areas are stacked in order. - unit: The unit of data. This option will be used in tooltip. - 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. + connect_nulls: Whether to connect a graph area across null points. Default: False 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. 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 08/19] 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. From 7b88c54d138003ef9237f38fecaadf7b5fc3fc12 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:58:22 +0200 Subject: [PATCH 09/19] default props comment for Bar (#4116) --- reflex/components/recharts/cartesian.py | 28 ++++++------------------ reflex/components/recharts/cartesian.pyi | 27 +++++------------------ 2 files changed, 12 insertions(+), 43 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 2d0655866..b37c036f4 100644 --- a/reflex/components/recharts/cartesian.py +++ b/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.""" diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 26479b394..9971116df 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/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. From 4843081089b45c0d00007996139d201a6ba1d0f0 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:05:22 +0200 Subject: [PATCH 10/19] default props comment for Brush (#4113) --- reflex/components/recharts/cartesian.py | 22 +++++++++++----------- reflex/components/recharts/cartesian.pyi | 18 +++++++++--------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index b37c036f4..29b48d800 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -192,40 +192,40 @@ class Brush(Recharts): alias = "RechartsBrush" - # Stroke color + # Stroke color. Default: rx.color("gray", 9) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 9)) - # The fill color of brush. + # The fill color of brush. Default: rx.color("gray", 2) fill: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 2)) # The key of data displayed in the axis. data_key: Var[Union[str, int]] - # The x-coordinate of brush. + # The x-coordinate of brush. Default: 0 x: Var[int] - # The y-coordinate of brush. + # The y-coordinate of brush. Default: 0 y: Var[int] - # The width of brush. + # The width of brush. Default: 0 width: Var[int] - # The height of brush. + # The height of brush. Default: 40 height: Var[int] - # The data domain of brush, [min, max]. + # The original data of a LineChart, a BarChart or an AreaChart. data: Var[List[Any]] - # The width of each traveller. + # The width of each traveller. Default: 5 traveller_width: Var[int] - # The data with gap of refreshing chart. If the option is not set, the chart will be refreshed every time + # The data with gap of refreshing chart. If the option is not set, the chart will be refreshed every time. Default: 1 gap: Var[int] - # The default start index of brush. If the option is not set, the start index will be 0. + # The default start index of brush. If the option is not set, the start index will be 0. Default: 0 start_index: Var[int] - # The default end index of brush. If the option is not set, the end index will be 1. + # The default end index of brush. If the option is not set, the end index will be calculated by the length of data. end_index: Var[int] # The fill color of brush diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 9971116df..846424331 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -653,15 +653,15 @@ class Brush(Recharts): stroke: The stroke color of brush fill: The fill color of brush data_key: The key of data displayed in the axis. - x: The x-coordinate of brush. - y: The y-coordinate of brush. - width: The width of brush. - height: The height of brush. - data: The data domain of brush, [min, max]. - traveller_width: The width of each traveller. - gap: The data with gap of refreshing chart. If the option is not set, the chart will be refreshed every time - start_index: The default start index of brush. If the option is not set, the start index will be 0. - end_index: The default end index of brush. If the option is not set, the end index will be 1. + x: The x-coordinate of brush. Default: 0 + y: The y-coordinate of brush. Default: 0 + width: The width of brush. Default: 0 + height: The height of brush. Default: 40 + data: The original data of a LineChart, a BarChart or an AreaChart. + traveller_width: The width of each traveller. Default: 5 + gap: The data with gap of refreshing chart. If the option is not set, the chart will be refreshed every time. Default: 1 + start_index: The default start index of brush. If the option is not set, the start index will be 0. Default: 0 + end_index: The default end index of brush. If the option is not set, the end index will be calculated by the length of data. style: The style of the component. key: A unique key for the component. id: The id for the component. From c3b7caaf13a044211073f8968fbe7131eeee259a Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:06:05 +0200 Subject: [PATCH 11/19] default props comment for ZAxis (#4112) --- reflex/components/recharts/cartesian.py | 7 +++++-- reflex/components/recharts/cartesian.pyi | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 29b48d800..2a6e88e59 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -172,7 +172,10 @@ class ZAxis(Recharts): # The key of data displayed in the axis. data_key: Var[Union[str, int]] - # The range of axis. + # The unique id of z-axis. Default: 0 + z_axis_id: Var[Union[str, int]] + + # The range of axis. Default: [10, 10] range: Var[List[int]] # The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart. @@ -181,7 +184,7 @@ class ZAxis(Recharts): # 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]] - # If 'auto' set, the scale function is decided by the type of chart, and the props type. + # If 'auto' set, the scale function is decided by the type of chart, and the props type. Default: "auto" scale: Var[LiteralScale] diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 846424331..e8d0dfc5c 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -510,6 +510,7 @@ class ZAxis(Recharts): cls, *children, data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, + z_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, range: Optional[Union[List[int], Var[List[int]]]] = None, unit: Optional[Union[Var[Union[int, str]], int, str]] = None, name: Optional[Union[Var[Union[int, str]], int, str]] = None, @@ -601,10 +602,11 @@ class ZAxis(Recharts): Args: *children: The children of the component. data_key: The key of data displayed in the axis. - range: The range of axis. + z_axis_id: The unique id of z-axis. Default: 0 + range: The range of axis. Default: [10, 10] unit: The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart. name: The name of data displayed in the axis. This option will be used to represent an index in a scatter chart. - scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. + scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. Default: "auto" style: The style of the component. key: A unique key for the component. id: The id for the component. From 19df34d94109fdcb258def604d9eb7e1f59f2650 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:07:24 +0200 Subject: [PATCH 12/19] default props comment for YAxis (#4111) * default props comment for YAxis * axis id --- reflex/components/recharts/cartesian.py | 8 ++++---- reflex/components/recharts/cartesian.pyi | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 2a6e88e59..a0ab1ddf8 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -152,14 +152,14 @@ class YAxis(Axis): alias = "RechartsYAxis" - # The orientation of axis 'left' | 'right' + # The orientation of axis 'left' | 'right'. Default: "left" orientation: Var[LiteralOrientationLeftRight] - # The id of y-axis which is corresponding to the data. + # The id of y-axis which is corresponding to the data. Default: 0 y_axis_id: Var[Union[str, int]] - # The range of the axis. Work best in conjuction with allow_data_overflow. - domain: Var[List] + # Specify the padding of y-axis. Default: {"top": 0, "bottom": 0} + padding: Var[Dict[str, int]] class ZAxis(Recharts): diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index e8d0dfc5c..f9d9686dd 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -348,7 +348,7 @@ class YAxis(Axis): Union[Literal["left", "right"], Var[Literal["left", "right"]]] ] = None, y_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, - domain: Optional[Union[List, Var[List]]] = None, + padding: Optional[Union[Dict[str, int], Var[Dict[str, int]]]] = None, data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, hide: Optional[Union[Var[bool], bool]] = None, width: Optional[Union[Var[Union[int, str]], int, str]] = None, @@ -464,9 +464,9 @@ class YAxis(Axis): Args: *children: The children of the component. - orientation: The orientation of axis 'left' | 'right' - y_axis_id: The id of y-axis which is corresponding to the data. - domain: The range of the axis. Work best in conjuction with allow_data_overflow. + orientation: The orientation of axis 'left' | 'right'. Default: "left" + y_axis_id: The id of y-axis which is corresponding to the data. Default: 0 + padding: Specify the padding of y-axis. Default: {"top": 0, "bottom": 0} data_key: The key of data displayed in the axis. hide: If set true, the axis do not display in the chart. width: The width of axis which is usually calculated internally. From 9c7de9b1891ac1bd9ea755e4cbc2f98073b07dc3 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:09:03 +0200 Subject: [PATCH 13/19] default props comment for XAxis (#4110) * default props comment for XAxis * axis id --- reflex/components/recharts/cartesian.py | 16 ++++++++-------- reflex/components/recharts/cartesian.pyi | 12 +++++++----- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index a0ab1ddf8..5515162cc 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -129,20 +129,20 @@ class XAxis(Axis): alias = "RechartsXAxis" - # The orientation of axis 'top' | 'bottom' + # The orientation of axis 'top' | 'bottom'. Default: "bottom" orientation: Var[LiteralOrientationTopBottom] - # The id of x-axis which is corresponding to the data. + # The id of x-axis which is corresponding to the data. Default: 0 x_axis_id: Var[Union[str, int]] - # Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden - include_hidden: Var[bool] = LiteralVar.create(False) + # Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden. Default: False + include_hidden: Var[bool] - # The range of the axis. Work best in conjuction with allow_data_overflow. - domain: Var[List] + # The angle of axis ticks. Default: 0 + angle: Var[int] - # The range of the axis. Work best in conjuction with allow_data_overflow. - domain: Var[List] + # Specify the padding of x-axis. Default: {"left": 0, "right": 0} + padding: Var[Dict[str, int]] class YAxis(Axis): diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index f9d9686dd..30f6a4160 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -182,7 +182,8 @@ class XAxis(Axis): ] = None, x_axis_id: Optional[Union[Var[Union[int, str]], int, str]] = None, include_hidden: Optional[Union[Var[bool], bool]] = None, - domain: Optional[Union[List, Var[List]]] = None, + angle: Optional[Union[Var[int], int]] = None, + padding: Optional[Union[Dict[str, int], Var[Dict[str, int]]]] = None, data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, hide: Optional[Union[Var[bool], bool]] = None, width: Optional[Union[Var[Union[int, str]], int, str]] = None, @@ -298,10 +299,11 @@ class XAxis(Axis): Args: *children: The children of the component. - orientation: The orientation of axis 'top' | 'bottom' - x_axis_id: The id of x-axis which is corresponding to the data. - include_hidden: Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden - domain: The range of the axis. Work best in conjuction with allow_data_overflow. + orientation: The orientation of axis 'top' | 'bottom'. Default: "bottom" + x_axis_id: The id of x-axis which is corresponding to the data. Default: 0 + include_hidden: Ensures that all datapoints within a chart contribute to its domain calculation, even when they are hidden. Default: False + angle: The angle of axis ticks. Default: 0 + padding: Specify the padding of x-axis. Default: {"left": 0, "right": 0} data_key: The key of data displayed in the axis. hide: If set true, the axis do not display in the chart. width: The width of axis which is usually calculated internally. From e633cd0385687e86695357b7a734fe729b1c821a Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:11:32 +0200 Subject: [PATCH 14/19] default props comment for Legend (#4100) --- reflex/components/recharts/general.py | 11 +++++++---- reflex/components/recharts/general.pyi | 14 +++++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/reflex/components/recharts/general.py b/reflex/components/recharts/general.py index cc252de57..25c742227 100644 --- a/reflex/components/recharts/general.py +++ b/reflex/components/recharts/general.py @@ -73,21 +73,24 @@ class Legend(Recharts): # The height of legend container. Number height: Var[int] - # The layout of legend items. 'horizontal' | 'vertical' + # The layout of legend items. 'horizontal' | 'vertical'. Default: "horizontal" layout: Var[LiteralLayout] - # The alignment of legend items in 'horizontal' direction, which can be 'left', 'center', 'right'. + # The alignment of legend items in 'horizontal' direction, which can be 'left', 'center', 'right'. Default: "center" align: Var[LiteralLegendAlign] - # The alignment of legend items in 'vertical' direction, which can be 'top', 'middle', 'bottom'. + # The alignment of legend items in 'vertical' direction, which can be 'top', 'middle', 'bottom'. Default: "bottom" vertical_align: Var[LiteralVerticalAlign] - # The size of icon in each legend item. + # The size of icon in each legend item. Default: 14 icon_size: Var[int] # The type of icon in each legend item. 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' icon_type: Var[LiteralIconType] + # The source data of the content to be displayed in the legend, usually calculated internally. Default: [] + payload: Var[List[Dict[str, Any]]] + # The width of chart container, usually calculated internally. chart_width: Var[int] diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index 0e21c8b85..3b77e32d0 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -3,7 +3,7 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, overload +from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import MemoizationLeaf from reflex.constants.colors import Color @@ -150,6 +150,9 @@ class Legend(Recharts): ], ] ] = None, + payload: Optional[ + Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]] + ] = None, chart_width: Optional[Union[Var[int], int]] = None, chart_height: Optional[Union[Var[int], int]] = None, margin: Optional[Union[Dict[str, Any], Var[Dict[str, Any]]]] = None, @@ -202,11 +205,12 @@ class Legend(Recharts): *children: The children of the component. width: The width of legend container. Number height: The height of legend container. Number - layout: The layout of legend items. 'horizontal' | 'vertical' - align: The alignment of legend items in 'horizontal' direction, which can be 'left', 'center', 'right'. - vertical_align: The alignment of legend items in 'vertical' direction, which can be 'top', 'middle', 'bottom'. - icon_size: The size of icon in each legend item. + layout: The layout of legend items. 'horizontal' | 'vertical'. Default: "horizontal" + align: The alignment of legend items in 'horizontal' direction, which can be 'left', 'center', 'right'. Default: "center" + vertical_align: The alignment of legend items in 'vertical' direction, which can be 'top', 'middle', 'bottom'. Default: "bottom" + icon_size: The size of icon in each legend item. Default: 14 icon_type: The type of icon in each legend item. 'line' | 'plainline' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye' + payload: The source data of the content to be displayed in the legend, usually calculated internally. Default: [] chart_width: The width of chart container, usually calculated internally. chart_height: The height of chart container, usually calculated internally. margin: The margin of chart container, usually calculated internally. From 2718cb51eb29c62d5b1dbde900b6af9328cb371e Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:17:14 +0200 Subject: [PATCH 15/19] default props comment for PolarAgnleAxis (#4106) --- reflex/components/recharts/polar.py | 20 ++++++++++---------- reflex/components/recharts/polar.pyi | 24 ++++++++++++++---------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index adeb0eb91..30def03da 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -211,28 +211,28 @@ class PolarAngleAxis(Recharts): # The outer radius of circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. radius: Var[Union[int, str]] - # If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. + # If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. Default: True axis_line: Var[Union[bool, Dict[str, Any]]] - # The type of axis line. - axis_line_type: Var[str] + # The type of axis line. Default: "polygon" + axis_line_type: Var[LiteralGridType] - # If false set, tick lines will not be drawn. If true set, tick lines will be drawn which have the props calculated internally. If object set, tick lines will be drawn which have the props mergered by the internal calculated props and the option. + # If false set, tick lines will not be drawn. If true set, tick lines will be drawn which have the props calculated internally. If object set, tick lines will be drawn which have the props mergered by the internal calculated props and the option. Default: False tick_line: Var[Union[bool, Dict[str, Any]]] = LiteralVar.create(False) - # The width or height of tick. - tick: Var[Union[int, str]] + # If false set, ticks will not be drawn. If true set, ticks will be drawn which have the props calculated internally. If object set, ticks will be drawn which have the props mergered by the internal calculated props and the option. Default: True + tick: Var[Union[bool, Dict[str, Any]]] # The array of every tick's value and angle. ticks: Var[List[Dict[str, Any]]] - # The orientation of axis text. - orient: Var[str] + # The orientation of axis text. Default: "outer" + orientation: Var[str] - # The stroke color of axis + # The stroke color of axis. Default: rx.color("gray", 10) stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 10)) - # Allow the axis has duplicated categorys or not when the type of axis is "category". + # Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True allow_duplicated_category: Var[bool] # Valid children components. diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index 9d793f3da..12a330950 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -312,13 +312,17 @@ class PolarAngleAxis(Recharts): axis_line: Optional[ Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, - axis_line_type: Optional[Union[Var[str], str]] = None, + axis_line_type: Optional[ + Union[Literal["circle", "polygon"], Var[Literal["circle", "polygon"]]] + ] = None, tick_line: Optional[ Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] ] = None, - tick: Optional[Union[Var[Union[int, str]], int, str]] = None, + tick: Optional[ + Union[Dict[str, Any], Var[Union[Dict[str, Any], bool]], bool] + ] = None, ticks: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, - orient: Optional[Union[Var[str], str]] = None, + orientation: Optional[Union[Var[str], str]] = None, stroke: Optional[Union[Color, Var[Union[Color, str]], str]] = None, allow_duplicated_category: Optional[Union[Var[bool], bool]] = None, style: Optional[Style] = None, @@ -372,14 +376,14 @@ class PolarAngleAxis(Recharts): cx: The x-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container width. cy: The y-coordinate of center. If set a percentage, the final value is obtained by multiplying the percentage of container height. radius: The outer radius of circle grid. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. - axis_line: If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. - axis_line_type: The type of axis line. - tick_line: If false set, tick lines will not be drawn. If true set, tick lines will be drawn which have the props calculated internally. If object set, tick lines will be drawn which have the props mergered by the internal calculated props and the option. - tick: The width or height of tick. + axis_line: If false set, axis line will not be drawn. If true set, axis line will be drawn which have the props calculated internally. If object set, axis line will be drawn which have the props mergered by the internal calculated props and the option. Default: True + axis_line_type: The type of axis line. Default: "polygon" + tick_line: If false set, tick lines will not be drawn. If true set, tick lines will be drawn which have the props calculated internally. If object set, tick lines will be drawn which have the props mergered by the internal calculated props and the option. Default: False + tick: If false set, ticks will not be drawn. If true set, ticks will be drawn which have the props calculated internally. If object set, ticks will be drawn which have the props mergered by the internal calculated props and the option. Default: True ticks: The array of every tick's value and angle. - orient: The orientation of axis text. - stroke: The stroke color of axis - allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". + orientation: The orientation of axis text. Default: "outer" + stroke: The stroke color of axis. Default: rx.color("gray", 10) + allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True style: The style of the component. key: A unique key for the component. id: The id for the component. From f05da7ceadef7e033bea8178489e36cee9a08f9c Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:17:59 +0200 Subject: [PATCH 16/19] default props comment for LabelList (#4102) --- reflex/components/recharts/general.py | 8 ++++---- reflex/components/recharts/general.pyi | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reflex/components/recharts/general.py b/reflex/components/recharts/general.py index 25c742227..559362f69 100644 --- a/reflex/components/recharts/general.py +++ b/reflex/components/recharts/general.py @@ -227,16 +227,16 @@ class LabelList(Recharts): # The key of a group of label values in data. data_key: Var[Union[str, int]] - # The position of each label relative to it view box。"Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center" + # The position of each label relative to it view box. "Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center" position: Var[LiteralPosition] - # The offset to the specified "position" + # The offset to the specified "position". Default: 5 offset: Var[int] - # The fill color of each label + # The fill color of each label. Default: rx.color("gray", 10) fill: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 10)) - # The stroke color of each label + # The stroke color of each label. Default: "none" stroke: Var[Union[str, Color]] = LiteralVar.create("none") diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index 3b77e32d0..f9603041e 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -557,10 +557,10 @@ class LabelList(Recharts): Args: *children: The children of the component. data_key: The key of a group of label values in data. - position: The position of each label relative to it view box。"Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center" - offset: The offset to the specified "position" - fill: The fill color of each label - stroke: The stroke color of each label + position: The position of each label relative to it view box. "Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center" + offset: The offset to the specified "position". Default: 5 + fill: The fill color of each label. Default: rx.color("gray", 10) + stroke: The stroke color of each label. Default: "none" style: The style of the component. key: A unique key for the component. id: The id for the component. From 9f11b83fa96ac4bd9593848a9d15905457e3cf55 Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:25:47 +0200 Subject: [PATCH 17/19] default props comment for treemap (#4098) --- reflex/components/recharts/charts.py | 17 ++++++++++------- reflex/components/recharts/charts.pyi | 16 +++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index 6f79a70ae..40a99c81a 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -457,31 +457,34 @@ class Treemap(RechartsCharts): alias = "RechartsTreemap" - # The width of chart container. String or Integer + # The width of chart container. String or Integer. Default: "100%" width: Var[Union[str, int]] = "100%" # type: ignore - # The height of chart container. + # The height of chart container. String or Integer. Default: "100%" height: Var[Union[str, int]] = "100%" # type: ignore # data of treemap. Array data: Var[List[Dict[str, Any]]] - # The key of a group of data which should be unique in a treemap. String | Number | Function + # The key of a group of data which should be unique in a treemap. String | Number. Default: "value" data_key: Var[Union[str, int]] + # The key of each sector's name. String. Default: "name" + name_key: Var[str] + # The treemap will try to keep every single rectangle's aspect ratio near the aspectRatio given. Number aspect_ratio: Var[int] - # If set false, animation of area will be disabled. + # If set false, animation of area will be disabled. Default: True is_animation_active: Var[bool] - # Specifies when the animation should begin, the unit of this option is ms. + # 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. + # Specifies the duration of animation, the unit of this option is ms. Default: 1500 animation_duration: Var[int] - # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' + # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default: "ease" animation_easing: Var[LiteralAnimationEasing] # The customized event handler of animation start diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index 2d5036656..de097bc8e 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -957,6 +957,7 @@ class Treemap(RechartsCharts): height: Optional[Union[Var[Union[int, str]], int, str]] = None, data: Optional[Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]]] = None, data_key: Optional[Union[Var[Union[int, str]], int, str]] = None, + name_key: Optional[Union[Var[str], str]] = None, aspect_ratio: Optional[Union[Var[int], int]] = None, is_animation_active: Optional[Union[Var[bool], bool]] = None, animation_begin: Optional[Union[Var[int], int]] = None, @@ -1020,15 +1021,16 @@ class Treemap(RechartsCharts): Args: *children: The children of the chart component. - width: The width of chart container. String or Integer - height: The height of chart container. + width: The width of chart container. String or Integer. Default: "100%" + height: The height of chart container. String or Integer. Default: "100%" data: data of treemap. Array - data_key: The key of a group of data which should be unique in a treemap. String | Number | Function + data_key: The key of a group of data which should be unique in a treemap. String | Number. Default: "value" + name_key: The key of each sector's name. String. Default: "name" aspect_ratio: The treemap will try to keep every single rectangle's aspect ratio near the aspectRatio given. Number - is_animation_active: If set false, animation of area will be disabled. - animation_begin: Specifies when the animation should begin, the unit of this option is ms. - animation_duration: Specifies the duration of animation, the unit of this option is ms. - animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' + is_animation_active: If set false, animation of area will be disabled. Default: True + 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. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. Default: "ease" style: The style of the component. key: A unique key for the component. id: The id for the component. From 2f8205216a2b87525d7d8426420689db8667674b Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:28:15 +0200 Subject: [PATCH 18/19] default props comment for ResponsiveContainer (#4099) --- reflex/components/recharts/general.py | 11 +++++++---- reflex/components/recharts/general.pyi | 9 +++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/reflex/components/recharts/general.py b/reflex/components/recharts/general.py index 559362f69..270707a82 100644 --- a/reflex/components/recharts/general.py +++ b/reflex/components/recharts/general.py @@ -30,21 +30,24 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): # The aspect ratio of the container. The final aspect ratio of the SVG element will be (width / height) * aspect. Number aspect: Var[int] - # The width of chart container. Can be a number or string + # The width of chart container. Can be a number or string. Default: "100%" width: Var[Union[int, str]] - # The height of chart container. Number + # The height of chart container. Can be a number or string. Default: "100%" height: Var[Union[int, str]] - # The minimum width of chart container. + # The minimum width of chart container. Number min_width: Var[int] # The minimum height of chart container. Number min_height: Var[int] - # If specified a positive number, debounced function will be used to handle the resize event. + # If specified a positive number, debounced function will be used to handle the resize event. Default: 0 debounce: Var[int] + # If specified provides a callback providing the updated chart width and height values. + on_resize: EventHandler[lambda: []] + # Valid children components _valid_children: List[str] = [ "AreaChart", diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index f9603041e..9aa88a2d3 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -64,6 +64,7 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): on_mouse_up: Optional[ Union[EventHandler, EventSpec, list, Callable, Var] ] = None, + on_resize: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ Union[EventHandler, EventSpec, list, Callable, Var] @@ -75,11 +76,11 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): Args: *children: The children of the component. aspect: The aspect ratio of the container. The final aspect ratio of the SVG element will be (width / height) * aspect. Number - width: The width of chart container. Can be a number or string - height: The height of chart container. Number - min_width: The minimum width of chart container. + width: The width of chart container. Can be a number or string. Default: "100%" + height: The height of chart container. Can be a number or string. Default: "100%" + min_width: The minimum width of chart container. Number min_height: The minimum height of chart container. Number - debounce: If specified a positive number, debounced function will be used to handle the resize event. + debounce: If specified a positive number, debounced function will be used to handle the resize event. Default: 0 style: The style of the component. key: A unique key for the component. id: The id for the component. From b0de28208fe9ef936f66867e3dfaeca342e6508b Mon Sep 17 00:00:00 2001 From: Carlos <36110765+carlosabadia@users.noreply.github.com> Date: Wed, 9 Oct 2024 01:30:34 +0200 Subject: [PATCH 19/19] default props comment for scatterchart (#4096) --- reflex/components/recharts/charts.py | 2 +- reflex/components/recharts/charts.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index 40a99c81a..e2170d7e8 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -394,7 +394,7 @@ class ScatterChart(ChartBase): alias = "RechartsScatterChart" - # The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. + # The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "bottom": 5, "left": 5} margin: Var[Dict[str, Any]] # Valid children components diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index de097bc8e..d39167b4d 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -855,7 +855,7 @@ class ScatterChart(ChartBase): Args: *children: The children of the chart component. - margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}. + margin: The sizes of whitespace around the chart. Default: {"top": 5, "right": 5, "bottom": 5, "left": 5} width: The width of chart container. String or Integer height: The height of chart container. style: The style of the component.