update graphing (#3606)

* update graphing

* fix pyi

* update graphing

rebase#

* fix pyi

* precommit fail

* fix pyi generator file

* update pyi again

* pyi

* fix pyi generator to have single line builtin check

* change dict to Dict

---------

Co-authored-by: Tom Gotsman <tomgotsman@toms-mbp.lan>
Co-authored-by: Tom Gotsman <tomgotsman@Toms-MacBook-Pro.local>
Co-authored-by: Lendemor <thomas.brandeho@gmail.com>
This commit is contained in:
Tom Gotsman 2024-07-04 05:03:47 -07:00 committed by GitHub
parent efe6954552
commit b20f3ac29a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 31 additions and 1 deletions

View File

@ -67,6 +67,9 @@ class Axis(Recharts):
# Reverse the ticks or not.
reversed: Var[bool]
# The label of axis, which appears next to the axis.
label: Var[Union[str, int, Dict[str, Any]]]
# If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function
scale: Var[LiteralScale]

View File

@ -36,6 +36,9 @@ class Axis(Recharts):
axis_line: Optional[Union[Var[bool], bool]] = None,
mirror: Optional[Union[Var[bool], bool]] = None,
reversed: Optional[Union[Var[bool], bool]] = None,
label: Optional[
Union[Var[Union[Dict[str, Any], int, str]], str, int, Dict[str, Any]]
] = None,
scale: Optional[
Union[
Var[
@ -157,6 +160,7 @@ class Axis(Recharts):
axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line.
mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside.
reversed: Reverse the ticks or not.
label: The label of axis, which appears next to the axis.
scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function
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.
@ -205,6 +209,9 @@ class XAxis(Axis):
axis_line: Optional[Union[Var[bool], bool]] = None,
mirror: Optional[Union[Var[bool], bool]] = None,
reversed: Optional[Union[Var[bool], bool]] = None,
label: Optional[
Union[Var[Union[Dict[str, Any], int, str]], str, int, Dict[str, Any]]
] = None,
scale: Optional[
Union[
Var[
@ -328,6 +335,7 @@ class XAxis(Axis):
axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line.
mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside.
reversed: Reverse the ticks or not.
label: The label of axis, which appears next to the axis.
scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function
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.
@ -375,6 +383,9 @@ class YAxis(Axis):
axis_line: Optional[Union[Var[bool], bool]] = None,
mirror: Optional[Union[Var[bool], bool]] = None,
reversed: Optional[Union[Var[bool], bool]] = None,
label: Optional[
Union[Var[Union[Dict[str, Any], int, str]], str, int, Dict[str, Any]]
] = None,
scale: Optional[
Union[
Var[
@ -497,6 +508,7 @@ class YAxis(Axis):
axis_line: If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line.
mirror: If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside.
reversed: Reverse the ticks or not.
label: The label of axis, which appears next to the axis.
scale: If 'auto' set, the scale function is decided by the type of chart, and the props type. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function
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.

View File

@ -5,6 +5,7 @@ from __future__ import annotations
from typing import Any, Dict, List, Union
from reflex.components.component import MemoizationLeaf
from reflex.constants.colors import Color
from reflex.event import EventHandler
from reflex.vars import Var
@ -215,6 +216,12 @@ class LabelList(Recharts):
# The offset to the specified "position"
offset: Var[int]
# The color of the line stroke.
stroke: Var[Union[str, Color]]
# The width of the line stroke.
fill: Var[Union[str, Color]]
responsive_container = ResponsiveContainer.create
legend = Legend.create

View File

@ -6,6 +6,7 @@
from typing import Any, Callable, Dict, Literal, Optional, Union, overload
from reflex.components.component import MemoizationLeaf
from reflex.constants.colors import Color
from reflex.event import EventHandler, EventSpec
from reflex.style import Style
from reflex.vars import BaseVar, Var
@ -540,6 +541,8 @@ class LabelList(Recharts):
]
] = None,
offset: Optional[Union[Var[int], int]] = None,
stroke: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
fill: Optional[Union[Var[Union[Color, str]], str, Color]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
@ -600,6 +603,8 @@ class LabelList(Recharts):
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"
stroke: The color of the line stroke.
fill: The width of the line stroke.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.

View File

@ -159,7 +159,10 @@ def _get_type_hint(value, type_hint_globals, is_optional=True) -> str:
]
)
if value.__name__ not in type_hint_globals:
if (
value.__module__ not in ["builtins", "__builtins__"]
and value.__name__ not in type_hint_globals
):
raise TypeError(
f"{value.__module__ + '.' + value.__name__} is not a default import, "
"add it to DEFAULT_IMPORTS in pyi_generator.py"