Skip to content

Commit 17baaa2

Browse files
authored
feat: Update vega-lite to 5.21.0 (#3761)
1 parent 367993e commit 17baaa2

File tree

11 files changed

+200
-155
lines changed

11 files changed

+200
-155
lines changed

altair/jupyter/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import vegaEmbed from "https://esm.sh/vega-embed@6?deps=vega@5&deps=vega-lite@5.20.1";
1+
import vegaEmbed from "https://esm.sh/vega-embed@6?deps=vega@5&deps=vega-lite@5.21.0";
22
import lodashDebounce from "https://esm.sh/[email protected]/debounce";
33

44
// Note: For offline support, the import lines above are removed and the remaining script

altair/utils/schemapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,7 @@ def with_property_setters(cls: type[TSchemaBase]) -> type[TSchemaBase]:
16861686
] = {
16871687
"vega-datasets": "v2.11.0",
16881688
"vega-embed": "6",
1689-
"vega-lite": "v5.20.1",
1689+
"vega-lite": "v5.21.0",
16901690
"vegafusion": "1.6.6",
16911691
"vl-convert-python": "1.7.0",
16921692
}

altair/vegalite/v5/schema/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from altair.vegalite.v5.schema.channels import *
77
from altair.vegalite.v5.schema.core import *
88

9-
SCHEMA_VERSION = "v5.20.1"
9+
SCHEMA_VERSION = "v5.21.0"
1010

11-
SCHEMA_URL = "https://vega.github.io/schema/vega-lite/v5.20.1.json"
11+
SCHEMA_URL = "https://vega.github.io/schema/vega-lite/v5.21.0.json"
1212

1313
__all__ = [
1414
"SCHEMA_URL",

altair/vegalite/v5/schema/_config.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6627,6 +6627,11 @@ class TickConfigKwds(TypedDict, total=False):
66276627
``"middle"``, ``"bottom"``.
66286628
66296629
**Note:** Expression reference is *not* supported for range marks.
6630+
binSpacing
6631+
Offset between bars for binned field. The ideal value for this is either 0
6632+
(preferred by statisticians) or 1 (Vega-Lite default, D3 example style).
6633+
6634+
**Default value:** ``1``
66306635
blend
66316636
The color blend mode for drawing an item on its current background. Any valid `CSS
66326637
mix-blend-mode <https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode>`__
@@ -6645,6 +6650,10 @@ class TickConfigKwds(TypedDict, total=False):
66456650
<https://vega.github.io/vega-lite/docs/mark.html#style-config>`__.
66466651
* The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and
66476652
will override ``color``.
6653+
continuousBandSize
6654+
The default size of the bars on continuous scales.
6655+
6656+
**Default value:** ``5``
66486657
cornerRadius
66496658
The radius in pixels of rounded rectangles or arcs' corners.
66506659
@@ -6679,6 +6688,9 @@ class TickConfigKwds(TypedDict, total=False):
66796688
the limit parameter.
66806689
66816690
**Default value:** ``"ltr"``
6691+
discreteBandSize
6692+
The default size of the bars with discrete dimensions. If unspecified, the default
6693+
size is ``step-2``, which provides 2 pixel offset between bars.
66826694
dx
66836695
The horizontal offset, in pixels, between the text label and its anchor point. The
66846696
offset is applied after rotation by the *angle* property.
@@ -6795,6 +6807,8 @@ class TickConfigKwds(TypedDict, total=False):
67956807
lineHeight
67966808
The line height in pixels (the spacing between subsequent lines of text) for
67976809
multi-line text marks.
6810+
minBandSize
6811+
The minimum band size for bar and rectangle marks. **Default value:** ``0.25``
67986812
opacity
67996813
The overall opacity (value between [0,1]).
68006814
@@ -6974,8 +6988,10 @@ class TickConfigKwds(TypedDict, total=False):
69746988
aspect: bool
69756989
bandSize: float
69766990
baseline: TextBaseline_T
6991+
binSpacing: float
69776992
blend: Blend_T
69786993
color: ColorHex | LinearGradientKwds | RadialGradientKwds | ColorName_T
6994+
continuousBandSize: float
69796995
cornerRadius: float
69806996
cornerRadiusBottomLeft: float
69816997
cornerRadiusBottomRight: float
@@ -6984,6 +7000,7 @@ class TickConfigKwds(TypedDict, total=False):
69847000
cursor: Cursor_T
69857001
description: str
69867002
dir: TextDirection_T
7003+
discreteBandSize: float
69877004
dx: float
69887005
dy: float
69897006
ellipsis: str
@@ -7003,6 +7020,7 @@ class TickConfigKwds(TypedDict, total=False):
70037020
limit: float
70047021
lineBreak: str
70057022
lineHeight: float
7023+
minBandSize: float
70067024
opacity: float
70077025
order: bool | None
70087026
orient: Orientation_T

altair/vegalite/v5/schema/_typing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ class PaddingKwds(TypedDict, total=False):
487487
"set3",
488488
"tableau10",
489489
"tableau20",
490+
"observable10",
490491
"blues",
491492
"tealblues",
492493
"teals",
@@ -1051,6 +1052,8 @@ class PaddingKwds(TypedDict, total=False):
10511052
SelectionResolution_T: TypeAlias = Literal["global", "union", "intersect"]
10521053
SelectionType_T: TypeAlias = Literal["point", "interval"]
10531054
SingleDefUnitChannel_T: TypeAlias = Literal[
1055+
"text",
1056+
"shape",
10541057
"x",
10551058
"y",
10561059
"xOffset",
@@ -1075,9 +1078,7 @@ class PaddingKwds(TypedDict, total=False):
10751078
"strokeDash",
10761079
"size",
10771080
"angle",
1078-
"shape",
10791081
"key",
1080-
"text",
10811082
"href",
10821083
"url",
10831084
"description",

altair/vegalite/v5/schema/channels.py

Lines changed: 40 additions & 40 deletions
Large diffs are not rendered by default.

altair/vegalite/v5/schema/core.py

Lines changed: 61 additions & 39 deletions
Large diffs are not rendered by default.

altair/vegalite/v5/schema/vega-lite-schema.json

Lines changed: 71 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4428,46 +4428,37 @@
44284428
]
44294429
},
44304430
"BinnedTimeUnit": {
4431-
"anyOf": [
4432-
{
4433-
"enum": [
4434-
"binnedyear",
4435-
"binnedyearquarter",
4436-
"binnedyearquartermonth",
4437-
"binnedyearmonth",
4438-
"binnedyearmonthdate",
4439-
"binnedyearmonthdatehours",
4440-
"binnedyearmonthdatehoursminutes",
4441-
"binnedyearmonthdatehoursminutesseconds",
4442-
"binnedyearweek",
4443-
"binnedyearweekday",
4444-
"binnedyearweekdayhours",
4445-
"binnedyearweekdayhoursminutes",
4446-
"binnedyearweekdayhoursminutesseconds",
4447-
"binnedyeardayofyear"
4448-
],
4449-
"type": "string"
4450-
},
4451-
{
4452-
"enum": [
4453-
"binnedutcyear",
4454-
"binnedutcyearquarter",
4455-
"binnedutcyearquartermonth",
4456-
"binnedutcyearmonth",
4457-
"binnedutcyearmonthdate",
4458-
"binnedutcyearmonthdatehours",
4459-
"binnedutcyearmonthdatehoursminutes",
4460-
"binnedutcyearmonthdatehoursminutesseconds",
4461-
"binnedutcyearweek",
4462-
"binnedutcyearweekday",
4463-
"binnedutcyearweekdayhours",
4464-
"binnedutcyearweekdayhoursminutes",
4465-
"binnedutcyearweekdayhoursminutesseconds",
4466-
"binnedutcyeardayofyear"
4467-
],
4468-
"type": "string"
4469-
}
4470-
]
4431+
"enum": [
4432+
"binnedyear",
4433+
"binnedyearquarter",
4434+
"binnedyearquartermonth",
4435+
"binnedyearmonth",
4436+
"binnedyearmonthdate",
4437+
"binnedyearmonthdatehours",
4438+
"binnedyearmonthdatehoursminutes",
4439+
"binnedyearmonthdatehoursminutesseconds",
4440+
"binnedyearweek",
4441+
"binnedyearweekday",
4442+
"binnedyearweekdayhours",
4443+
"binnedyearweekdayhoursminutes",
4444+
"binnedyearweekdayhoursminutesseconds",
4445+
"binnedyeardayofyear",
4446+
"binnedutcyear",
4447+
"binnedutcyearquarter",
4448+
"binnedutcyearquartermonth",
4449+
"binnedutcyearmonth",
4450+
"binnedutcyearmonthdate",
4451+
"binnedutcyearmonthdatehours",
4452+
"binnedutcyearmonthdatehoursminutes",
4453+
"binnedutcyearmonthdatehoursminutesseconds",
4454+
"binnedutcyearweek",
4455+
"binnedutcyearweekday",
4456+
"binnedutcyearweekdayhours",
4457+
"binnedutcyearweekdayhoursminutes",
4458+
"binnedutcyearweekdayhoursminutesseconds",
4459+
"binnedutcyeardayofyear"
4460+
],
4461+
"type": "string"
44714462
},
44724463
"Blend": {
44734464
"enum": [
@@ -4761,7 +4752,8 @@
47614752
"set2",
47624753
"set3",
47634754
"tableau10",
4764-
"tableau20"
4755+
"tableau20",
4756+
"observable10"
47654757
],
47664758
"type": "string"
47674759
},
@@ -19238,29 +19230,9 @@
1923819230
"type": "object"
1923919231
},
1924019232
"ParseValue": {
19241-
"anyOf": [
19242-
{
19243-
"type": "null"
19244-
},
19245-
{
19246-
"type": "string"
19247-
},
19248-
{
19249-
"const": "string",
19250-
"type": "string"
19251-
},
19252-
{
19253-
"const": "boolean",
19254-
"type": "string"
19255-
},
19256-
{
19257-
"const": "date",
19258-
"type": "string"
19259-
},
19260-
{
19261-
"const": "number",
19262-
"type": "string"
19263-
}
19233+
"type": [
19234+
"string",
19235+
"null"
1926419236
]
1926519237
},
1926619238
"PivotTransform": {
@@ -27685,6 +27657,8 @@
2768527657
},
2768627658
"SingleDefUnitChannel": {
2768727659
"enum": [
27660+
"text",
27661+
"shape",
2768827662
"x",
2768927663
"y",
2769027664
"xOffset",
@@ -27709,9 +27683,7 @@
2770927683
"strokeDash",
2771027684
"size",
2771127685
"angle",
27712-
"shape",
2771327686
"key",
27714-
"text",
2771527687
"href",
2771627688
"url",
2771727689
"description"
@@ -28336,6 +28308,11 @@
2833628308
],
2833728309
"description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks."
2833828310
},
28311+
"binSpacing": {
28312+
"description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`",
28313+
"minimum": 0,
28314+
"type": "number"
28315+
},
2833928316
"blend": {
2834028317
"anyOf": [
2834128318
{
@@ -28361,6 +28338,11 @@
2836128338
],
2836228339
"description": "Default color.\n\n__Default value:__ <span style=\"color: #4682b4;\">&#9632;</span> `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`."
2836328340
},
28341+
"continuousBandSize": {
28342+
"description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`",
28343+
"minimum": 0,
28344+
"type": "number"
28345+
},
2836428346
"cornerRadius": {
2836528347
"anyOf": [
2836628348
{
@@ -28449,6 +28431,18 @@
2844928431
}
2845028432
]
2845128433
},
28434+
"discreteBandSize": {
28435+
"anyOf": [
28436+
{
28437+
"type": "number"
28438+
},
28439+
{
28440+
"$ref": "#/definitions/RelativeBandSize"
28441+
}
28442+
],
28443+
"description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.",
28444+
"minimum": 0
28445+
},
2845228446
"dx": {
2845328447
"anyOf": [
2845428448
{
@@ -28661,6 +28655,17 @@
2866128655
}
2866228656
]
2866328657
},
28658+
"minBandSize": {
28659+
"anyOf": [
28660+
{
28661+
"type": "number"
28662+
},
28663+
{
28664+
"$ref": "#/definitions/ExprRef"
28665+
}
28666+
],
28667+
"description": "The minimum band size for bar and rectangle marks. __Default value:__ `0.25`"
28668+
},
2866428669
"opacity": {
2866528670
"anyOf": [
2866628671
{

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ doc = [
104104
# Minimum/exact versions, for projects under the `vega` organization
105105
vega-datasets = "v2.11.0" # https://github.com/vega/vega-datasets
106106
vega-embed = "6" # https://github.com/vega/vega-embed
107-
vega-lite = "v5.20.1" # https://github.com/vega/vega-lite
107+
vega-lite = "v5.21.0" # https://github.com/vega/vega-lite
108108

109109
[tool.hatch.version]
110110
path = "altair/__init__.py"

tests/utils/test_schemapi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,7 @@ def id_func_chart_error_example(val) -> str:
794794
- One of \['utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds'\]
795795
- One of \['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'\]
796796
- One of \['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'\]
797-
- One of \['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear'\]
798-
- One of \['binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'\]
797+
- One of \['binnedyear', 'binnedyearquarter', 'binnedyearquartermonth', 'binnedyearmonth', 'binnedyearmonthdate', 'binnedyearmonthdatehours', 'binnedyearmonthdatehoursminutes', 'binnedyearmonthdatehoursminutesseconds', 'binnedyearweek', 'binnedyearweekday', 'binnedyearweekdayhours', 'binnedyearweekdayhoursminutes', 'binnedyearweekdayhoursminutesseconds', 'binnedyeardayofyear', 'binnedutcyear', 'binnedutcyearquarter', 'binnedutcyearquartermonth', 'binnedutcyearmonth', 'binnedutcyearmonthdate', 'binnedutcyearmonthdatehours', 'binnedutcyearmonthdatehoursminutes', 'binnedutcyearmonthdatehoursminutesseconds', 'binnedutcyearweek', 'binnedutcyearweekday', 'binnedutcyearweekdayhours', 'binnedutcyearweekdayhoursminutes', 'binnedutcyearweekdayhoursminutesseconds', 'binnedutcyeardayofyear'\]
799798
- Of type {re.escape("`Mapping[str, Any]`")}$""",
800799
),
801800
(

0 commit comments

Comments
 (0)