reflex 0.5.7__py3-none-any.whl → 0.5.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- reflex/.templates/web/utils/state.js +1 -1
- reflex/app.py +20 -2
- reflex/components/core/banner.py +14 -0
- reflex/components/core/banner.pyi +3 -3
- reflex/components/core/debounce.py +3 -0
- reflex/components/el/__init__.py +1 -0
- reflex/components/el/__init__.pyi +8 -5
- reflex/components/el/elements/__init__.py +3 -1
- reflex/components/el/elements/__init__.pyi +8 -6
- reflex/components/el/elements/media.py +98 -18
- reflex/components/el/elements/media.pyi +523 -18
- reflex/components/el/elements/metadata.py +5 -1
- reflex/components/radix/primitives/base.py +1 -1
- reflex/components/radix/themes/layout/list.py +0 -2
- reflex/components/recharts/cartesian.py +46 -20
- reflex/components/recharts/cartesian.pyi +26 -14
- reflex/components/recharts/charts.py +4 -0
- reflex/components/recharts/charts.pyi +3 -0
- reflex/components/recharts/general.py +23 -9
- reflex/components/recharts/general.pyi +6 -4
- reflex/components/recharts/polar.py +35 -11
- reflex/components/recharts/polar.pyi +35 -7
- reflex/components/sonner/toast.py +28 -2
- reflex/components/sonner/toast.pyi +14 -7
- reflex/constants/base.py +21 -0
- reflex/constants/event.py +2 -0
- reflex/experimental/vars/__init__.py +17 -0
- reflex/experimental/vars/base.py +282 -15
- reflex/experimental/vars/function.py +214 -0
- reflex/experimental/vars/number.py +1295 -0
- reflex/experimental/vars/sequence.py +1039 -0
- reflex/reflex.py +29 -2
- reflex/state.py +59 -10
- reflex/utils/imports.py +71 -8
- reflex/utils/prerequisites.py +115 -35
- reflex/utils/pyi_generator.py +2 -0
- reflex/utils/redir.py +52 -0
- reflex/vars.py +220 -11
- reflex/vars.pyi +20 -2
- {reflex-0.5.7.dist-info → reflex-0.5.8.dist-info}/METADATA +2 -2
- {reflex-0.5.7.dist-info → reflex-0.5.8.dist-info}/RECORD +44 -40
- {reflex-0.5.7.dist-info → reflex-0.5.8.dist-info}/LICENSE +0 -0
- {reflex-0.5.7.dist-info → reflex-0.5.8.dist-info}/WHEEL +0 -0
- {reflex-0.5.7.dist-info → reflex-0.5.8.dist-info}/entry_points.txt +0 -0
|
@@ -86,7 +86,7 @@ class Axis(Recharts):
|
|
|
86
86
|
tick_count: Var[int]
|
|
87
87
|
|
|
88
88
|
# If set false, no axis tick lines will be drawn.
|
|
89
|
-
tick_line: Var[bool]
|
|
89
|
+
tick_line: Var[bool] = Var.create_safe(False)
|
|
90
90
|
|
|
91
91
|
# The length of tick line.
|
|
92
92
|
tick_size: Var[int]
|
|
@@ -95,7 +95,7 @@ class Axis(Recharts):
|
|
|
95
95
|
min_tick_gap: Var[int]
|
|
96
96
|
|
|
97
97
|
# The stroke color of axis
|
|
98
|
-
stroke: Var[Union[str, Color]]
|
|
98
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("gray", 9))
|
|
99
99
|
|
|
100
100
|
# The text anchor of axis
|
|
101
101
|
text_anchor: Var[str] # 'start', 'middle', 'end'
|
|
@@ -186,6 +186,12 @@ class Brush(Recharts):
|
|
|
186
186
|
|
|
187
187
|
alias = "RechartsBrush"
|
|
188
188
|
|
|
189
|
+
# Stroke color
|
|
190
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("gray", 9))
|
|
191
|
+
|
|
192
|
+
# The fill color of brush.
|
|
193
|
+
fill: Var[Union[str, Color]] = Var.create_safe(Color("gray", 2))
|
|
194
|
+
|
|
189
195
|
# The key of data displayed in the axis.
|
|
190
196
|
data_key: Var[Union[str, int]]
|
|
191
197
|
|
|
@@ -284,22 +290,27 @@ class Area(Cartesian):
|
|
|
284
290
|
alias = "RechartsArea"
|
|
285
291
|
|
|
286
292
|
# The color of the line stroke.
|
|
287
|
-
stroke: Var[Union[str, Color]]
|
|
293
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("accent", 9))
|
|
288
294
|
|
|
289
295
|
# The width of the line stroke.
|
|
290
|
-
stroke_width: Var[int]
|
|
296
|
+
stroke_width: Var[int] = Var.create_safe(1)
|
|
291
297
|
|
|
292
298
|
# The color of the area fill.
|
|
293
|
-
fill: Var[Union[str, Color]]
|
|
299
|
+
fill: Var[Union[str, Color]] = Var.create_safe(Color("accent", 5))
|
|
294
300
|
|
|
295
301
|
# 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' |
|
|
296
|
-
type_: Var[LiteralAreaType]
|
|
302
|
+
type_: Var[LiteralAreaType] = Var.create_safe("monotone", _var_is_string=True)
|
|
297
303
|
|
|
298
|
-
# If set
|
|
299
|
-
dot: Var[bool]
|
|
304
|
+
# If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally.
|
|
305
|
+
dot: Var[Union[bool, Dict[str, Any]]]
|
|
300
306
|
|
|
301
|
-
# The dot is shown when
|
|
302
|
-
active_dot: Var[bool]
|
|
307
|
+
# 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.
|
|
308
|
+
active_dot: Var[Union[bool, Dict[str, Any]]] = Var.create_safe(
|
|
309
|
+
{
|
|
310
|
+
"stroke": Color("accent", 2),
|
|
311
|
+
"fill": Color("accent", 10),
|
|
312
|
+
}
|
|
313
|
+
)
|
|
303
314
|
|
|
304
315
|
# If set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally.
|
|
305
316
|
label: Var[bool]
|
|
@@ -331,8 +342,7 @@ class Bar(Cartesian):
|
|
|
331
342
|
stroke_width: Var[int]
|
|
332
343
|
|
|
333
344
|
# The width of the line stroke.
|
|
334
|
-
fill: Var[Union[str, Color]]
|
|
335
|
-
|
|
345
|
+
fill: Var[Union[str, Color]] = Var.create_safe(Color("accent", 9))
|
|
336
346
|
# 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.
|
|
337
347
|
background: Var[bool]
|
|
338
348
|
|
|
@@ -393,16 +403,26 @@ class Line(Cartesian):
|
|
|
393
403
|
type_: Var[LiteralAreaType]
|
|
394
404
|
|
|
395
405
|
# The color of the line stroke.
|
|
396
|
-
stroke: Var[Union[str, Color]]
|
|
406
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("accent", 9))
|
|
397
407
|
|
|
398
408
|
# The width of the line stroke.
|
|
399
|
-
|
|
409
|
+
stroke_width: Var[int]
|
|
400
410
|
|
|
401
|
-
# If set
|
|
402
|
-
dot: Var[bool]
|
|
411
|
+
# 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.
|
|
412
|
+
dot: Var[Union[bool, Dict[str, Any]]] = Var.create_safe(
|
|
413
|
+
{
|
|
414
|
+
"stroke": Color("accent", 10),
|
|
415
|
+
"fill": Color("accent", 4),
|
|
416
|
+
}
|
|
417
|
+
)
|
|
403
418
|
|
|
404
|
-
# The dot is shown when
|
|
405
|
-
active_dot: Var[bool]
|
|
419
|
+
# 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.
|
|
420
|
+
active_dot: Var[Union[bool, Dict[str, Any]]] = Var.create_safe(
|
|
421
|
+
{
|
|
422
|
+
"stroke": Color("accent", 2),
|
|
423
|
+
"fill": Color("accent", 10),
|
|
424
|
+
}
|
|
425
|
+
)
|
|
406
426
|
|
|
407
427
|
# If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally.
|
|
408
428
|
label: Var[bool]
|
|
@@ -455,7 +475,7 @@ class Scatter(Recharts):
|
|
|
455
475
|
line_type: Var[LiteralLineType]
|
|
456
476
|
|
|
457
477
|
# The fill
|
|
458
|
-
fill: Var[Union[str, Color]]
|
|
478
|
+
fill: Var[Union[str, Color]] = Var.create_safe(Color("accent", 9))
|
|
459
479
|
|
|
460
480
|
# the name
|
|
461
481
|
name: Var[Union[str, int]]
|
|
@@ -531,6 +551,9 @@ class Funnel(Recharts):
|
|
|
531
551
|
# The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'
|
|
532
552
|
animation_easing: Var[LiteralAnimationEasing]
|
|
533
553
|
|
|
554
|
+
# stroke color
|
|
555
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("gray", 3))
|
|
556
|
+
|
|
534
557
|
# Valid children components
|
|
535
558
|
_valid_children: List[str] = ["LabelList", "Cell"]
|
|
536
559
|
|
|
@@ -582,7 +605,7 @@ class ErrorBar(Recharts):
|
|
|
582
605
|
width: Var[int]
|
|
583
606
|
|
|
584
607
|
# The stroke color of error bar.
|
|
585
|
-
stroke: Var[Union[str, Color]]
|
|
608
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("gray", 8))
|
|
586
609
|
|
|
587
610
|
# The stroke width of error bar.
|
|
588
611
|
stroke_width: Var[int]
|
|
@@ -771,6 +794,9 @@ class CartesianGrid(Grid):
|
|
|
771
794
|
# The pattern of dashes and gaps used to paint the lines of the grid
|
|
772
795
|
stroke_dasharray: Var[str]
|
|
773
796
|
|
|
797
|
+
# the stroke color of grid
|
|
798
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("gray", 7))
|
|
799
|
+
|
|
774
800
|
|
|
775
801
|
class CartesianAxis(Grid):
|
|
776
802
|
"""A CartesianAxis component in Recharts."""
|
|
@@ -663,6 +663,8 @@ class Brush(Recharts):
|
|
|
663
663
|
def create( # type: ignore
|
|
664
664
|
cls,
|
|
665
665
|
*children,
|
|
666
|
+
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
667
|
+
fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
666
668
|
data_key: Optional[Union[Var[Union[int, str]], str, int]] = None,
|
|
667
669
|
x: Optional[Union[Var[int], int]] = None,
|
|
668
670
|
y: Optional[Union[Var[int], int]] = None,
|
|
@@ -673,8 +675,6 @@ class Brush(Recharts):
|
|
|
673
675
|
gap: Optional[Union[Var[int], int]] = None,
|
|
674
676
|
start_index: Optional[Union[Var[int], int]] = None,
|
|
675
677
|
end_index: Optional[Union[Var[int], int]] = None,
|
|
676
|
-
fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
677
|
-
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
678
678
|
style: Optional[Style] = None,
|
|
679
679
|
key: Optional[Any] = None,
|
|
680
680
|
id: Optional[Any] = None,
|
|
@@ -690,6 +690,8 @@ class Brush(Recharts):
|
|
|
690
690
|
|
|
691
691
|
Args:
|
|
692
692
|
*children: The children of the component.
|
|
693
|
+
stroke: The stroke color of brush
|
|
694
|
+
fill: The fill color of brush
|
|
693
695
|
data_key: The key of data displayed in the axis.
|
|
694
696
|
x: The x-coordinate of brush.
|
|
695
697
|
y: The y-coordinate of brush.
|
|
@@ -700,8 +702,6 @@ class Brush(Recharts):
|
|
|
700
702
|
gap: The data with gap of refreshing chart. If the option is not set, the chart will be refreshed every time
|
|
701
703
|
start_index: The default start index of brush. If the option is not set, the start index will be 0.
|
|
702
704
|
end_index: The default end index of brush. If the option is not set, the end index will be 1.
|
|
703
|
-
fill: The fill color of brush
|
|
704
|
-
stroke: The stroke color of brush
|
|
705
705
|
style: The style of the component.
|
|
706
706
|
key: A unique key for the component.
|
|
707
707
|
id: The id for the component.
|
|
@@ -886,8 +886,12 @@ class Area(Cartesian):
|
|
|
886
886
|
],
|
|
887
887
|
]
|
|
888
888
|
] = None,
|
|
889
|
-
dot: Optional[
|
|
890
|
-
|
|
889
|
+
dot: Optional[
|
|
890
|
+
Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]]
|
|
891
|
+
] = None,
|
|
892
|
+
active_dot: Optional[
|
|
893
|
+
Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]]
|
|
894
|
+
] = None,
|
|
891
895
|
label: Optional[Union[Var[bool], bool]] = None,
|
|
892
896
|
stack_id: Optional[Union[Var[Union[int, str]], str, int]] = None,
|
|
893
897
|
unit: Optional[Union[Var[Union[int, str]], str, int]] = None,
|
|
@@ -994,8 +998,8 @@ class Area(Cartesian):
|
|
|
994
998
|
stroke_width: The width of the line stroke.
|
|
995
999
|
fill: The color of the area fill.
|
|
996
1000
|
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' |
|
|
997
|
-
dot: If set
|
|
998
|
-
active_dot: The dot is shown when
|
|
1001
|
+
dot: If false set, dots will not be drawn. If true set, dots will be drawn which have the props calculated internally.
|
|
1002
|
+
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.
|
|
999
1003
|
label: If set false, labels will not be drawn. If set true, labels will be drawn which have the props calculated internally.
|
|
1000
1004
|
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.
|
|
1001
1005
|
unit: The unit of data. This option will be used in tooltip.
|
|
@@ -1228,9 +1232,13 @@ class Line(Cartesian):
|
|
|
1228
1232
|
]
|
|
1229
1233
|
] = None,
|
|
1230
1234
|
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
1231
|
-
|
|
1232
|
-
dot: Optional[
|
|
1233
|
-
|
|
1235
|
+
stroke_width: Optional[Union[Var[int], int]] = None,
|
|
1236
|
+
dot: Optional[
|
|
1237
|
+
Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]]
|
|
1238
|
+
] = None,
|
|
1239
|
+
active_dot: Optional[
|
|
1240
|
+
Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]]
|
|
1241
|
+
] = None,
|
|
1234
1242
|
label: Optional[Union[Var[bool], bool]] = None,
|
|
1235
1243
|
hide: Optional[Union[Var[bool], bool]] = None,
|
|
1236
1244
|
connect_nulls: Optional[Union[Var[bool], bool]] = None,
|
|
@@ -1336,9 +1344,9 @@ class Line(Cartesian):
|
|
|
1336
1344
|
*children: The children of the component.
|
|
1337
1345
|
type_: The interpolation type of line. And customized interpolation function can be set to type. It's the same as type in Area.
|
|
1338
1346
|
stroke: The color of the line stroke.
|
|
1339
|
-
|
|
1340
|
-
dot: If set
|
|
1341
|
-
active_dot: The dot is shown when
|
|
1347
|
+
stroke_width: The width of the line stroke.
|
|
1348
|
+
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.
|
|
1349
|
+
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.
|
|
1342
1350
|
label: If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally.
|
|
1343
1351
|
hide: Hides the line when true, useful when toggling visibility state via legend.
|
|
1344
1352
|
connect_nulls: Whether to connect a graph line across null points.
|
|
@@ -1571,6 +1579,7 @@ class Funnel(Recharts):
|
|
|
1571
1579
|
Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"],
|
|
1572
1580
|
]
|
|
1573
1581
|
] = None,
|
|
1582
|
+
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
1574
1583
|
style: Optional[Style] = None,
|
|
1575
1584
|
key: Optional[Any] = None,
|
|
1576
1585
|
id: Optional[Any] = None,
|
|
@@ -1642,6 +1651,7 @@ class Funnel(Recharts):
|
|
|
1642
1651
|
animation_begin: Specifies when the animation should begin, the unit of this option is ms.
|
|
1643
1652
|
animation_duration: Specifies the duration of animation, the unit of this option is ms.
|
|
1644
1653
|
animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'
|
|
1654
|
+
stroke: stroke color
|
|
1645
1655
|
style: The style of the component.
|
|
1646
1656
|
key: A unique key for the component.
|
|
1647
1657
|
id: The id for the component.
|
|
@@ -2240,6 +2250,7 @@ class CartesianGrid(Grid):
|
|
|
2240
2250
|
fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
2241
2251
|
fill_opacity: Optional[Union[Var[float], float]] = None,
|
|
2242
2252
|
stroke_dasharray: Optional[Union[Var[str], str]] = None,
|
|
2253
|
+
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
2243
2254
|
x: Optional[Union[Var[int], int]] = None,
|
|
2244
2255
|
y: Optional[Union[Var[int], int]] = None,
|
|
2245
2256
|
width: Optional[Union[Var[int], int]] = None,
|
|
@@ -2308,6 +2319,7 @@ class CartesianGrid(Grid):
|
|
|
2308
2319
|
fill: The background of grid.
|
|
2309
2320
|
fill_opacity: The opacity of the background used to fill the space between grid lines
|
|
2310
2321
|
stroke_dasharray: The pattern of dashes and gaps used to paint the lines of the grid
|
|
2322
|
+
stroke: the stroke color of grid
|
|
2311
2323
|
x: The x-coordinate of grid.
|
|
2312
2324
|
y: The y-coordinate of grid.
|
|
2313
2325
|
width: The width of grid.
|
|
@@ -7,6 +7,7 @@ from typing import Any, Dict, List, Union
|
|
|
7
7
|
from reflex.components.component import Component
|
|
8
8
|
from reflex.components.recharts.general import ResponsiveContainer
|
|
9
9
|
from reflex.constants import EventTriggers
|
|
10
|
+
from reflex.constants.colors import Color
|
|
10
11
|
from reflex.event import EventHandler
|
|
11
12
|
from reflex.vars import Var
|
|
12
13
|
|
|
@@ -442,6 +443,9 @@ class FunnelChart(ChartBase):
|
|
|
442
443
|
# The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
|
|
443
444
|
margin: Var[Dict[str, Any]]
|
|
444
445
|
|
|
446
|
+
# The stroke color of each bar. String | Object
|
|
447
|
+
stroke: Var[Union[str, Color]]
|
|
448
|
+
|
|
445
449
|
# Valid children components
|
|
446
450
|
_valid_children: List[str] = ["Legend", "GraphingTooltip", "Funnel"]
|
|
447
451
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
# ------------------------------------------------------
|
|
6
6
|
from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload
|
|
7
7
|
|
|
8
|
+
from reflex.constants.colors import Color
|
|
8
9
|
from reflex.event import EventHandler, EventSpec
|
|
9
10
|
from reflex.style import Style
|
|
10
11
|
from reflex.vars import BaseVar, Var
|
|
@@ -962,6 +963,7 @@ class FunnelChart(ChartBase):
|
|
|
962
963
|
*children,
|
|
963
964
|
layout: Optional[Union[Var[str], str]] = None,
|
|
964
965
|
margin: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
966
|
+
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
965
967
|
width: Optional[Union[Var[Union[int, str]], str, int]] = None,
|
|
966
968
|
height: Optional[Union[Var[Union[int, str]], str, int]] = None,
|
|
967
969
|
style: Optional[Style] = None,
|
|
@@ -1023,6 +1025,7 @@ class FunnelChart(ChartBase):
|
|
|
1023
1025
|
*children: The children of the chart component.
|
|
1024
1026
|
layout: The layout of bars in the chart. centeric
|
|
1025
1027
|
margin: The sizes of whitespace around the chart, i.e. {"top": 50, "right": 30, "left": 20, "bottom": 5}.
|
|
1028
|
+
stroke: The stroke color of each bar. String | Object
|
|
1026
1029
|
width: The width of chart container. String or Integer
|
|
1027
1030
|
height: The height of chart container.
|
|
1028
1031
|
style: The style of the component.
|
|
@@ -139,22 +139,36 @@ class GraphingTooltip(Recharts):
|
|
|
139
139
|
filter_null: Var[bool]
|
|
140
140
|
|
|
141
141
|
# If set false, no cursor will be drawn when tooltip is active.
|
|
142
|
-
cursor: Var[bool]
|
|
142
|
+
cursor: Var[Union[Dict[str, Any], bool]] = Var.create_safe(
|
|
143
|
+
{
|
|
144
|
+
"strokeWidth": 1,
|
|
145
|
+
"fill": Color("gray", 3),
|
|
146
|
+
}
|
|
147
|
+
)
|
|
143
148
|
|
|
144
149
|
# The box of viewing area, which has the shape of {x: someVal, y: someVal, width: someVal, height: someVal}, usually calculated internally.
|
|
145
150
|
view_box: Var[Dict[str, Any]]
|
|
146
151
|
|
|
147
152
|
# The style of default tooltip content item which is a li element. DEFAULT: {}
|
|
148
|
-
item_style: Var[Dict[str, Any]]
|
|
153
|
+
item_style: Var[Dict[str, Any]] = Var.create_safe(
|
|
154
|
+
{
|
|
155
|
+
"color": Color("gray", 12),
|
|
156
|
+
}
|
|
157
|
+
)
|
|
149
158
|
|
|
150
159
|
# The style of tooltip wrapper which is a dom element. DEFAULT: {}
|
|
151
160
|
wrapper_style: Var[Dict[str, Any]]
|
|
152
|
-
|
|
153
161
|
# The style of tooltip content which is a dom element. DEFAULT: {}
|
|
154
|
-
content_style: Var[Dict[str, Any]]
|
|
162
|
+
content_style: Var[Dict[str, Any]] = Var.create_safe(
|
|
163
|
+
{
|
|
164
|
+
"background": Color("gray", 1),
|
|
165
|
+
"borderColor": Color("gray", 4),
|
|
166
|
+
"borderRadius": "8px",
|
|
167
|
+
}
|
|
168
|
+
)
|
|
155
169
|
|
|
156
170
|
# The style of default tooltip label which is a p element. DEFAULT: {}
|
|
157
|
-
label_style: Var[Dict[str, Any]]
|
|
171
|
+
label_style: Var[Dict[str, Any]] = Var.create_safe({"color": Color("gray", 11)})
|
|
158
172
|
|
|
159
173
|
# This option allows the tooltip to extend beyond the viewBox of the chart itself. DEFAULT: { x: false, y: false }
|
|
160
174
|
allow_escape_view_box: Var[Dict[str, bool]] = Var.create_safe(
|
|
@@ -216,11 +230,11 @@ class LabelList(Recharts):
|
|
|
216
230
|
# The offset to the specified "position"
|
|
217
231
|
offset: Var[int]
|
|
218
232
|
|
|
219
|
-
# The color of
|
|
220
|
-
|
|
233
|
+
# The fill color of each label
|
|
234
|
+
fill: Var[Union[str, Color]] = Var.create_safe(Color("gray", 10))
|
|
221
235
|
|
|
222
|
-
# The
|
|
223
|
-
|
|
236
|
+
# The stroke color of each label
|
|
237
|
+
stroke: Var[Union[str, Color]] = Var.create_safe("none", _var_is_string=True)
|
|
224
238
|
|
|
225
239
|
|
|
226
240
|
responsive_container = ResponsiveContainer.create
|
|
@@ -252,7 +252,9 @@ class GraphingTooltip(Recharts):
|
|
|
252
252
|
separator: Optional[Union[Var[str], str]] = None,
|
|
253
253
|
offset: Optional[Union[Var[int], int]] = None,
|
|
254
254
|
filter_null: Optional[Union[Var[bool], bool]] = None,
|
|
255
|
-
cursor: Optional[
|
|
255
|
+
cursor: Optional[
|
|
256
|
+
Union[Var[Union[Dict[str, Any], bool]], Dict[str, Any], bool]
|
|
257
|
+
] = None,
|
|
256
258
|
view_box: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
257
259
|
item_style: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
258
260
|
wrapper_style: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
@@ -541,8 +543,8 @@ class LabelList(Recharts):
|
|
|
541
543
|
]
|
|
542
544
|
] = None,
|
|
543
545
|
offset: Optional[Union[Var[int], int]] = None,
|
|
544
|
-
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
545
546
|
fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
547
|
+
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
546
548
|
style: Optional[Style] = None,
|
|
547
549
|
key: Optional[Any] = None,
|
|
548
550
|
id: Optional[Any] = None,
|
|
@@ -603,8 +605,8 @@ class LabelList(Recharts):
|
|
|
603
605
|
data_key: The key of a group of label values in data.
|
|
604
606
|
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"
|
|
605
607
|
offset: The offset to the specified "position"
|
|
606
|
-
|
|
607
|
-
|
|
608
|
+
fill: The fill color of each label
|
|
609
|
+
stroke: The stroke color of each label
|
|
608
610
|
style: The style of the component.
|
|
609
611
|
key: A unique key for the component.
|
|
610
612
|
id: The id for the component.
|
|
@@ -5,6 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import Any, Dict, List, Union
|
|
6
6
|
|
|
7
7
|
from reflex.constants import EventTriggers
|
|
8
|
+
from reflex.constants.colors import Color
|
|
8
9
|
from reflex.event import EventHandler
|
|
9
10
|
from reflex.vars import Var
|
|
10
11
|
|
|
@@ -70,11 +71,11 @@ class Pie(Recharts):
|
|
|
70
71
|
# Valid children components
|
|
71
72
|
_valid_children: List[str] = ["Cell", "LabelList"]
|
|
72
73
|
|
|
73
|
-
#
|
|
74
|
-
|
|
74
|
+
# Stoke color
|
|
75
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("accent", 9))
|
|
75
76
|
|
|
76
|
-
#
|
|
77
|
-
|
|
77
|
+
# Fill color
|
|
78
|
+
fill: Var[Union[str, Color]] = Var.create_safe(Color("accent", 3))
|
|
78
79
|
|
|
79
80
|
def get_event_triggers(self) -> dict[str, Union[Var, Any]]:
|
|
80
81
|
"""Get the event triggers that pass the component's value to the handler.
|
|
@@ -109,13 +110,13 @@ class Radar(Recharts):
|
|
|
109
110
|
dot: Var[bool]
|
|
110
111
|
|
|
111
112
|
# Stoke color
|
|
112
|
-
stroke: Var[str]
|
|
113
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("accent", 9))
|
|
113
114
|
|
|
114
115
|
# Fill color
|
|
115
|
-
fill: Var[str]
|
|
116
|
+
fill: Var[str] = Var.create_safe(Color("accent", 3))
|
|
116
117
|
|
|
117
118
|
# opacity
|
|
118
|
-
fill_opacity: Var[float]
|
|
119
|
+
fill_opacity: Var[float] = Var.create_safe(0.6)
|
|
119
120
|
|
|
120
121
|
# The type of icon in legend. If set to 'none', no legend item will be rendered.
|
|
121
122
|
legend_type: Var[str]
|
|
@@ -156,10 +157,22 @@ class RadialBar(Recharts):
|
|
|
156
157
|
label: Var[Union[bool, Dict[str, Any]]]
|
|
157
158
|
|
|
158
159
|
# If false set, background sector will not be drawn.
|
|
159
|
-
background: Var[bool]
|
|
160
|
+
background: Var[Union[bool, Dict[str, Any]]]
|
|
161
|
+
|
|
162
|
+
# If set false, animation of radial bars will be disabled. By default true in CSR, and false in SSR
|
|
163
|
+
is_animation_active: Var[bool]
|
|
164
|
+
|
|
165
|
+
# Specifies when the animation should begin, the unit of this option is ms. By default 0
|
|
166
|
+
animation_begin: Var[int]
|
|
167
|
+
|
|
168
|
+
# Specifies the duration of animation, the unit of this option is ms. By default 1500
|
|
169
|
+
animation_duration: Var[int]
|
|
170
|
+
|
|
171
|
+
# The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. By default 'ease'
|
|
172
|
+
animation_easing: Var[LiteralAnimationEasing]
|
|
160
173
|
|
|
161
174
|
# Valid children components
|
|
162
|
-
_valid_children: List[str] = ["LabelList"]
|
|
175
|
+
_valid_children: List[str] = ["Cell", "LabelList"]
|
|
163
176
|
|
|
164
177
|
def get_event_triggers(self) -> dict[str, Union[Var, Any]]:
|
|
165
178
|
"""Get the event triggers that pass the component's value to the handler.
|
|
@@ -174,6 +187,8 @@ class RadialBar(Recharts):
|
|
|
174
187
|
EventTriggers.ON_MOUSE_OUT: lambda: [],
|
|
175
188
|
EventTriggers.ON_MOUSE_ENTER: lambda: [],
|
|
176
189
|
EventTriggers.ON_MOUSE_LEAVE: lambda: [],
|
|
190
|
+
EventTriggers.ON_ANIMATION_START: lambda: [],
|
|
191
|
+
EventTriggers.ON_ANIMATION_END: lambda: [],
|
|
177
192
|
}
|
|
178
193
|
|
|
179
194
|
|
|
@@ -203,7 +218,7 @@ class PolarAngleAxis(Recharts):
|
|
|
203
218
|
axis_line_type: Var[str]
|
|
204
219
|
|
|
205
220
|
# 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.
|
|
206
|
-
tick_line: Var[Union[bool, Dict[str, Any]]]
|
|
221
|
+
tick_line: Var[Union[bool, Dict[str, Any]]] = Var.create_safe(False)
|
|
207
222
|
|
|
208
223
|
# The width or height of tick.
|
|
209
224
|
tick: Var[Union[int, str]]
|
|
@@ -214,6 +229,9 @@ class PolarAngleAxis(Recharts):
|
|
|
214
229
|
# The orientation of axis text.
|
|
215
230
|
orient: Var[str]
|
|
216
231
|
|
|
232
|
+
# The stroke color of axis
|
|
233
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("gray", 10))
|
|
234
|
+
|
|
217
235
|
# Allow the axis has duplicated categorys or not when the type of axis is "category".
|
|
218
236
|
allow_duplicated_category: Var[bool]
|
|
219
237
|
|
|
@@ -273,6 +291,9 @@ class PolarGrid(Recharts):
|
|
|
273
291
|
# The type of polar grids. 'polygon' | 'circle'
|
|
274
292
|
grid_type: Var[LiteralGridType]
|
|
275
293
|
|
|
294
|
+
# The stroke color of grid
|
|
295
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("gray", 10))
|
|
296
|
+
|
|
276
297
|
# Valid children components
|
|
277
298
|
_valid_children: List[str] = ["RadarChart", "RadiarBarChart"]
|
|
278
299
|
|
|
@@ -321,7 +342,10 @@ class PolarRadiusAxis(Recharts):
|
|
|
321
342
|
_valid_children: List[str] = ["Label"]
|
|
322
343
|
|
|
323
344
|
# The domain of the polar radius axis, specifying the minimum and maximum values.
|
|
324
|
-
domain: List[int] = [0, 250]
|
|
345
|
+
domain: Var[List[int]] = Var.create_safe([0, 250])
|
|
346
|
+
|
|
347
|
+
# The stroke color of axis
|
|
348
|
+
stroke: Var[Union[str, Color]] = Var.create_safe(Color("gray", 10))
|
|
325
349
|
|
|
326
350
|
def get_event_triggers(self) -> dict[str, Union[Var, Any]]:
|
|
327
351
|
"""Get the event triggers that pass the component's value to the handler.
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
# ------------------------------------------------------
|
|
6
6
|
from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload
|
|
7
7
|
|
|
8
|
+
from reflex.constants.colors import Color
|
|
8
9
|
from reflex.event import EventHandler, EventSpec
|
|
9
10
|
from reflex.style import Style
|
|
10
11
|
from reflex.vars import BaseVar, Var
|
|
@@ -65,8 +66,8 @@ class Pie(Recharts):
|
|
|
65
66
|
] = None,
|
|
66
67
|
label: Optional[Union[Var[bool], bool]] = None,
|
|
67
68
|
label_line: Optional[Union[Var[bool], bool]] = None,
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
70
|
+
fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
70
71
|
style: Optional[Style] = None,
|
|
71
72
|
key: Optional[Any] = None,
|
|
72
73
|
id: Optional[Any] = None,
|
|
@@ -111,8 +112,8 @@ class Pie(Recharts):
|
|
|
111
112
|
legend_type: The type of icon in legend. If set to 'none', no legend item will be rendered.
|
|
112
113
|
label: If false set, labels will not be drawn.
|
|
113
114
|
label_line: If false set, label lines will not be drawn.
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
stroke: Stoke color
|
|
116
|
+
fill: Fill color
|
|
116
117
|
style: The style of the component.
|
|
117
118
|
key: A unique key for the component.
|
|
118
119
|
id: The id for the component.
|
|
@@ -135,7 +136,7 @@ class Radar(Recharts):
|
|
|
135
136
|
data_key: Optional[Union[Var[Union[int, str]], str, int]] = None,
|
|
136
137
|
points: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None,
|
|
137
138
|
dot: Optional[Union[Var[bool], bool]] = None,
|
|
138
|
-
stroke: Optional[Union[Var[str], str]] = None,
|
|
139
|
+
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
139
140
|
fill: Optional[Union[Var[str], str]] = None,
|
|
140
141
|
fill_opacity: Optional[Union[Var[float], float]] = None,
|
|
141
142
|
legend_type: Optional[Union[Var[str], str]] = None,
|
|
@@ -242,13 +243,30 @@ class RadialBar(Recharts):
|
|
|
242
243
|
label: Optional[
|
|
243
244
|
Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]]
|
|
244
245
|
] = None,
|
|
245
|
-
background: Optional[
|
|
246
|
+
background: Optional[
|
|
247
|
+
Union[Var[Union[Dict[str, Any], bool]], bool, Dict[str, Any]]
|
|
248
|
+
] = None,
|
|
249
|
+
is_animation_active: Optional[Union[Var[bool], bool]] = None,
|
|
250
|
+
animation_begin: Optional[Union[Var[int], int]] = None,
|
|
251
|
+
animation_duration: Optional[Union[Var[int], int]] = None,
|
|
252
|
+
animation_easing: Optional[
|
|
253
|
+
Union[
|
|
254
|
+
Var[Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]],
|
|
255
|
+
Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"],
|
|
256
|
+
]
|
|
257
|
+
] = None,
|
|
246
258
|
style: Optional[Style] = None,
|
|
247
259
|
key: Optional[Any] = None,
|
|
248
260
|
id: Optional[Any] = None,
|
|
249
261
|
class_name: Optional[Any] = None,
|
|
250
262
|
autofocus: Optional[bool] = None,
|
|
251
263
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
264
|
+
on_animation_end: Optional[
|
|
265
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
266
|
+
] = None,
|
|
267
|
+
on_animation_start: Optional[
|
|
268
|
+
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
269
|
+
] = None,
|
|
252
270
|
on_click: Optional[
|
|
253
271
|
Union[EventHandler, EventSpec, list, Callable, BaseVar]
|
|
254
272
|
] = None,
|
|
@@ -278,6 +296,10 @@ class RadialBar(Recharts):
|
|
|
278
296
|
legend_type: Type of legend
|
|
279
297
|
label: If false set, labels will not be drawn.
|
|
280
298
|
background: If false set, background sector will not be drawn.
|
|
299
|
+
is_animation_active: If set false, animation of radial bars will be disabled. By default true in CSR, and false in SSR
|
|
300
|
+
animation_begin: Specifies when the animation should begin, the unit of this option is ms. By default 0
|
|
301
|
+
animation_duration: Specifies the duration of animation, the unit of this option is ms. By default 1500
|
|
302
|
+
animation_easing: The type of easing function. 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'. By default 'ease'
|
|
281
303
|
style: The style of the component.
|
|
282
304
|
key: A unique key for the component.
|
|
283
305
|
id: The id for the component.
|
|
@@ -311,6 +333,7 @@ class PolarAngleAxis(Recharts):
|
|
|
311
333
|
tick: Optional[Union[Var[Union[int, str]], int, str]] = None,
|
|
312
334
|
ticks: Optional[Union[Var[List[Dict[str, Any]]], List[Dict[str, Any]]]] = None,
|
|
313
335
|
orient: Optional[Union[Var[str], str]] = None,
|
|
336
|
+
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
314
337
|
allow_duplicated_category: Optional[Union[Var[bool], bool]] = None,
|
|
315
338
|
style: Optional[Style] = None,
|
|
316
339
|
key: Optional[Any] = None,
|
|
@@ -379,6 +402,7 @@ class PolarAngleAxis(Recharts):
|
|
|
379
402
|
tick: The width or height of tick.
|
|
380
403
|
ticks: The array of every tick's value and angle.
|
|
381
404
|
orient: The orientation of axis text.
|
|
405
|
+
stroke: The stroke color of axis
|
|
382
406
|
allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category".
|
|
383
407
|
style: The style of the component.
|
|
384
408
|
key: A unique key for the component.
|
|
@@ -408,6 +432,7 @@ class PolarGrid(Recharts):
|
|
|
408
432
|
grid_type: Optional[
|
|
409
433
|
Union[Var[Literal["polygon", "circle"]], Literal["polygon", "circle"]]
|
|
410
434
|
] = None,
|
|
435
|
+
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
411
436
|
style: Optional[Style] = None,
|
|
412
437
|
key: Optional[Any] = None,
|
|
413
438
|
id: Optional[Any] = None,
|
|
@@ -472,6 +497,7 @@ class PolarGrid(Recharts):
|
|
|
472
497
|
polar_angles: The array of every line grid's angle.
|
|
473
498
|
polar_radius: The array of every line grid's radius.
|
|
474
499
|
grid_type: The type of polar grids. 'polygon' | 'circle'
|
|
500
|
+
stroke: The stroke color of grid
|
|
475
501
|
style: The style of the component.
|
|
476
502
|
key: A unique key for the component.
|
|
477
503
|
id: The id for the component.
|
|
@@ -546,7 +572,8 @@ class PolarRadiusAxis(Recharts):
|
|
|
546
572
|
],
|
|
547
573
|
]
|
|
548
574
|
] = None,
|
|
549
|
-
domain: Optional[List[int]] = None,
|
|
575
|
+
domain: Optional[Union[Var[List[int]], List[int]]] = None,
|
|
576
|
+
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
|
|
550
577
|
style: Optional[Style] = None,
|
|
551
578
|
key: Optional[Any] = None,
|
|
552
579
|
id: Optional[Any] = None,
|
|
@@ -589,6 +616,7 @@ class PolarRadiusAxis(Recharts):
|
|
|
589
616
|
tick_count: The count of ticks.
|
|
590
617
|
scale: If 'auto' set, the scale funtion is linear scale. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'
|
|
591
618
|
domain: The domain of the polar radius axis, specifying the minimum and maximum values.
|
|
619
|
+
stroke: The stroke color of axis
|
|
592
620
|
style: The style of the component.
|
|
593
621
|
key: A unique key for the component.
|
|
594
622
|
id: The id for the component.
|