From 13013cc703379fd9d8520ed0f22bf18c16237b38 Mon Sep 17 00:00:00 2001 From: coolstorm Date: Fri, 12 Jul 2024 02:14:50 +0530 Subject: [PATCH] add: radial bar properties --- reflex/components/recharts/polar.py | 21 +++++++++++++++++++-- reflex/constants/event.py | 2 ++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 4588c4bf0..1896c3e05 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -156,10 +156,25 @@ class RadialBar(Recharts): label: Var[Union[bool, Dict[str, Any]]] # If false set, background sector will not be drawn. - background: Var[bool] + background: Var[Union[bool, Dict[str, Any]]] + + # The source data which each element is an object. + data: Var[List[Dict[str, Any]]] + + # If set false, animation of radial bars will be disabled. + is_animation_active: Var[bool] + + # Specifies when the animation should begin, the unit of this option is ms. + animation_begin: Var[int] + + # Specifies the duration of animation, the unit of this option is ms. + animation_duration: Var[int] + + # The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' + animation_easing: Var[LiteralAnimationEasing] # Valid children components - _valid_children: List[str] = ["LabelList"] + _valid_children: List[str] = ["Cell","LabelList"] def get_event_triggers(self) -> dict[str, Union[Var, Any]]: """Get the event triggers that pass the component's value to the handler. @@ -174,6 +189,8 @@ class RadialBar(Recharts): EventTriggers.ON_MOUSE_OUT: lambda: [], EventTriggers.ON_MOUSE_ENTER: lambda: [], EventTriggers.ON_MOUSE_LEAVE: lambda: [], + EventTriggers.ON_ANIMATION_START: lambda: [], + EventTriggers.ON_ANIMATION_END: lambda: [], } diff --git a/reflex/constants/event.py b/reflex/constants/event.py index 16a2c6a5c..351a1ac52 100644 --- a/reflex/constants/event.py +++ b/reflex/constants/event.py @@ -95,3 +95,5 @@ class EventTriggers(SimpleNamespace): ON_CLEAR_SERVER_ERRORS = "on_clear_server_errors" ON_VALUE_COMMIT = "on_value_commit" ON_SELECT = "on_select" + ON_ANIMATION_START = "on_animation_start" + ON_ANIMATION_END = "on_animation_end"