Skip to content

Commit

Permalink
Merge branch 'main' into shorthand-namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned authored Aug 16, 2024
2 parents daeb895 + 635a2ec commit 6570912
Show file tree
Hide file tree
Showing 9 changed files with 1,412 additions and 6,900 deletions.
8 changes: 5 additions & 3 deletions altair/vegalite/v5/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@
AggregateOp_T,
AutosizeType_T,
ColorName_T,
CompositeMark_T,
ImputeMethod_T,
LayoutAlign_T,
Mark_T,
MultiTimeUnit_T,
OneOrSeq,
ProjectionType_T,
Expand Down Expand Up @@ -3662,9 +3664,9 @@ def __init__(
self,
data: Optional[ChartDataType] = Undefined,
encoding: Optional[FacetedEncoding] = Undefined,
mark: Optional[str | AnyMark] = Undefined,
width: Optional[int | str | dict | Step] = Undefined,
height: Optional[int | str | dict | Step] = Undefined,
mark: Optional[AnyMark | Mark_T | CompositeMark_T] = Undefined,
width: Optional[int | dict | Step | Literal["container"]] = Undefined,
height: Optional[int | dict | Step | Literal["container"]] = Undefined,
**kwargs: Any,
) -> None:
# Data type hints won't match with what TopLevelUnitSpec expects
Expand Down
121 changes: 119 additions & 2 deletions altair/vegalite/v5/schema/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,23 @@
"AllSortString_T",
"AutosizeType_T",
"AxisOrient_T",
"Baseline_T",
"BinnedTimeUnit_T",
"Blend_T",
"BoxPlot_T",
"ColorName_T",
"ColorScheme_T",
"CompositeMark_T",
"Cursor_T",
"ErrorBand_T",
"ErrorBarExtent_T",
"ErrorBar_T",
"FontWeight_T",
"ImputeMethod_T",
"Interpolate_T",
"LayoutAlign_T",
"LegendOrient_T",
"LocalMultiTimeUnit_T",
"LocalSingleTimeUnit_T",
"Map",
"MarkInvalidDataMode_T",
"MarkType_T",
Expand All @@ -43,19 +48,23 @@
"SelectionType_T",
"SingleDefUnitChannel_T",
"SingleTimeUnit_T",
"SortByChannelDesc_T",
"SortByChannel_T",
"SortOrder_T",
"StackOffset_T",
"StandardType_T",
"StrokeCap_T",
"StrokeJoin_T",
"TextBaseline_T",
"TextDirection_T",
"TimeInterval_T",
"TitleAnchor_T",
"TitleFrame_T",
"TitleOrient_T",
"TypeForShape_T",
"Type_T",
"UtcMultiTimeUnit_T",
"UtcSingleTimeUnit_T",
"VegaThemes",
"WindowOnlyOp_T",
]
Expand Down Expand Up @@ -152,7 +161,6 @@ def func(
]
AutosizeType_T: TypeAlias = Literal["pad", "none", "fit", "fit-x", "fit-y"]
AxisOrient_T: TypeAlias = Literal["top", "bottom", "left", "right"]
Baseline_T: TypeAlias = Literal["top", "middle", "bottom"]
BinnedTimeUnit_T: TypeAlias = Literal[
"binnedyear",
"binnedyearquarter",
Expand Down Expand Up @@ -201,6 +209,7 @@ def func(
"color",
"luminosity",
]
BoxPlot_T: TypeAlias = Literal["boxplot"]
ColorName_T: TypeAlias = Literal[
"black",
"silver",
Expand Down Expand Up @@ -685,6 +694,7 @@ def func(
"rainbow",
"sinebow",
]
CompositeMark_T: TypeAlias = Literal["boxplot", "errorbar", "errorband"]
Cursor_T: TypeAlias = Literal[
"auto",
"default",
Expand Down Expand Up @@ -723,7 +733,9 @@ def func(
"grab",
"grabbing",
]
ErrorBand_T: TypeAlias = Literal["errorband"]
ErrorBarExtent_T: TypeAlias = Literal["ci", "iqr", "stderr", "stdev"]
ErrorBar_T: TypeAlias = Literal["errorbar"]
FontWeight_T: TypeAlias = Literal[
"normal", "bold", "lighter", "bolder", 100, 200, 300, 400, 500, 600, 700, 800, 900
]
Expand Down Expand Up @@ -757,6 +769,50 @@ def func(
"bottom-left",
"bottom-right",
]
LocalMultiTimeUnit_T: TypeAlias = Literal[
"yearquarter",
"yearquartermonth",
"yearmonth",
"yearmonthdate",
"yearmonthdatehours",
"yearmonthdatehoursminutes",
"yearmonthdatehoursminutesseconds",
"yearweek",
"yearweekday",
"yearweekdayhours",
"yearweekdayhoursminutes",
"yearweekdayhoursminutesseconds",
"yeardayofyear",
"quartermonth",
"monthdate",
"monthdatehours",
"monthdatehoursminutes",
"monthdatehoursminutesseconds",
"weekday",
"weekdayhours",
"weekdayhoursminutes",
"weekdayhoursminutesseconds",
"dayhours",
"dayhoursminutes",
"dayhoursminutesseconds",
"hoursminutes",
"hoursminutesseconds",
"minutesseconds",
"secondsmilliseconds",
]
LocalSingleTimeUnit_T: TypeAlias = Literal[
"year",
"quarter",
"month",
"week",
"day",
"dayofyear",
"date",
"hours",
"minutes",
"seconds",
"milliseconds",
]
MarkInvalidDataMode_T: TypeAlias = Literal[
"filter",
"break-paths-filter-domains",
Expand Down Expand Up @@ -982,6 +1038,20 @@ def func(
"utcseconds",
"utcmilliseconds",
]
SortByChannelDesc_T: TypeAlias = Literal[
"-x",
"-y",
"-color",
"-fill",
"-stroke",
"-strokeWidth",
"-size",
"-shape",
"-fillOpacity",
"-strokeOpacity",
"-opacity",
"-text",
]
SortByChannel_T: TypeAlias = Literal[
"x",
"y",
Expand All @@ -1001,6 +1071,9 @@ def func(
StandardType_T: TypeAlias = Literal["quantitative", "ordinal", "temporal", "nominal"]
StrokeCap_T: TypeAlias = Literal["butt", "round", "square"]
StrokeJoin_T: TypeAlias = Literal["miter", "round", "bevel"]
TextBaseline_T: TypeAlias = Literal[
"alphabetic", "top", "middle", "bottom", "line-top", "line-bottom"
]
TextDirection_T: TypeAlias = Literal["ltr", "rtl"]
TimeInterval_T: TypeAlias = Literal[
"millisecond", "second", "minute", "hour", "day", "week", "month", "year"
Expand All @@ -1010,6 +1083,50 @@ def func(
TitleOrient_T: TypeAlias = Literal["none", "left", "right", "top", "bottom"]
TypeForShape_T: TypeAlias = Literal["nominal", "ordinal", "geojson"]
Type_T: TypeAlias = Literal["quantitative", "ordinal", "temporal", "nominal", "geojson"]
UtcMultiTimeUnit_T: TypeAlias = Literal[
"utcyearquarter",
"utcyearquartermonth",
"utcyearmonth",
"utcyearmonthdate",
"utcyearmonthdatehours",
"utcyearmonthdatehoursminutes",
"utcyearmonthdatehoursminutesseconds",
"utcyearweek",
"utcyearweekday",
"utcyearweekdayhours",
"utcyearweekdayhoursminutes",
"utcyearweekdayhoursminutesseconds",
"utcyeardayofyear",
"utcquartermonth",
"utcmonthdate",
"utcmonthdatehours",
"utcmonthdatehoursminutes",
"utcmonthdatehoursminutesseconds",
"utcweekday",
"utcweekdayhours",
"utcweekdayhoursminutes",
"utcweekdayhoursminutesseconds",
"utcdayhours",
"utcdayhoursminutes",
"utcdayhoursminutesseconds",
"utchoursminutes",
"utchoursminutesseconds",
"utcminutesseconds",
"utcsecondsmilliseconds",
]
UtcSingleTimeUnit_T: TypeAlias = Literal[
"utcyear",
"utcquarter",
"utcmonth",
"utcweek",
"utcday",
"utcdayofyear",
"utcdate",
"utchours",
"utcminutes",
"utcseconds",
"utcmilliseconds",
]
WindowOnlyOp_T: TypeAlias = Literal[
"row_number",
"rank",
Expand Down
Loading

0 comments on commit 6570912

Please sign in to comment.