浏览代码

support float and str for stroke_widht prop in recharts components (#5358)

Carlos 1 天之前
父节点
当前提交
70a5922f66
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 1 1
      pyi_hashes.json
  2. 5 5
      reflex/components/recharts/cartesian.py

+ 1 - 1
pyi_hashes.json

@@ -115,7 +115,7 @@
   "reflex/components/react_player/react_player.pyi": "40db798bcb7fa40207d24f49722135ae",
   "reflex/components/react_player/video.pyi": "22d84a7f57be13ece90cb30536d76c7d",
   "reflex/components/recharts/__init__.pyi": "a52c9055e37c6ee25ded15688d45e8a5",
-  "reflex/components/recharts/cartesian.pyi": "eb44b706cdb45f4b8450ef5302a981ae",
+  "reflex/components/recharts/cartesian.pyi": "5f893a3a6b1428a463cbbc4db5aa8097",
   "reflex/components/recharts/charts.pyi": "2f0a39f9c02de83d9e2d97763b4411af",
   "reflex/components/recharts/general.pyi": "06d0e97776cc82b946fed465ab36fba4",
   "reflex/components/recharts/polar.pyi": "7c445e98c1d0c95868411173de8fe85e",

+ 5 - 5
reflex/components/recharts/cartesian.py

@@ -335,7 +335,7 @@ class Area(Cartesian):
     stroke: Var[str | Color] = LiteralVar.create(Color("accent", 9))
 
     # The width of the line stroke. Default: 1
-    stroke_width: Var[int]
+    stroke_width: Var[str | int | float]
 
     # The color of the area fill. Default: rx.color("accent", 5)
     fill: Var[str | Color] = LiteralVar.create(Color("accent", 5))
@@ -384,7 +384,7 @@ class Bar(Cartesian):
     stroke: Var[str | Color]
 
     # The width of the line stroke.
-    stroke_width: Var[int]
+    stroke_width: Var[str | int | float]
 
     # The width of the line stroke. Default: Color("accent", 9)
     fill: Var[str | Color] = LiteralVar.create(Color("accent", 9))
@@ -437,7 +437,7 @@ class Line(Cartesian):
     stroke: Var[str | Color] = LiteralVar.create(Color("accent", 9))
 
     # The width of the line stroke. Default: 1
-    stroke_width: Var[int]
+    stroke_width: Var[str | int | float]
 
     # 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[bool | dict[str, Any]] = LiteralVar.create(
@@ -645,7 +645,7 @@ class ErrorBar(Recharts):
     stroke: Var[str | Color] = LiteralVar.create(Color("gray", 8))
 
     # The stroke width of error bar. Default: 1.5
-    stroke_width: Var[int | float]
+    stroke_width: Var[str | int | float]
 
 
 class Reference(Recharts):
@@ -684,7 +684,7 @@ class ReferenceLine(Reference):
     stroke: Var[str | Color]
 
     # The width of the stroke. Default: 1
-    stroke_width: Var[str | int]
+    stroke_width: Var[str | int | float]
 
     # Valid children components
     _valid_children: ClassVar[list[str]] = ["Label"]