From efe6954552d13e864221487c6757d31333e353a0 Mon Sep 17 00:00:00 2001 From: Alek Petuskey Date: Wed, 3 Jul 2024 18:27:07 -0700 Subject: [PATCH] minor chart clean up (#3551) * minor chart clean up * PYI * fix base pyi * fix pyi issues * fix cartesian.pyi --------- Co-authored-by: Alek Petuskey Co-authored-by: Lendemor --- reflex/components/recharts/cartesian.py | 15 ++++++++++++--- reflex/components/recharts/cartesian.pyi | 18 ++++++++++++++++-- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index a020e9a53..372a662b5 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -94,6 +94,12 @@ class Axis(Recharts): # The minimum gap between two adjacent labels min_tick_gap: Var[int] + # The stroke color of axis + stroke: Var[Union[str, Color]] + + # The text anchor of axis + text_anchor: Var[str] # 'start', 'middle', 'end' + # The customized event handler of click on the ticks of this axis on_click: EventHandler[lambda: []] @@ -177,9 +183,6 @@ class Brush(Recharts): alias = "RechartsBrush" - # Stroke color - stroke: Var[Union[str, Color]] - # The key of data displayed in the axis. data_key: Var[Union[str, int]] @@ -210,6 +213,12 @@ class Brush(Recharts): # The default end index of brush. If the option is not set, the end index will be 1. end_index: Var[int] + # The fill color of brush + fill: Var[Union[str, Color]] + + # The stroke color of brush + stroke: Var[Union[str, Color]] + def get_event_triggers(self) -> dict[str, Union[Var, Any]]: """Get the event triggers that pass the component's value to the handler. diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index f3819ffb2..d4808739f 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -86,6 +86,8 @@ class Axis(Recharts): tick_line: Optional[Union[Var[bool], bool]] = None, tick_size: Optional[Union[Var[int], int]] = None, min_tick_gap: Optional[Union[Var[int], int]] = None, + stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + text_anchor: Optional[Union[Var[str], str]] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -164,6 +166,8 @@ class Axis(Recharts): tick_line: If set false, no axis tick lines will be drawn. tick_size: The length of tick line. min_tick_gap: The minimum gap between two adjacent labels + stroke: The stroke color of axis + text_anchor: The text anchor of axis style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -251,6 +255,8 @@ class XAxis(Axis): tick_line: Optional[Union[Var[bool], bool]] = None, tick_size: Optional[Union[Var[int], int]] = None, min_tick_gap: Optional[Union[Var[int], int]] = None, + stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + text_anchor: Optional[Union[Var[str], str]] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -331,6 +337,8 @@ class XAxis(Axis): tick_line: If set false, no axis tick lines will be drawn. tick_size: The length of tick line. min_tick_gap: The minimum gap between two adjacent labels + stroke: The stroke color of axis + text_anchor: The text anchor of axis style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -417,6 +425,8 @@ class YAxis(Axis): tick_line: Optional[Union[Var[bool], bool]] = None, tick_size: Optional[Union[Var[int], int]] = None, min_tick_gap: Optional[Union[Var[int], int]] = None, + stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + text_anchor: Optional[Union[Var[str], str]] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -496,6 +506,8 @@ class YAxis(Axis): tick_line: If set false, no axis tick lines will be drawn. tick_size: The length of tick line. min_tick_gap: The minimum gap between two adjacent labels + stroke: The stroke color of axis + text_anchor: The text anchor of axis style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -641,7 +653,6 @@ class Brush(Recharts): def create( # type: ignore cls, *children, - stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, data_key: Optional[Union[Var[Union[int, str]], str, int]] = None, x: Optional[Union[Var[int], int]] = None, y: Optional[Union[Var[int], int]] = None, @@ -652,6 +663,8 @@ class Brush(Recharts): gap: Optional[Union[Var[int], int]] = None, start_index: Optional[Union[Var[int], int]] = None, end_index: Optional[Union[Var[int], int]] = None, + fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None, + stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -667,7 +680,6 @@ class Brush(Recharts): Args: *children: The children of the component. - stroke: Stroke color data_key: The key of data displayed in the axis. x: The x-coordinate of brush. y: The y-coordinate of brush. @@ -678,6 +690,8 @@ class Brush(Recharts): 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. + fill: The fill color of brush + stroke: The stroke color of brush style: The style of the component. key: A unique key for the component. id: The id for the component.