diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d92f5fc44a..3b9db7fabf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,4 +78,4 @@ jobs: # uri-reference check is disabled as the URIs in the Vega-Lite schema do # not conform RFC 3986. uv pip install 'jsonschema[format]' check-jsonschema --upgrade - uv run check-jsonschema --check-metaschema altair/vegalite/v5/schema/vega-lite-schema.json --disable-formats uri-reference + uv run check-jsonschema --check-metaschema altair/vegalite/v6/schema/vega-lite-schema.json --disable-formats uri-reference diff --git a/NOTES_FOR_MAINTAINERS.md b/NOTES_FOR_MAINTAINERS.md index 4f4537811e..59a6b5e465 100644 --- a/NOTES_FOR_MAINTAINERS.md +++ b/NOTES_FOR_MAINTAINERS.md @@ -4,7 +4,7 @@ The core Python API for Altair can be found in the following locations: -- ``altair/vegalite/v5/schema/`` +- ``altair/vegalite/v6/schema/`` All the files within these directories are created automatically by running the following script: @@ -81,7 +81,7 @@ The Vega-Lite version for the Python code propagates to `tools.generate_schema_w This will update all of the automatically-generated files in the ``schema`` directory for each version, but please note that it will *not* update other pieces (for example, the core of the Altair API, including methods and -doc strings within ``altair/vegalite/v5/api.py``). +doc strings within ``altair/vegalite/v6/api.py``). These additional methods have fairly good test coverage, so running the test suite should identify any inconsistencies: diff --git a/RELEASING.md b/RELEASING.md index ef6717f6f0..38372ca759 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -50,8 +50,8 @@ 12. On main, tag the release. If you work on a fork, replace `origin` with `upstream`: - git tag -a v5.0.0 -m "Version 5.0.0 release" - git push origin v5.0.0 + git tag -a v6.0.0 -m "Version 5.0.0 release" + git push origin v6.0.0 13. Create a new branch: diff --git a/altair/__init__.py b/altair/__init__.py index c2d05e4642..599306ef97 100644 --- a/altair/__init__.py +++ b/altair/__init__.py @@ -202,6 +202,7 @@ "FoldTransform", "FontStyle", "FontWeight", + "Format", "FormatConfig", "Generator", "GenericUnitSpecEncodingAnyMark", @@ -389,6 +390,7 @@ "ScaleInvalidDataShowAsValuestrokeOpacity", "ScaleInvalidDataShowAsValuestrokeWidth", "ScaleInvalidDataShowAsValuetheta", + "ScaleInvalidDataShowAsValuetime", "ScaleInvalidDataShowAsValuex", "ScaleInvalidDataShowAsValuexOffset", "ScaleInvalidDataShowAsValuey", @@ -406,6 +408,7 @@ "ScaleInvalidDataShowAsstrokeOpacity", "ScaleInvalidDataShowAsstrokeWidth", "ScaleInvalidDataShowAstheta", + "ScaleInvalidDataShowAstime", "ScaleInvalidDataShowAsx", "ScaleInvalidDataShowAsxOffset", "ScaleInvalidDataShowAsy", @@ -489,6 +492,10 @@ "ThetaValue", "TickConfig", "TickCount", + "Time", + "TimeDef", + "TimeFieldDef", + "TimeFormatSpecifier", "TimeInterval", "TimeIntervalStep", "TimeLocale", @@ -632,7 +639,7 @@ "topo_feature", "typing", "utils", - "v5", + "v6", "value", "vconcat", "vegalite", @@ -647,7 +654,7 @@ def __dir__(): from altair.vegalite import * -from altair.vegalite.v5.schema.core import Dict +from altair.vegalite.v6.schema.core import Dict from altair.jupyter import JupyterChart from altair.expr import expr from altair.utils import AltairDeprecationWarning, parse_shorthand, Undefined diff --git a/altair/_magics.py b/altair/_magics.py index 9c5b9537fd..bc8a5119cd 100644 --- a/altair/_magics.py +++ b/altair/_magics.py @@ -10,20 +10,20 @@ from IPython.core import magic_arguments from narwhals.stable.v1.dependencies import is_pandas_dataframe -from altair.vegalite import v5 as vegalite_v5 +from altair.vegalite import v6 as vegalite_v6 __all__ = ["vegalite"] RENDERERS = { "vega-lite": { - "5": vegalite_v5.VegaLite, + "6": vegalite_v6.VegaLite, }, } TRANSFORMERS = { "vega-lite": { - "5": vegalite_v5.data_transformers, + "6": vegalite_v6.data_transformers, }, } @@ -66,13 +66,13 @@ def _get_variable(name: str) -> Any: nargs="?", help="local variablename of a pandas DataFrame to be used as the dataset", ) -@magic_arguments.argument("-v", "--version", dest="version", default="v5") +@magic_arguments.argument("-v", "--version", dest="version", default="v6") @magic_arguments.argument("-j", "--json", dest="json", action="store_true") -def vegalite(line, cell) -> vegalite_v5.VegaLite: +def vegalite(line, cell) -> vegalite_v6.VegaLite: """ Cell magic for displaying vega-lite visualizations in CoLab. - %%vegalite [dataframe] [--json] [--version='v5'] + %%vegalite [dataframe] [--json] [--version='v6'] Visualize the contents of the cell using Vega-Lite, optionally specifying a pandas DataFrame object to be used as the dataset. @@ -80,7 +80,7 @@ def vegalite(line, cell) -> vegalite_v5.VegaLite: if --json is passed, then input is parsed as json rather than yaml. """ args = magic_arguments.parse_argstring(vegalite, line) - existing_versions = {"v5": "5"} + existing_versions = {"v6": "6"} version = existing_versions[args.version] assert version in RENDERERS["vega-lite"] VegaLite = RENDERERS["vega-lite"][version] diff --git a/altair/expr/__init__.py b/altair/expr/__init__.py index d91f351890..ce3bc19057 100644 --- a/altair/expr/__init__.py +++ b/altair/expr/__init__.py @@ -9,7 +9,7 @@ from typing import TYPE_CHECKING, Any from altair.expr.core import ConstExpression, FunctionExpression -from altair.vegalite.v5.schema.core import ExprRef as _ExprRef +from altair.vegalite.v6.schema.core import ExprRef as _ExprRef if sys.version_info >= (3, 12): from typing import override @@ -172,8 +172,18 @@ class expr(_ExprRef, metaclass=_ExprMeta): https://en.wikipedia.org/wiki/Continuous_uniform_distribution .. _*unit*: https://vega.github.io/vega/docs/api/time/#time-units + .. _ascending from Vega Utils: + https://vega.github.io/vega/docs/api/util/#ascending .. _JavaScript's String.replace: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace + .. _Base64: + https://developer.mozilla.org/en-US/docs/Glossary/Base64 + .. _ASCII: + https://developer.mozilla.org/en-US/docs/Glossary/ASCII + .. _Window.btoa(): + https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa + .. _Window.atob(): + https://developer.mozilla.org/en-US/docs/Web/API/Window/atob .. _d3-format specifier: https://github.com/d3/d3-format/ .. _*units*: @@ -1175,6 +1185,16 @@ def slice( """ return FunctionExpression("slice", (array, start, end)) + @classmethod + def sort(cls, array: IntoExpression, /) -> Expression: + """ + Sorts the array in natural order using `ascending from Vega Utils`_. + + .. _ascending from Vega Utils: + https://vega.github.io/vega/docs/api/util/#ascending + """ + return FunctionExpression("sort", (array,)) + @classmethod def span(cls, array: IntoExpression, /) -> Expression: """Returns the span of ``array``: the difference between the last and first elements, or *array[array.length-1] - array[0]*.""" @@ -1281,6 +1301,38 @@ def upper(cls, string: IntoExpression, /) -> Expression: """Transforms ``string`` to upper-case letters.""" return FunctionExpression("upper", (string,)) + @classmethod + def btoa(cls, string: IntoExpression, /) -> Expression: + """ + Creates a `Base64`_-encoded `ASCII`_ string. + + Same as JavaScript's `Window.alt.expr.btoa()`_. + + .. _Base64: + https://developer.mozilla.org/en-US/docs/Glossary/Base64 + .. _ASCII: + https://developer.mozilla.org/en-US/docs/Glossary/ASCII + .. _Window.alt.expr.btoa(): + https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa + """ + return FunctionExpression("btoa", (string,)) + + @classmethod + def atob(cls, string: IntoExpression, /) -> Expression: + """ + Decodes an `ASCII`_ string that was encoded with `Base64`_. + + Same as JavaScript's `Window.alt.expr.atob()`_. + + .. _ASCII: + https://developer.mozilla.org/en-US/docs/Glossary/ASCII + .. _Base64: + https://developer.mozilla.org/en-US/docs/Glossary/Base64 + .. _Window.alt.expr.atob(): + https://developer.mozilla.org/en-US/docs/Web/API/Window/atob + """ + return FunctionExpression("atob", (string,)) + @classmethod def merge( cls, object1: IntoExpression, object2: IntoExpression = None, *args: Any diff --git a/altair/expr/core.py b/altair/expr/core.py index 72f0d493cc..13ca921f13 100644 --- a/altair/expr/core.py +++ b/altair/expr/core.py @@ -7,7 +7,7 @@ from altair.utils import SchemaBase if TYPE_CHECKING: - from altair.vegalite.v5.schema._typing import Map, PrimitiveValue_T + from altair.vegalite.v6.schema._typing import Map, PrimitiveValue_T if sys.version_info >= (3, 10): from typing import TypeAlias diff --git a/altair/jupyter/js/index.js b/altair/jupyter/js/index.js index a439a8c5a1..f91c188bae 100644 --- a/altair/jupyter/js/index.js +++ b/altair/jupyter/js/index.js @@ -1,4 +1,4 @@ -import vegaEmbed from "https://esm.sh/vega-embed@7?deps=vega@5&deps=vega-lite@5.21.0"; +import vegaEmbed from "https://esm.sh/vega-embed@v7?deps=vega@6&deps=vega-lite@6.1.0"; import lodashDebounce from "https://esm.sh/lodash-es@4.17.21/debounce"; // Note: For offline support, the import lines above are removed and the remaining script diff --git a/altair/theme.py b/altair/theme.py index 1c5ac655ab..9c952b8c96 100644 --- a/altair/theme.py +++ b/altair/theme.py @@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Any from typing import overload as _overload -from altair.vegalite.v5.schema._config import ( +from altair.vegalite.v6.schema._config import ( AreaConfigKwds, AutoSizeParamsKwds, AxisConfigKwds, @@ -77,7 +77,7 @@ ViewBackgroundKwds, ViewConfigKwds, ) -from altair.vegalite.v5.theme import themes as _themes +from altair.vegalite.v6.theme import themes as _themes if TYPE_CHECKING: import sys diff --git a/altair/typing/__init__.py b/altair/typing/__init__.py index cd8cb14897..68990a89df 100644 --- a/altair/typing/__init__.py +++ b/altair/typing/__init__.py @@ -50,8 +50,8 @@ ] from altair.utils.schemapi import Optional -from altair.vegalite.v5.api import ChartType, is_chart_type -from altair.vegalite.v5.schema.channels import ( +from altair.vegalite.v6.api import ChartType, is_chart_type +from altair.vegalite.v6.schema.channels import ( ChannelAngle, ChannelColor, ChannelColumn, diff --git a/altair/utils/core.py b/altair/utils/core.py index f01306d489..16e19514bd 100644 --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -36,7 +36,7 @@ from narwhals.stable.v1.typing import IntoExpr from altair.utils._dfi_types import DataFrame as DfiDataFrame - from altair.vegalite.v5.schema._typing import StandardType_T as InferredVegaLiteType + from altair.vegalite.v6.schema._typing import StandardType_T as InferredVegaLiteType _PandasDataFrameT = TypeVar("_PandasDataFrameT", bound="pd.DataFrame") @@ -912,7 +912,7 @@ def _init_channel_to_name(): ------- mapping: dict[type[``] | type[``] | type[``], str] """ - from altair.vegalite.v5.schema import channels as ch + from altair.vegalite.v6.schema import channels as ch mixins = ch.FieldChannelMixin, ch.ValueChannelMixin, ch.DatumChannelMixin diff --git a/altair/utils/data.py b/altair/utils/data.py index 318df2db39..5efa778b0f 100644 --- a/altair/utils/data.py +++ b/altair/utils/data.py @@ -85,7 +85,7 @@ def is_data_type(obj: Any) -> TypeIs[DataType]: # ============================================================================== P = ParamSpec("P") -# NOTE: `Any` required due to the complexity of existing signatures imported in `altair.vegalite.v5.data.py` +# NOTE: `Any` required due to the complexity of existing signatures imported in `altair.vegalite.v6.data.py` R = TypeVar("R", VegaLiteDataDict, Any) DataTransformerType = Callable[Concatenate[DataType, P], R] diff --git a/altair/utils/display.py b/altair/utils/display.py index 475bd32443..3de205d745 100644 --- a/altair/utils/display.py +++ b/altair/utils/display.py @@ -182,7 +182,7 @@ def default_renderer_base( how to render the custom VegaLite MIME type listed above. """ # Local import to avoid circular ImportError - from altair.vegalite.v5.display import VEGA_MIME_TYPE, VEGALITE_MIME_TYPE + from altair.vegalite.v6.display import VEGA_MIME_TYPE, VEGALITE_MIME_TYPE assert isinstance(spec, dict) bundle: dict[str, str | dict] = {} diff --git a/altair/utils/mimebundle.py b/altair/utils/mimebundle.py index 9355d02bb1..ed4e104d91 100644 --- a/altair/utils/mimebundle.py +++ b/altair/utils/mimebundle.py @@ -218,7 +218,7 @@ def _spec_to_mimebundle_with_engine( vg = spec else: vg = vlc.vegalite_to_vega(spec, vl_version=vl_version) - return {"application/vnd.vega.v5+json": vg} + return {"application/vnd.vega.v6+json": vg} elif format == "svg": if mode == "vega": svg = vlc.vega_to_svg( diff --git a/altair/utils/save.py b/altair/utils/save.py index 0b17c8e1f9..a39387fe81 100644 --- a/altair/utils/save.py +++ b/altair/utils/save.py @@ -7,7 +7,7 @@ from altair.utils._vegafusion_data import using_vegafusion from altair.utils.deprecation import deprecated_warn -from altair.vegalite.v5.data import data_transformers +from altair.vegalite.v6.data import data_transformers from .mimebundle import spec_to_mimebundle diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index fb2b9f42ef..c53a939e76 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -488,13 +488,17 @@ def _deduplicate_by_message(errors: ValidationErrorList) -> ValidationErrorList: def _subclasses(cls: type[Any]) -> Iterator[type[Any]]: """Breadth-first sequence of all classes which inherit from cls.""" - seen = set() + seen = {cls} current_set = {cls} while current_set: - seen |= current_set - current_set = set.union(*(set(cls.__subclasses__()) for cls in current_set)) - for cls in current_set - seen: - yield cls + next_set = set() + for base in current_set: + for sub in base.__subclasses__(): + if sub not in seen: + yield sub + seen.add(sub) + next_set.add(sub) + current_set = next_set def _from_array_like(obj: Iterable[Any], /) -> list[Any]: @@ -1688,11 +1692,11 @@ def with_property_setters(cls: type[TSchemaBase]) -> type[TSchemaBase]: ], str, ] = { - "vega-datasets": "v2.11.0", - "vega-embed": "7", - "vega-lite": "v5.21.0", + "vega-datasets": "v3", + "vega-embed": "v7", + "vega-lite": "v6.1.0", "vegafusion": "1.6.6", - "vl-convert-python": "1.7.0", + "vl-convert-python": "1.8.0", } """ Version pins for non-``python`` `vega projects`_. diff --git a/altair/vegalite/__init__.py b/altair/vegalite/__init__.py index 8fa78644e2..8c84f0e6af 100644 --- a/altair/vegalite/__init__.py +++ b/altair/vegalite/__init__.py @@ -1,2 +1,2 @@ # ruff: noqa: F403 -from .v5 import * +from .v6 import * diff --git a/altair/vegalite/api.py b/altair/vegalite/api.py index 6602986fe9..f48ace7c53 100644 --- a/altair/vegalite/api.py +++ b/altair/vegalite/api.py @@ -1,2 +1,2 @@ # ruff: noqa -from .v5.api import * +from .v6.api import * diff --git a/altair/vegalite/schema.py b/altair/vegalite/schema.py index bf419522e9..f4dea9c5d1 100644 --- a/altair/vegalite/schema.py +++ b/altair/vegalite/schema.py @@ -1,4 +1,4 @@ """Altair schema wrappers.""" # ruff: noqa: F403 -from .v5.schema import * +from .v6.schema import * diff --git a/altair/vegalite/v5/__init__.py b/altair/vegalite/v6/__init__.py similarity index 97% rename from altair/vegalite/v5/__init__.py rename to altair/vegalite/v6/__init__.py index c522e82288..92ea00e99b 100644 --- a/altair/vegalite/v5/__init__.py +++ b/altair/vegalite/v6/__init__.py @@ -1,9 +1,9 @@ # ruff: noqa: F403, F405 from altair.expr.core import datum -from altair.vegalite.v5 import api, compiler, schema -from altair.vegalite.v5.api import * -from altair.vegalite.v5.compiler import vegalite_compilers -from altair.vegalite.v5.data import ( +from altair.vegalite.v6 import api, compiler, schema +from altair.vegalite.v6.api import * +from altair.vegalite.v6.compiler import vegalite_compilers +from altair.vegalite.v6.data import ( MaxRowsError, data_transformers, default_data_transformer, @@ -13,14 +13,14 @@ to_json, to_values, ) -from altair.vegalite.v5.display import ( +from altair.vegalite.v6.display import ( VEGA_VERSION, VEGAEMBED_VERSION, VEGALITE_VERSION, VegaLite, renderers, ) -from altair.vegalite.v5.schema import * +from altair.vegalite.v6.schema import * # The content of __all__ is automatically written by # tools/update_init_file.py. Do not modify directly. @@ -231,6 +231,7 @@ "FoldTransform", "FontStyle", "FontWeight", + "Format", "FormatConfig", "Generator", "GenericUnitSpecEncodingAnyMark", @@ -415,6 +416,7 @@ "ScaleInvalidDataShowAsValuestrokeOpacity", "ScaleInvalidDataShowAsValuestrokeWidth", "ScaleInvalidDataShowAsValuetheta", + "ScaleInvalidDataShowAsValuetime", "ScaleInvalidDataShowAsValuex", "ScaleInvalidDataShowAsValuexOffset", "ScaleInvalidDataShowAsValuey", @@ -432,6 +434,7 @@ "ScaleInvalidDataShowAsstrokeOpacity", "ScaleInvalidDataShowAsstrokeWidth", "ScaleInvalidDataShowAstheta", + "ScaleInvalidDataShowAstime", "ScaleInvalidDataShowAsx", "ScaleInvalidDataShowAsxOffset", "ScaleInvalidDataShowAsy", @@ -514,6 +517,10 @@ "ThetaValue", "TickConfig", "TickCount", + "Time", + "TimeDef", + "TimeFieldDef", + "TimeFormatSpecifier", "TimeInterval", "TimeIntervalStep", "TimeLocale", diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v6/api.py similarity index 100% rename from altair/vegalite/v5/api.py rename to altair/vegalite/v6/api.py diff --git a/altair/vegalite/v5/compiler.py b/altair/vegalite/v6/compiler.py similarity index 92% rename from altair/vegalite/v5/compiler.py rename to altair/vegalite/v6/compiler.py index 70ccbd3b74..d03c36765c 100644 --- a/altair/vegalite/v5/compiler.py +++ b/altair/vegalite/v6/compiler.py @@ -3,7 +3,7 @@ from altair.utils._importers import import_vl_convert from altair.utils.compiler import VegaLiteCompilerRegistry -ENTRY_POINT_GROUP: Final = "altair.vegalite.v5.vegalite_compiler" +ENTRY_POINT_GROUP: Final = "altair.vegalite.v6.vegalite_compiler" vegalite_compilers = VegaLiteCompilerRegistry(entry_point_group=ENTRY_POINT_GROUP) diff --git a/altair/vegalite/v5/data.py b/altair/vegalite/v6/data.py similarity index 91% rename from altair/vegalite/v5/data.py rename to altair/vegalite/v6/data.py index 6740c9d51d..905f5ff816 100644 --- a/altair/vegalite/v5/data.py +++ b/altair/vegalite/v6/data.py @@ -13,11 +13,11 @@ ) # ============================================================================== -# VegaLite 5 data transformers +# VegaLite 6 data transformers # ============================================================================== -ENTRY_POINT_GROUP: Final = "altair.vegalite.v5.data_transformer" +ENTRY_POINT_GROUP: Final = "altair.vegalite.v6.data_transformer" data_transformers = DataTransformerRegistry(entry_point_group=ENTRY_POINT_GROUP) diff --git a/altair/vegalite/v5/display.py b/altair/vegalite/v6/display.py similarity index 90% rename from altair/vegalite/v5/display.py rename to altair/vegalite/v6/display.py index 642a2c208d..b0947eff7d 100644 --- a/altair/vegalite/v5/display.py +++ b/altair/vegalite/v6/display.py @@ -19,25 +19,25 @@ VEGALITE_VERSION: Final = SCHEMA_VERSION.lstrip("v") -VEGA_VERSION: Final = "5" +VEGA_VERSION: Final = "6" VEGAEMBED_VERSION: Final = "7" # ============================================================================== -# VegaLite v5 renderer logic +# VegaLite v6 renderer logic # ============================================================================== -# The MIME type for Vega-Lite 5.x releases. -VEGALITE_MIME_TYPE: Final = "application/vnd.vegalite.v5+json" +# The MIME type for Vega-Lite 6.x releases. +VEGALITE_MIME_TYPE: Final = "application/vnd.vegalite.v6.json" -# The MIME type for Vega 5.x releases. -VEGA_MIME_TYPE: Final = "application/vnd.vega.v5+json" +# The MIME type for Vega 6.x releases. +VEGA_MIME_TYPE: Final = "application/vnd.vega.v6.json" # The entry point group that can be used by other packages to declare other # renderers that will be auto-detected. Explicit registration is also -# allowed by the PluginRegistry API. -ENTRY_POINT_GROUP: Final = "altair.vegalite.v5.renderer" +# allowed by the PluginRegistery API. +ENTRY_POINT_GROUP: Final = "altair.vegalite.v6.renderer" # The display message when rendering fails DEFAULT_DISPLAY: Final = f"""\ @@ -167,7 +167,7 @@ def browser_renderer( class VegaLite(Displayable): - """An IPython/Jupyter display class for rendering VegaLite 5.""" + """An IPython/Jupyter display class for rendering VegaLite 6.""" renderers = renderers schema_path = (__name__, "schema/vega-lite-schema.json") @@ -175,16 +175,16 @@ class VegaLite(Displayable): def vegalite(spec: dict, validate: bool = True) -> None: """ - Render and optionally validate a VegaLite 5 spec. + Render and optionally validate a VegaLite 6 spec. This will use the currently enabled renderer to render the spec. Parameters ---------- spec: dict - A fully compliant VegaLite 5 spec, with the data portion fully processed. + A fully compliant VegaLite 6 spec, with the data portion fully processed. validate: bool - Should the spec be validated against the VegaLite 5 schema? + Should the spec be validated against the VegaLite 6 schema? """ from IPython.display import display diff --git a/altair/vegalite/v5/schema/__init__.py b/altair/vegalite/v6/schema/__init__.py similarity index 97% rename from altair/vegalite/v5/schema/__init__.py rename to altair/vegalite/v6/schema/__init__.py index 0786b0f0d3..b8b32bb553 100644 --- a/altair/vegalite/v5/schema/__init__.py +++ b/altair/vegalite/v6/schema/__init__.py @@ -2,13 +2,13 @@ # The contents of this file are automatically written by # tools/generate_schema_wrapper.py. Do not modify directly. -from altair.vegalite.v5.schema import channels, core -from altair.vegalite.v5.schema.channels import * -from altair.vegalite.v5.schema.core import * +from altair.vegalite.v6.schema import channels, core +from altair.vegalite.v6.schema.channels import * +from altair.vegalite.v6.schema.core import * -SCHEMA_VERSION = "v5.21.0" +SCHEMA_VERSION = "v6.1.0" -SCHEMA_URL = "https://vega.github.io/schema/vega-lite/v5.21.0.json" +SCHEMA_URL = "https://vega.github.io/schema/vega-lite/v6.1.0.json" __all__ = [ "SCHEMA_URL", @@ -204,6 +204,7 @@ "FoldTransform", "FontStyle", "FontWeight", + "Format", "FormatConfig", "Generator", "GenericUnitSpecEncodingAnyMark", @@ -380,6 +381,7 @@ "ScaleInvalidDataShowAsValuestrokeOpacity", "ScaleInvalidDataShowAsValuestrokeWidth", "ScaleInvalidDataShowAsValuetheta", + "ScaleInvalidDataShowAsValuetime", "ScaleInvalidDataShowAsValuex", "ScaleInvalidDataShowAsValuexOffset", "ScaleInvalidDataShowAsValuey", @@ -397,6 +399,7 @@ "ScaleInvalidDataShowAsstrokeOpacity", "ScaleInvalidDataShowAsstrokeWidth", "ScaleInvalidDataShowAstheta", + "ScaleInvalidDataShowAstime", "ScaleInvalidDataShowAsx", "ScaleInvalidDataShowAsxOffset", "ScaleInvalidDataShowAsy", @@ -476,6 +479,10 @@ "ThetaValue", "TickConfig", "TickCount", + "Time", + "TimeDef", + "TimeFieldDef", + "TimeFormatSpecifier", "TimeInterval", "TimeIntervalStep", "TimeLocale", diff --git a/altair/vegalite/v5/schema/_config.py b/altair/vegalite/v6/schema/_config.py similarity index 97% rename from altair/vegalite/v5/schema/_config.py rename to altair/vegalite/v6/schema/_config.py index 3040906d27..6676366f88 100644 --- a/altair/vegalite/v5/schema/_config.py +++ b/altair/vegalite/v6/schema/_config.py @@ -83,6 +83,7 @@ "StyleConfigIndexKwds", "ThemeConfig", "TickConfigKwds", + "TimeFormatSpecifierKwds", "TimeIntervalStepKwds", "TimeLocaleKwds", "TitleConfigKwds", @@ -445,6 +446,8 @@ class AreaConfigKwds(TypedDict, total=False): theta2 The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time + timeUnitBandPosition Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -557,6 +560,7 @@ class AreaConfigKwds(TypedDict, total=False): text: str | Sequence[str] theta: float theta2: float + time: float timeUnitBandPosition: float timeUnitBandSize: float tooltip: str | bool | float | TooltipContentKwds | None @@ -655,16 +659,21 @@ class AxisConfigKwds(TypedDict, total=False): **Default value:** ``1`` format - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - See the `format documentation `__ - for more examples. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. + + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -988,7 +997,7 @@ class AxisConfigKwds(TypedDict, total=False): domainDashOffset: float domainOpacity: float domainWidth: float - format: str + format: str | TimeFormatSpecifierKwds formatType: str grid: bool gridCap: StrokeCap_T @@ -1418,6 +1427,8 @@ class BarConfigKwds(TypedDict, total=False): theta2 The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time + timeUnitBandPosition Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -1533,6 +1544,7 @@ class BarConfigKwds(TypedDict, total=False): text: str | Sequence[str] theta: float theta2: float + time: float timeUnitBandPosition: float timeUnitBandSize: float tooltip: str | bool | float | TooltipContentKwds | None @@ -2302,7 +2314,7 @@ class ErrorBandConfigKwds(TypedDict, total=False): extent The extent of the band. Available options include: - * ``"ci"``: Extend the band to the confidence interval of the mean. + * ``"ci"``: Extend the band to the 95% bootstrapped confidence interval of the mean. * ``"stderr"``: The size of band are set to the value of standard error, extending from the mean. * ``"stdev"``: The size of band are set to the value of standard deviation, @@ -2368,7 +2380,7 @@ class ErrorBarConfigKwds(TypedDict, total=False): extent The extent of the rule. Available options include: - * ``"ci"``: Extend the rule to the confidence interval of the mean. + * ``"ci"``: Extend the rule to the 95% bootstrapped confidence interval of the mean. * ``"stderr"``: The size of rule are set to the value of standard error, extending from the mean. * ``"stdev"``: The size of rule are set to the value of standard deviation, @@ -2423,7 +2435,11 @@ class FeatureGeometryGeoJsonPropertiesKwds(TypedDict, total=False): Specifies the type of GeoJSON object. bbox Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 id A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2. @@ -2527,7 +2543,11 @@ class GeoJsonFeatureKwds(TypedDict, total=False): Specifies the type of GeoJSON object. bbox Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 id A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2. @@ -2560,7 +2580,11 @@ class GeoJsonFeatureCollectionKwds(TypedDict, total=False): Specifies the type of GeoJSON object. bbox Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ features: Sequence[FeatureGeometryGeoJsonPropertiesKwds] @@ -2580,7 +2604,11 @@ class GeometryCollectionKwds(TypedDict, total=False): Specifies the type of GeoJSON object. bbox Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ geometries: Sequence[ @@ -2619,16 +2647,21 @@ class HeaderConfigKwds(TypedDict, total=False): Parameters ---------- format - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. + + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. - See the `format documentation `__ - for more examples. + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -2753,7 +2786,7 @@ class HeaderConfigKwds(TypedDict, total=False): **Default value:** ``10`` """ - format: str + format: str | TimeFormatSpecifierKwds formatType: str labelAlign: Align_T labelAnchor: TitleAnchor_T @@ -3135,7 +3168,7 @@ class LegendConfigKwds(TypedDict, total=False): scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes). - **Default value:** ``"greedy"`` for ``log scales otherwise ``true`. + **Default value:** ``"greedy"`` for log scales otherwise ``true``. labelPadding Padding in pixels between the legend and legend labels. labelSeparation @@ -3382,6 +3415,8 @@ class LegendResolveMapKwds(TypedDict, total=False): strokeWidth + time + """ angle: ResolveMode_T @@ -3395,6 +3430,7 @@ class LegendResolveMapKwds(TypedDict, total=False): strokeDash: ResolveMode_T strokeOpacity: ResolveMode_T strokeWidth: ResolveMode_T + time: ResolveMode_T class LegendStreamBindingKwds(TypedDict, total=False): @@ -3750,6 +3786,8 @@ class LineConfigKwds(TypedDict, total=False): theta2 The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time + timeUnitBandPosition Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -3861,6 +3899,7 @@ class LineConfigKwds(TypedDict, total=False): text: str | Sequence[str] theta: float theta2: float + time: float timeUnitBandPosition: float timeUnitBandSize: float tooltip: str | bool | float | TooltipContentKwds | None @@ -3884,7 +3923,11 @@ class LineStringKwds(TypedDict, total=False): Specifies the type of GeoJSON object. bbox Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ coordinates: Sequence[Sequence[float]] @@ -4273,6 +4316,8 @@ class MarkConfigKwds(TypedDict, total=False): theta2 The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time + timeUnitBandPosition Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -4383,6 +4428,7 @@ class MarkConfigKwds(TypedDict, total=False): text: str | Sequence[str] theta: float theta2: float + time: float timeUnitBandPosition: float timeUnitBandSize: float tooltip: str | bool | float | TooltipContentKwds | None @@ -4440,7 +4486,11 @@ class MultiLineStringKwds(TypedDict, total=False): Specifies the type of GeoJSON object. bbox Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ coordinates: Sequence[Sequence[Sequence[float]]] @@ -4460,7 +4510,11 @@ class MultiPointKwds(TypedDict, total=False): Specifies the type of GeoJSON object. bbox Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ coordinates: Sequence[Sequence[float]] @@ -4480,7 +4534,11 @@ class MultiPolygonKwds(TypedDict, total=False): Specifies the type of GeoJSON object. bbox Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ coordinates: Sequence[Sequence[Sequence[Sequence[float]]]] @@ -4872,6 +4930,8 @@ class OverlayMarkDefKwds(TypedDict, total=False): Offset for theta2. thetaOffset Offset for theta. + time + timeUnitBandPosition Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -4996,6 +5056,7 @@ class OverlayMarkDefKwds(TypedDict, total=False): theta2: float theta2Offset: float thetaOffset: float + time: float timeUnitBandPosition: float timeUnitBandSize: float tooltip: str | bool | float | TooltipContentKwds | None @@ -5023,11 +5084,31 @@ class PointKwds(TypedDict, total=False): and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined. + + Note: the type will not be narrowed down to ``[number, number] | [number, number, + number]`` due to marginal benefits and the large impact of breaking change. + + See previous discussions on the type narrowing: + + * {@link https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21590 Nov 2017 } + * {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67773 Dec + 2023 } + * {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/71441 Dec + 2024 } + + One can use a {@link + https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates + user-defined type guard that returns a type predicate } to determine if a position + is a 2D or 3D position. type Specifies the type of GeoJSON object. bbox Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ coordinates: Sequence[float] @@ -5255,7 +5336,11 @@ class PolygonKwds(TypedDict, total=False): Specifies the type of GeoJSON object. bbox Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ coordinates: Sequence[Sequence[Sequence[float]]] @@ -5998,6 +6083,8 @@ class RectConfigKwds(TypedDict, total=False): theta2 The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time + timeUnitBandPosition Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -6112,6 +6199,7 @@ class RectConfigKwds(TypedDict, total=False): text: str | Sequence[str] theta: float theta2: float + time: float timeUnitBandPosition: float timeUnitBandSize: float tooltip: str | bool | float | TooltipContentKwds | None @@ -6148,6 +6236,11 @@ class ScaleConfigKwds(TypedDict, total=False): Parameters ---------- + animationDuration + Default animation duration (in seconds) for time encodings, except for `band + `__ scales. + + **Default value:** ``5`` bandPaddingInner Default inner padding for ``x`` and ``y`` band scales. @@ -6183,6 +6276,11 @@ class ScaleConfigKwds(TypedDict, total=False): **Default:** The bar width for continuous x-scale of a vertical bar and continuous y-scale of a horizontal bar.; ``0`` otherwise. + framesPerSecond + Default framerate (frames per second) for time `band + `__ scales. + + **Default value:** ``2`` invalid An object that defines scale outputs per channel for invalid values (nulls and NaNs on a continuous scale). @@ -6294,6 +6392,7 @@ class ScaleConfigKwds(TypedDict, total=False): **Default value:** ``true`` """ + animationDuration: float bandPaddingInner: float bandPaddingOuter: float bandWithNestedOffsetPaddingInner: float @@ -6301,6 +6400,7 @@ class ScaleConfigKwds(TypedDict, total=False): barBandPaddingInner: float clamp: bool continuousPadding: float + framesPerSecond: float invalid: ScaleInvalidDataConfigKwds maxBandSize: float maxFontSize: float @@ -6357,6 +6457,8 @@ class ScaleInvalidDataConfigKwds(TypedDict, total=False): theta + time + x xOffset @@ -6389,6 +6491,7 @@ class ScaleInvalidDataConfigKwds(TypedDict, total=False): strokeOpacity: Value[float] | Literal["zero-or-min"] strokeWidth: Value[float] | Literal["zero-or-min"] theta: Value[float] | Literal["zero-or-min"] + time: Value[float] | Literal["zero-or-min"] x: Literal["zero-or-min"] | Value[float | Literal["width"]] xOffset: Value[float] | Literal["zero-or-min"] y: Literal["zero-or-min"] | Value[float | Literal["height"]] @@ -6427,6 +6530,8 @@ class ScaleResolveMapKwds(TypedDict, total=False): theta + time + x xOffset @@ -6450,6 +6555,7 @@ class ScaleResolveMapKwds(TypedDict, total=False): strokeOpacity: ResolveMode_T strokeWidth: ResolveMode_T theta: ResolveMode_T + time: ResolveMode_T x: ResolveMode_T xOffset: ResolveMode_T y: ResolveMode_T @@ -6925,6 +7031,8 @@ class TickConfigKwds(TypedDict, total=False): Thickness of the tick mark. **Default value:** ``1`` + time + timeUnitBandPosition Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -7041,6 +7149,7 @@ class TickConfigKwds(TypedDict, total=False): theta: float theta2: float thickness: float + time: float timeUnitBandPosition: float timeUnitBandSize: float tooltip: str | bool | float | TooltipContentKwds | None @@ -7052,6 +7161,46 @@ class TickConfigKwds(TypedDict, total=False): y2: float | Literal["height"] +class TimeFormatSpecifierKwds(TypedDict, total=False): + """ + :class:`altair.TimeFormatSpecifier` ``TypedDict`` wrapper. + + Parameters + ---------- + date + + day + + hours + + milliseconds + + minutes + + month + + quarter + + seconds + + week + + year + + """ + + date: str + day: str + hours: str + milliseconds: str + minutes: str + month: str + quarter: str + seconds: str + week: str + year: str + + class TimeIntervalStepKwds(TypedDict, total=False): """ :class:`altair.TimeIntervalStep` ``TypedDict`` wrapper. @@ -7551,12 +7700,12 @@ class ViewConfigKwds(TypedDict, total=False): The default height when the plot has a continuous y-field for x or latitude, or has arc marks. - **Default value:** ``200`` + **Default value:** ``300`` continuousWidth The default width when the plot has a continuous field for x or longitude, or has arc marks. - **Default value:** ``200`` + **Default value:** ``300`` cornerRadius The radius in pixels of rounded rectangles or arcs' corners. diff --git a/altair/vegalite/v5/schema/_typing.py b/altair/vegalite/v6/schema/_typing.py similarity index 99% rename from altair/vegalite/v5/schema/_typing.py rename to altair/vegalite/v6/schema/_typing.py index 9fd218f5ae..da4d6a0ecb 100644 --- a/altair/vegalite/v5/schema/_typing.py +++ b/altair/vegalite/v6/schema/_typing.py @@ -1076,6 +1076,7 @@ class PaddingKwds(TypedDict, total=False): "theta2", "radius", "radius2", + "time", "color", "fill", "stroke", diff --git a/altair/vegalite/v5/schema/channels.py b/altair/vegalite/v6/schema/channels.py similarity index 97% rename from altair/vegalite/v5/schema/channels.py rename to altair/vegalite/v6/schema/channels.py index 4ec7f38c67..b53416de17 100644 --- a/altair/vegalite/v5/schema/channels.py +++ b/altair/vegalite/v6/schema/channels.py @@ -28,8 +28,8 @@ from altair import Parameter, SchemaBase from altair.typing import Optional - from altair.vegalite.v5.api import Bin, Impute, IntoCondition - from altair.vegalite.v5.schema.core import ( + from altair.vegalite.v6.api import Bin, Impute, IntoCondition + from altair.vegalite.v6.schema.core import ( Axis, DateTime, EncodingSortField, @@ -124,6 +124,7 @@ "Theta2Value", "ThetaDatum", "ThetaValue", + "Time", "Tooltip", "TooltipValue", "Url", @@ -2358,17 +2359,22 @@ class Description(FieldChannelMixin, core.StringFieldDefWithCondition): about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - See the `format documentation `__ - for more examples. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. + + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -2549,6 +2555,21 @@ def field( @overload def format(self, _: str, /) -> Description: ... @overload + def format( + self, + *, + date: Optional[str] = Undefined, + day: Optional[str] = Undefined, + hours: Optional[str] = Undefined, + milliseconds: Optional[str] = Undefined, + minutes: Optional[str] = Undefined, + month: Optional[str] = Undefined, + quarter: Optional[str] = Undefined, + seconds: Optional[str] = Undefined, + week: Optional[str] = Undefined, + year: Optional[str] = Undefined, + ) -> Description: ... + @overload def format(self, _: Map, /) -> Description: ... @overload def formatType(self, _: str, /) -> Description: ... @@ -5138,17 +5159,22 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. + + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. - See the `format documentation `__ - for more examples. + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -5323,6 +5349,21 @@ def field( @overload def format(self, _: str, /) -> Href: ... @overload + def format( + self, + *, + date: Optional[str] = Undefined, + day: Optional[str] = Undefined, + hours: Optional[str] = Undefined, + milliseconds: Optional[str] = Undefined, + minutes: Optional[str] = Undefined, + month: Optional[str] = Undefined, + quarter: Optional[str] = Undefined, + seconds: Optional[str] = Undefined, + week: Optional[str] = Undefined, + year: Optional[str] = Undefined, + ) -> Href: ... + @overload def format(self, _: Map, /) -> Href: ... @overload def formatType(self, _: str, /) -> Href: ... @@ -14551,17 +14592,22 @@ class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefTex about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - See the `format documentation `__ - for more examples. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. + + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -14736,6 +14782,21 @@ def field( @overload def format(self, _: str, /) -> Text: ... @overload + def format( + self, + *, + date: Optional[str] = Undefined, + day: Optional[str] = Undefined, + hours: Optional[str] = Undefined, + milliseconds: Optional[str] = Undefined, + minutes: Optional[str] = Undefined, + month: Optional[str] = Undefined, + quarter: Optional[str] = Undefined, + seconds: Optional[str] = Undefined, + week: Optional[str] = Undefined, + year: Optional[str] = Undefined, + ) -> Text: ... + @overload def format(self, _: Map, /) -> Text: ... @overload def formatType(self, _: str, /) -> Text: ... @@ -14813,17 +14874,22 @@ class TextDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionStringDatumD since Vega-Lite only allows at most one encoded field per encoding channel. datum : str, bool, dict, float, :class:`ExprRef`, :class:`DateTime`, :class:`RepeatRef`, :class:`PrimitiveValue`, None A constant value in data domain. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. + + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. - See the `format documentation `__ - for more examples. + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -14960,6 +15026,21 @@ def condition( @overload def format(self, _: str, /) -> TextDatum: ... @overload + def format( + self, + *, + date: Optional[str] = Undefined, + day: Optional[str] = Undefined, + hours: Optional[str] = Undefined, + milliseconds: Optional[str] = Undefined, + minutes: Optional[str] = Undefined, + month: Optional[str] = Undefined, + quarter: Optional[str] = Undefined, + seconds: Optional[str] = Undefined, + week: Optional[str] = Undefined, + year: Optional[str] = Undefined, + ) -> TextDatum: ... + @overload def format(self, _: Map, /) -> TextDatum: ... @overload def formatType(self, _: str, /) -> TextDatum: ... @@ -16046,6 +16127,392 @@ def __init__(self, value, **kwds): super().__init__(value=value, **kwds) +@with_property_setters +class Time(FieldChannelMixin, core.TimeDef): + r""" + Time schema wrapper. + + Parameters + ---------- + shorthand : str, dict, Sequence[str], :class:`RepeatRef` + shorthand for field, aggregate, and type + aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"``). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bandPosition : float + Relative position on a band of a stacked, binned, time unit, or band scale. For + example, the marks will be positioned at the beginning of the band if set to ``0``, + and at the middle of the band if set to ``0.5``. + bin : bool, dict, :class:`BinParams`, None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating + that the data for ``x`` or ``y`` channel are binned before they are imported into + Vega-Lite (``"binned"``). + + * If ``true``, default `binning parameters + `__ will be + applied. + + * If ``"binned"``, this indicates that the data for the ``x`` (or ``y``) channel are + already binned. You can map the bin-start field to ``x`` (or ``y``) and the + bin-end field to ``x2`` (or ``y2``). The scale and axis will be formatted similar + to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can + also set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : str, dict, :class:`Field`, :class:`FieldName`, :class:`RepeatRef` + **Required.** A string defining the name of the field from which to pull a data + value or an object defining iterated values from the `repeat + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots (``.``) and brackets (``[`` and ``]``) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"``). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"``). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + rescale : bool + + scale : dict, :class:`Scale`, None + An object defining properties of the channel's scale, which is the function that + transforms values in the data domain (numbers, dates, strings, etc) to visual values + (pixels, colors, sizes) of the encoding channels. + + If ``null``, the scale will be `disabled and the data value will be directly encoded + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : dict, :class:`Sort`, Sequence[str], Sequence[bool], Sequence[float], :class:`SortArray`, :class:`SortOrder`, :class:`AllSortString`, :class:`SortByChannel`, :class:`SortByEncoding`, :class:`EncodingSortField`, :class:`SortByChannelDesc`, Sequence[dict, :class:`DateTime`], Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text', 'ascending', 'descending', 'x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], None + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + JavaScript. + * `A string indicating an encoding channel name to sort by + `__ (e.g., + ``"x"`` or ``"y"``) with an optional minus prefix for descending sort (e.g., + ``"-x"`` to sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For + example, ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects + `__. In addition, for time + units ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"``). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : dict, :class:`TimeUnit`, :class:`MultiTimeUnit`, :class:`BinnedTimeUnit`, :class:`SingleTimeUnit`, :class:`TimeUnitParams`, :class:`UtcMultiTimeUnit`, :class:`UtcSingleTimeUnit`, :class:`LocalMultiTimeUnit`, :class:`LocalSingleTimeUnit`, Literal['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', 'utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds', 'year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds', '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', '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'] + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours``) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : str, :class:`Text`, Sequence[str], None + A title for the field. If ``null``, the title will be removed. + + **Default value:** derived from the field's name and transformation function + (``aggregate``, ``bin`` and ``timeUnit``). If the field has an aggregate function, + the function is displayed as part of the title (e.g., ``"Sum of Profit"``). If the + field is binned or has a time unit applied, the applied function is shown in + parentheses (e.g., ``"Profit (binned)"``, ``"Transaction Date (year-month)"``). + Otherwise, the title is simply the field name. + + **Notes**: + + 1) You can customize the default field title format by providing the `fieldTitle + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] + The type of measurement (``"quantitative"``, ``"temporal"``, ``"ordinal"``, or + ``"nominal"``) for the encoded field or constant value (``datum``). It can also be a + ``"geojson"`` type for encoding `'geoshape' + `__. + + Vega-Lite automatically infers data types in many cases as discussed below. However, + type is required for a field if: (1) the field is not nominal and the field encoding + has no specified ``aggregate`` (except ``argmin`` and ``argmax``), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: + + * ``"quantitative"`` is the default type if (1) the encoded field contains ``bin`` + or ``aggregate`` except ``"argmin"`` and ``"argmax"``, (2) the encoding channel is + ``latitude`` or ``longitude`` channel or (3) if the specified scale type is `a + quantitative scale `__. + * ``"temporal"`` is the default type if (1) the encoded field contains ``timeUnit`` + or (2) the specified scale type is a time or utc scale + * ``"ordinal"`` is the default type if (1) the encoded field contains a `custom sort + order + `__, + (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding + channel is ``order``. + + 2) For a constant value in data domain (``datum``): + + * ``"quantitative"`` if the datum is a number + * ``"nominal"`` if the datum is a string + * ``"temporal"`` if the datum is `a date time object + `__ + + **Note:** + + * Data ``type`` describes the semantics of the data rather than the primitive data + types (number, string, etc.). The same primitive data type can have different + types of measurement. For example, numeric data can represent quantitative, + ordinal, or nominal data. + * Data values for a temporal field can be either a date-time string (e.g., + ``"2015-03-07 12:32:17"``, ``"17:01"``, ``"2015-03-16"``. ``"2015"``) or a + timestamp number (e.g., ``1552199579097``). + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (default, for using a temporal scale) or `"ordinal" + (for using an ordinal scale) + `__. + * When using with `aggregate + `__, the ``type`` property + refers to the post-aggregation data type. For example, we can calculate count + ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", + "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError``) do not have + ``type`` as they must have exactly the same type as their primary channels (e.g., + ``x``, ``y``). + + **See also:** `type `__ + documentation. + """ + + _class_is_valid_at_instantiation = False + _encoding_name = "time" + + @overload + def aggregate(self, _: NonArgAggregateOp_T, /) -> Time: ... + @overload + def aggregate(self, *, argmax: Optional[str | SchemaBase] = Undefined) -> Time: ... + @overload + def aggregate(self, *, argmin: Optional[str | SchemaBase] = Undefined) -> Time: ... + @overload + def bandPosition(self, _: float, /) -> Time: ... + @overload + def bin(self, _: bool | Bin | None, /) -> Time: ... + @overload + def bin( + self, + *, + anchor: Optional[float] = Undefined, + base: Optional[float] = Undefined, + binned: Optional[bool] = Undefined, + divide: Optional[Sequence[float]] = Undefined, + extent: Optional[Parameter | SchemaBase | Sequence[float] | Map] = Undefined, + maxbins: Optional[float] = Undefined, + minstep: Optional[float] = Undefined, + nice: Optional[bool] = Undefined, + step: Optional[float] = Undefined, + steps: Optional[Sequence[float]] = Undefined, + ) -> Time: ... + @overload + def field(self, _: str | RepeatRef, /) -> Time: ... + @overload + def field( + self, + *, + repeat: Optional[Literal["row", "column", "repeat", "layer"]] = Undefined, + ) -> Time: ... + @overload + def rescale(self, _: bool, /) -> Time: ... + @overload + def scale(self, _: Scale | None, /) -> Time: ... + @overload + def scale( + self, + *, + align: Optional[float | Parameter | SchemaBase | Map] = Undefined, + base: Optional[float | Parameter | SchemaBase | Map] = Undefined, + bins: Optional[SchemaBase | Sequence[float] | Map] = Undefined, + clamp: Optional[bool | Parameter | SchemaBase | Map] = Undefined, + constant: Optional[float | Parameter | SchemaBase | Map] = Undefined, + domain: Optional[ + Parameter + | SchemaBase + | Literal["unaggregated"] + | Sequence[ + str | bool | float | Temporal | Parameter | SchemaBase | Map | None + ] + | Map + ] = Undefined, + domainMax: Optional[ + float | Temporal | Parameter | SchemaBase | Map + ] = Undefined, + domainMid: Optional[float | Parameter | SchemaBase | Map] = Undefined, + domainMin: Optional[ + float | Temporal | Parameter | SchemaBase | Map + ] = Undefined, + domainRaw: Optional[Parameter | SchemaBase | Map] = Undefined, + exponent: Optional[float | Parameter | SchemaBase | Map] = Undefined, + interpolate: Optional[ + Parameter | SchemaBase | Map | ScaleInterpolateEnum_T + ] = Undefined, + nice: Optional[ + bool | float | Parameter | SchemaBase | Map | TimeInterval_T + ] = Undefined, + padding: Optional[float | Parameter | SchemaBase | Map] = Undefined, + paddingInner: Optional[float | Parameter | SchemaBase | Map] = Undefined, + paddingOuter: Optional[float | Parameter | SchemaBase | Map] = Undefined, + range: Optional[ + SchemaBase + | Sequence[str | float | Parameter | SchemaBase | Sequence[float] | Map] + | Map + | RangeEnum_T + ] = Undefined, + rangeMax: Optional[str | float | Parameter | SchemaBase | Map] = Undefined, + rangeMin: Optional[str | float | Parameter | SchemaBase | Map] = Undefined, + reverse: Optional[bool | Parameter | SchemaBase | Map] = Undefined, + round: Optional[bool | Parameter | SchemaBase | Map] = Undefined, + scheme: Optional[Parameter | SchemaBase | Map | ColorScheme_T] = Undefined, + type: Optional[SchemaBase | ScaleType_T] = Undefined, + zero: Optional[bool | Parameter | SchemaBase | Map] = Undefined, + ) -> Time: ... + @overload + def sort( + self, + _: Sequence[str] + | Sequence[bool] + | Sequence[float] + | Sequence[DateTime | Temporal] + | AllSortString_T + | None, + /, + ) -> Time: ... + @overload + def sort( + self, + *, + field: Optional[str | SchemaBase | Map] = Undefined, + op: Optional[SchemaBase | NonArgAggregateOp_T] = Undefined, + order: Optional[SchemaBase | SortOrder_T | None] = Undefined, + ) -> Time: ... + @overload + def sort( + self, + *, + encoding: Optional[SchemaBase | SortByChannel_T] = Undefined, + order: Optional[SchemaBase | SortOrder_T | None] = Undefined, + ) -> Time: ... + @overload + def timeUnit( + self, + _: TimeUnitParams | MultiTimeUnit_T | BinnedTimeUnit_T | SingleTimeUnit_T, + /, + ) -> Time: ... + @overload + def timeUnit( + self, + *, + binned: Optional[bool] = Undefined, + maxbins: Optional[float] = Undefined, + step: Optional[float] = Undefined, + unit: Optional[SchemaBase | MultiTimeUnit_T | SingleTimeUnit_T] = Undefined, + utc: Optional[bool] = Undefined, + ) -> Time: ... + @overload + def title(self, _: str | Sequence[str] | None, /) -> Time: ... + @overload + def type(self, _: StandardType_T, /) -> Time: ... + + def __init__( + self, + shorthand: Optional[str | SchemaBase | Sequence[str] | Map] = Undefined, + aggregate: Optional[SchemaBase | Map | NonArgAggregateOp_T] = Undefined, + bandPosition: Optional[float] = Undefined, + bin: Optional[bool | SchemaBase | Map | None] = Undefined, + field: Optional[str | SchemaBase | Map] = Undefined, + rescale: Optional[bool] = Undefined, + scale: Optional[SchemaBase | Map | None] = Undefined, + sort: Optional[ + SchemaBase + | Sequence[str] + | Sequence[bool] + | Sequence[float] + | Sequence[Temporal | SchemaBase | Map] + | Map + | AllSortString_T + | None + ] = Undefined, + timeUnit: Optional[ + SchemaBase | Map | MultiTimeUnit_T | BinnedTimeUnit_T | SingleTimeUnit_T + ] = Undefined, + title: Optional[str | SchemaBase | Sequence[str] | None] = Undefined, + type: Optional[SchemaBase | StandardType_T] = Undefined, + **kwds, + ): + super().__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + rescale=rescale, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) + + @with_property_setters class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): r""" @@ -16110,17 +16577,22 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - See the `format documentation `__ - for more examples. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. + + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -16301,6 +16773,21 @@ def field( @overload def format(self, _: str, /) -> Tooltip: ... @overload + def format( + self, + *, + date: Optional[str] = Undefined, + day: Optional[str] = Undefined, + hours: Optional[str] = Undefined, + milliseconds: Optional[str] = Undefined, + minutes: Optional[str] = Undefined, + month: Optional[str] = Undefined, + quarter: Optional[str] = Undefined, + seconds: Optional[str] = Undefined, + week: Optional[str] = Undefined, + year: Optional[str] = Undefined, + ) -> Tooltip: ... + @overload def format(self, _: Map, /) -> Tooltip: ... @overload def formatType(self, _: str, /) -> Tooltip: ... @@ -16553,17 +17040,22 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. + + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. - See the `format documentation `__ - for more examples. + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -16738,6 +17230,21 @@ def field( @overload def format(self, _: str, /) -> Url: ... @overload + def format( + self, + *, + date: Optional[str] = Undefined, + day: Optional[str] = Undefined, + hours: Optional[str] = Undefined, + milliseconds: Optional[str] = Undefined, + minutes: Optional[str] = Undefined, + month: Optional[str] = Undefined, + quarter: Optional[str] = Undefined, + seconds: Optional[str] = Undefined, + week: Optional[str] = Undefined, + year: Optional[str] = Undefined, + ) -> Url: ... + @overload def format(self, _: Map, /) -> Url: ... @overload def formatType(self, _: str, /) -> Url: ... @@ -21470,6 +21977,7 @@ def __init__(self, value, **kwds): ChannelText: TypeAlias = Union[str, AnyText, "IntoCondition", Map] ChannelTheta: TypeAlias = Union[str, AnyTheta, "IntoCondition", Map] ChannelTheta2: TypeAlias = Union[str, AnyTheta2, "IntoCondition", Map] +ChannelTime: TypeAlias = Union[str, Time, "IntoCondition", Map] ChannelTooltip: TypeAlias = OneOrSeq[Union[str, AnyTooltip, "IntoCondition", Map]] ChannelUrl: TypeAlias = Union[str, AnyUrl, "IntoCondition", Map] ChannelX: TypeAlias = Union[str, AnyX, "IntoCondition", Map] @@ -21518,6 +22026,7 @@ def encode( text: Optional[str | AnyText | IntoCondition | Map] = Undefined, theta: Optional[str | AnyTheta | IntoCondition | Map] = Undefined, theta2: Optional[str | AnyTheta2 | IntoCondition | Map] = Undefined, + time: Optional[str | Time | IntoCondition | Map] = Undefined, tooltip: Optional[OneOrSeq[str | AnyTooltip | IntoCondition | Map]] = Undefined, url: Optional[str | AnyUrl | IntoCondition | Map] = Undefined, x: Optional[str | AnyX | IntoCondition | Map] = Undefined, @@ -21689,6 +22198,8 @@ def encode( theta2 : str, :class:`Theta2`, Dict, :class:`Theta2Datum`, :class:`Theta2Value` The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time : str, :class:`Time`, Dict + tooltip : str, :class:`Tooltip`, Dict, List, :class:`TooltipValue` The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides `the tooltip property in the mark definition @@ -21768,6 +22279,7 @@ def encode( "text": text, "theta": theta, "theta2": theta2, + "time": time, "tooltip": tooltip, "url": url, "x": x, @@ -21951,6 +22463,8 @@ class EncodeKwds(TypedDict, total=False): theta2 The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time + tooltip The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides `the tooltip property in the mark definition @@ -22026,6 +22540,7 @@ class EncodeKwds(TypedDict, total=False): text: str | AnyText | IntoCondition | Map theta: str | AnyTheta | IntoCondition | Map theta2: str | AnyTheta2 | IntoCondition | Map + time: str | Time | IntoCondition | Map tooltip: OneOrSeq[str | AnyTooltip | IntoCondition | Map] url: str | AnyUrl | IntoCondition | Map x: str | AnyX | IntoCondition | Map diff --git a/altair/vegalite/v5/schema/core.py b/altair/vegalite/v6/schema/core.py similarity index 96% rename from altair/vegalite/v5/schema/core.py rename to altair/vegalite/v6/schema/core.py index 93fc7969d2..80b0532e69 100644 --- a/altair/vegalite/v5/schema/core.py +++ b/altair/vegalite/v6/schema/core.py @@ -20,7 +20,7 @@ from altair import Parameter from altair.typing import Optional - from altair.vegalite.v5.api import ChartDataType + from altair.vegalite.v6.api import ChartDataType from ._typing import * # noqa: F403 @@ -196,6 +196,7 @@ "FoldTransform", "FontStyle", "FontWeight", + "Format", "FormatConfig", "Generator", "GenericUnitSpecEncodingAnyMark", @@ -347,6 +348,7 @@ "ScaleInvalidDataShowAsValuestrokeOpacity", "ScaleInvalidDataShowAsValuestrokeWidth", "ScaleInvalidDataShowAsValuetheta", + "ScaleInvalidDataShowAsValuetime", "ScaleInvalidDataShowAsValuex", "ScaleInvalidDataShowAsValuexOffset", "ScaleInvalidDataShowAsValuey", @@ -364,6 +366,7 @@ "ScaleInvalidDataShowAsstrokeOpacity", "ScaleInvalidDataShowAsstrokeWidth", "ScaleInvalidDataShowAstheta", + "ScaleInvalidDataShowAstime", "ScaleInvalidDataShowAsx", "ScaleInvalidDataShowAsxOffset", "ScaleInvalidDataShowAsy", @@ -416,6 +419,9 @@ "TextDirection", "TickConfig", "TickCount", + "TimeDef", + "TimeFieldDef", + "TimeFormatSpecifier", "TimeInterval", "TimeIntervalStep", "TimeLocale", @@ -933,6 +939,8 @@ class AreaConfig(AnyMarkConfig): theta2 : dict, float, :class:`ExprRef` The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time : dict, float, :class:`ExprRef` + timeUnitBandPosition : float Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -1061,6 +1069,7 @@ def __init__( text: Optional[str | Parameter | SchemaBase | Sequence[str] | Map] = Undefined, theta: Optional[float | Parameter | SchemaBase | Map] = Undefined, theta2: Optional[float | Parameter | SchemaBase | Map] = Undefined, + time: Optional[float | Parameter | SchemaBase | Map] = Undefined, timeUnitBandPosition: Optional[float] = Undefined, timeUnitBandSize: Optional[float] = Undefined, tooltip: Optional[ @@ -1145,6 +1154,7 @@ def __init__( text=text, theta=theta, theta2=theta2, + time=time, timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, @@ -1290,17 +1300,22 @@ class Axis(VegaLiteSchema): Stroke width of axis domain line **Default value:** ``1`` - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - See the `format documentation `__ - for more examples. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. + + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -1866,17 +1881,22 @@ class AxisConfig(VegaLiteSchema): Stroke width of axis domain line **Default value:** ``1`` - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. + + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. - See the `format documentation `__ - for more examples. + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -2781,6 +2801,8 @@ class BarConfig(AnyMarkConfig): theta2 : dict, float, :class:`ExprRef` The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time : dict, float, :class:`ExprRef` + timeUnitBandPosition : float Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -2912,6 +2934,7 @@ def __init__( text: Optional[str | Parameter | SchemaBase | Sequence[str] | Map] = Undefined, theta: Optional[float | Parameter | SchemaBase | Map] = Undefined, theta2: Optional[float | Parameter | SchemaBase | Map] = Undefined, + time: Optional[float | Parameter | SchemaBase | Map] = Undefined, timeUnitBandPosition: Optional[float] = Undefined, timeUnitBandSize: Optional[float] = Undefined, tooltip: Optional[ @@ -2999,6 +3022,7 @@ def __init__( text=text, theta=theta, theta2=theta2, + time=time, timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, @@ -4200,17 +4224,22 @@ class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - See the `format documentation `__ - for more examples. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. + + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -4420,17 +4449,22 @@ class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. + + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. - See the `format documentation `__ - for more examples. + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -5584,15 +5618,6 @@ def __init__(self, *args): super().__init__(*args) -class Dict(VegaLiteSchema): - """Dict schema wrapper.""" - - _schema = {"$ref": "#/definitions/Dict"} - - def __init__(self, **kwds): - super().__init__(**kwds) - - class DictInlineDataset(VegaLiteSchema): """DictInlineDataset schema wrapper.""" @@ -5851,6 +5876,8 @@ class Encoding(VegaLiteSchema): theta2 : dict, :class:`DatumDef`, :class:`Position2Def`, :class:`PositionValueDef`, :class:`SecondaryFieldDef` The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time : dict, :class:`TimeDef` + tooltip : dict, :class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`, Sequence[dict, :class:`StringFieldDef`], None The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides `the tooltip property in the mark definition @@ -5927,6 +5954,7 @@ def __init__( text: Optional[SchemaBase | Map] = Undefined, theta: Optional[SchemaBase | Map] = Undefined, theta2: Optional[SchemaBase | Map] = Undefined, + time: Optional[SchemaBase | Map] = Undefined, tooltip: Optional[ SchemaBase | Sequence[SchemaBase | Map] | Map | None ] = Undefined, @@ -5969,6 +5997,7 @@ def __init__( text=text, theta=theta, theta2=theta2, + time=time, tooltip=tooltip, url=url, x=x, @@ -6007,7 +6036,7 @@ class ErrorBandConfig(VegaLiteSchema): extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the band. Available options include: - * ``"ci"``: Extend the band to the confidence interval of the mean. + * ``"ci"``: Extend the band to the 95% bootstrapped confidence interval of the mean. * ``"stderr"``: The size of band are set to the value of standard error, extending from the mean. * ``"stdev"``: The size of band are set to the value of standard deviation, @@ -6093,7 +6122,7 @@ class ErrorBandDef(CompositeMarkDef): extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the band. Available options include: - * ``"ci"``: Extend the band to the confidence interval of the mean. + * ``"ci"``: Extend the band to the 95% bootstrapped confidence interval of the mean. * ``"stderr"``: The size of band are set to the value of standard error, extending from the mean. * ``"stdev"``: The size of band are set to the value of standard deviation, @@ -6181,7 +6210,7 @@ class ErrorBarConfig(VegaLiteSchema): extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the rule. Available options include: - * ``"ci"``: Extend the rule to the confidence interval of the mean. + * ``"ci"``: Extend the rule to the 95% bootstrapped confidence interval of the mean. * ``"stderr"``: The size of rule are set to the value of standard error, extending from the mean. * ``"stdev"``: The size of rule are set to the value of standard deviation, @@ -6247,7 +6276,7 @@ class ErrorBarDef(CompositeMarkDef): extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the rule. Available options include: - * ``"ci"``: Extend the rule to the confidence interval of the mean. + * ``"ci"``: Extend the rule to the 95% bootstrapped confidence interval of the mean. * ``"stderr"``: The size of rule are set to the value of standard error, extending from the mean. * ``"stdev"``: The size of rule are set to the value of standard deviation, @@ -7023,6 +7052,8 @@ class FacetedEncoding(VegaLiteSchema): theta2 : dict, :class:`DatumDef`, :class:`Position2Def`, :class:`PositionValueDef`, :class:`SecondaryFieldDef` The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time : dict, :class:`TimeDef` + tooltip : dict, :class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`, Sequence[dict, :class:`StringFieldDef`], None The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides `the tooltip property in the mark definition @@ -7102,6 +7133,7 @@ def __init__( text: Optional[SchemaBase | Map] = Undefined, theta: Optional[SchemaBase | Map] = Undefined, theta2: Optional[SchemaBase | Map] = Undefined, + time: Optional[SchemaBase | Map] = Undefined, tooltip: Optional[ SchemaBase | Sequence[SchemaBase | Map] | Map | None ] = Undefined, @@ -7147,6 +7179,7 @@ def __init__( text=text, theta=theta, theta2=theta2, + time=time, tooltip=tooltip, url=url, x=x, @@ -7180,7 +7213,11 @@ class Feature(VegaLiteSchema): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 id : str, float A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2. @@ -7221,7 +7258,11 @@ class FeatureCollection(VegaLiteSchema): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ _schema = {"$ref": "#/definitions/FeatureCollection"} @@ -7253,7 +7294,11 @@ class FeatureGeometryGeoJsonProperties(VegaLiteSchema): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 id : str, float A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2. @@ -7543,17 +7588,22 @@ class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - See the `format documentation `__ - for more examples. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. + + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -7750,6 +7800,24 @@ def __init__(self, *args): super().__init__(*args) +class Format(VegaLiteSchema): + """Format schema wrapper.""" + + _schema = {"$ref": "#/definitions/Format"} + + def __init__(self, *args, **kwds): + super().__init__(*args, **kwds) + + +class Dict(Format): + """Dict schema wrapper.""" + + _schema = {"$ref": "#/definitions/Dict"} + + def __init__(self, **kwds): + super().__init__(**kwds) + + class FormatConfig(VegaLiteSchema): """ FormatConfig schema wrapper. @@ -7924,7 +7992,11 @@ class GeoJsonFeature(Fit): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 id : str, float A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2. @@ -7965,7 +8037,11 @@ class GeoJsonFeatureCollection(Fit): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ _schema = {"$ref": "#/definitions/GeoJsonFeatureCollection"} @@ -7993,7 +8069,7 @@ class Geometry(VegaLiteSchema): """ Geometry schema wrapper. - Union of geometry objects. https://tools.ietf.org/html/rfc7946#section-3 + Geometry object. https://tools.ietf.org/html/rfc7946#section-3 """ _schema = {"$ref": "#/definitions/Geometry"} @@ -8016,7 +8092,11 @@ class GeometryCollection(Geometry): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ _schema = {"$ref": "#/definitions/GeometryCollection"} @@ -8153,17 +8233,22 @@ class Header(VegaLiteSchema): Parameters ---------- - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. + + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. - See the `format documentation `__ - for more examples. + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -8399,17 +8484,22 @@ class HeaderConfig(VegaLiteSchema): Parameters ---------- - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - See the `format documentation `__ - for more examples. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. + + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -8794,7 +8884,7 @@ class IntervalSelectionConfig(VegaLiteSchema): **See also:** `clear examples `__ in the documentation. - encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['text', 'shape', 'x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'key', 'href', 'url', 'description']] + encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['text', 'shape', 'x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'time', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'key', 'href', 'url', 'description']] An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection. @@ -8915,7 +9005,7 @@ class IntervalSelectionConfigWithoutType(VegaLiteSchema): **See also:** `clear examples `__ in the documentation. - encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['text', 'shape', 'x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'key', 'href', 'url', 'description']] + encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['text', 'shape', 'x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'time', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'key', 'href', 'url', 'description']] An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection. @@ -9371,17 +9461,22 @@ class Legend(VegaLiteSchema): legends and ``"vertical"`` for symbol legends. fillColor : str, dict, :class:`Color`, :class:`ExprRef`, :class:`HexColor`, :class:`ColorName`, Literal['black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', 'orange', 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen', 'rebeccapurple'], None Background fill color for the full legend. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. + + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. - See the `format documentation `__ - for more examples. + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -9946,7 +10041,7 @@ class LegendConfig(VegaLiteSchema): scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes). - **Default value:** ``"greedy"`` for ``log scales otherwise ``true`. + **Default value:** ``"greedy"`` for log scales otherwise ``true``. labelPadding : dict, float, :class:`ExprRef` Padding in pixels between the legend and legend labels. labelSeparation : dict, float, :class:`ExprRef` @@ -10324,6 +10419,8 @@ class LegendResolveMap(VegaLiteSchema): strokeWidth : :class:`ResolveMode`, Literal['independent', 'shared'] + time : :class:`ResolveMode`, Literal['independent', 'shared'] + """ _schema = {"$ref": "#/definitions/LegendResolveMap"} @@ -10341,6 +10438,7 @@ def __init__( strokeDash: Optional[SchemaBase | ResolveMode_T] = Undefined, strokeOpacity: Optional[SchemaBase | ResolveMode_T] = Undefined, strokeWidth: Optional[SchemaBase | ResolveMode_T] = Undefined, + time: Optional[SchemaBase | ResolveMode_T] = Undefined, **kwds, ): super().__init__( @@ -10355,6 +10453,7 @@ def __init__( strokeDash=strokeDash, strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + time=time, **kwds, ) @@ -10715,6 +10814,8 @@ class LineConfig(AnyMarkConfig): theta2 : dict, float, :class:`ExprRef` The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time : dict, float, :class:`ExprRef` + timeUnitBandPosition : float Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -10842,6 +10943,7 @@ def __init__( text: Optional[str | Parameter | SchemaBase | Sequence[str] | Map] = Undefined, theta: Optional[float | Parameter | SchemaBase | Map] = Undefined, theta2: Optional[float | Parameter | SchemaBase | Map] = Undefined, + time: Optional[float | Parameter | SchemaBase | Map] = Undefined, timeUnitBandPosition: Optional[float] = Undefined, timeUnitBandSize: Optional[float] = Undefined, tooltip: Optional[ @@ -10925,6 +11027,7 @@ def __init__( text=text, theta=theta, theta2=theta2, + time=time, timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, @@ -10952,7 +11055,11 @@ class LineString(Geometry): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ _schema = {"$ref": "#/definitions/LineString"} @@ -11431,6 +11538,8 @@ class MarkConfig(AnyMarkConfig): theta2 : dict, float, :class:`ExprRef` The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time : dict, float, :class:`ExprRef` + timeUnitBandPosition : float Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -11557,6 +11666,7 @@ def __init__( text: Optional[str | Parameter | SchemaBase | Sequence[str] | Map] = Undefined, theta: Optional[float | Parameter | SchemaBase | Map] = Undefined, theta2: Optional[float | Parameter | SchemaBase | Map] = Undefined, + time: Optional[float | Parameter | SchemaBase | Map] = Undefined, timeUnitBandPosition: Optional[float] = Undefined, timeUnitBandSize: Optional[float] = Undefined, tooltip: Optional[ @@ -11639,6 +11749,7 @@ def __init__( text=text, theta=theta, theta2=theta2, + time=time, timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, @@ -12057,6 +12168,8 @@ class MarkDef(AnyMark): Thickness of the tick mark. **Default value:** ``1`` + time : dict, float, :class:`ExprRef` + timeUnitBandPosition : float Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -12210,6 +12323,7 @@ def __init__( theta2Offset: Optional[float | Parameter | SchemaBase | Map] = Undefined, thetaOffset: Optional[float | Parameter | SchemaBase | Map] = Undefined, thickness: Optional[float] = Undefined, + time: Optional[float | Parameter | SchemaBase | Map] = Undefined, timeUnitBandPosition: Optional[float] = Undefined, timeUnitBandSize: Optional[float] = Undefined, tooltip: Optional[ @@ -12310,6 +12424,7 @@ def __init__( theta2Offset=theta2Offset, thetaOffset=thetaOffset, thickness=thickness, + time=time, timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, @@ -12808,7 +12923,11 @@ class MultiLineString(Geometry): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ _schema = {"$ref": "#/definitions/MultiLineString"} @@ -12839,7 +12958,11 @@ class MultiPoint(Geometry): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ _schema = {"$ref": "#/definitions/MultiPoint"} @@ -12868,7 +12991,11 @@ class MultiPolygon(Geometry): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ _schema = {"$ref": "#/definitions/MultiPolygon"} @@ -14417,6 +14544,8 @@ class OverlayMarkDef(VegaLiteSchema): Offset for theta2. thetaOffset : dict, float, :class:`ExprRef` Offset for theta. + time : dict, float, :class:`ExprRef` + timeUnitBandPosition : float Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -14557,6 +14686,7 @@ def __init__( theta2: Optional[float | Parameter | SchemaBase | Map] = Undefined, theta2Offset: Optional[float | Parameter | SchemaBase | Map] = Undefined, thetaOffset: Optional[float | Parameter | SchemaBase | Map] = Undefined, + time: Optional[float | Parameter | SchemaBase | Map] = Undefined, timeUnitBandPosition: Optional[float] = Undefined, timeUnitBandSize: Optional[float] = Undefined, tooltip: Optional[ @@ -14649,6 +14779,7 @@ def __init__( theta2=theta2, theta2Offset=theta2Offset, thetaOffset=thetaOffset, + time=time, timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, @@ -14725,11 +14856,31 @@ class Point(Geometry): and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined. + + Note: the type will not be narrowed down to ``[number, number] | [number, number, + number]`` due to marginal benefits and the large impact of breaking change. + + See previous discussions on the type narrowing: + + * {@link https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21590 Nov 2017 } + * {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67773 Dec + 2023 } + * {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/71441 Dec + 2024 } + + One can use a {@link + https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates + user-defined type guard that returns a type predicate } to determine if a position + is a 2D or 3D position. type : Literal['Point'] Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ _schema = {"$ref": "#/definitions/Point"} @@ -14767,7 +14918,7 @@ class PointSelectionConfig(VegaLiteSchema): **See also:** `clear examples `__ in the documentation. - encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['text', 'shape', 'x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'key', 'href', 'url', 'description']] + encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['text', 'shape', 'x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'time', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'key', 'href', 'url', 'description']] An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection. @@ -14885,7 +15036,7 @@ class PointSelectionConfigWithoutType(VegaLiteSchema): **See also:** `clear examples `__ in the documentation. - encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['text', 'shape', 'x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'key', 'href', 'url', 'description']] + encodings : Sequence[:class:`SingleDefUnitChannel`, Literal['text', 'shape', 'x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'time', 'color', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'key', 'href', 'url', 'description']] An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection. @@ -15008,7 +15159,11 @@ class Polygon(Geometry): Specifies the type of GeoJSON object. bbox : :class:`BBox`, Sequence[float] Bounding box of the coordinate range of the object's Geometries, Features, or - Feature Collections. https://tools.ietf.org/html/rfc7946#section-5 + Feature Collections. The value of the bbox member is an array of length 2*n where n + is the number of dimensions represented in the contained geometries, with all axes + of the most southwesterly point followed by all axes of the more northeasterly + point. The axes order of a bbox follows the axes order of geometries. + https://tools.ietf.org/html/rfc7946#section-5 """ _schema = {"$ref": "#/definitions/Polygon"} @@ -15033,6 +15188,20 @@ class Position(VegaLiteSchema): Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined. + + Note: the type will not be narrowed down to ``[number, number] | [number, number, number]`` + due to marginal benefits and the large impact of breaking change. + + See previous discussions on the type narrowing: + + * {@link https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21590 Nov 2017 } + * {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67773 Dec 2023 } + * {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/71441 Dec 2024 } + + One can use a {@link + https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates + user-defined type guard that returns a type predicate } to determine if a position is a 2D + or 3D position. """ _schema = {"$ref": "#/definitions/Position"} @@ -17371,6 +17540,8 @@ class RectConfig(AnyMarkConfig): theta2 : dict, float, :class:`ExprRef` The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise. + time : dict, float, :class:`ExprRef` + timeUnitBandPosition : float Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -17501,6 +17672,7 @@ def __init__( text: Optional[str | Parameter | SchemaBase | Sequence[str] | Map] = Undefined, theta: Optional[float | Parameter | SchemaBase | Map] = Undefined, theta2: Optional[float | Parameter | SchemaBase | Map] = Undefined, + time: Optional[float | Parameter | SchemaBase | Map] = Undefined, timeUnitBandPosition: Optional[float] = Undefined, timeUnitBandSize: Optional[float] = Undefined, tooltip: Optional[ @@ -17587,6 +17759,7 @@ def __init__( text=text, theta=theta, theta2=theta2, + time=time, timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, @@ -18408,6 +18581,11 @@ class ScaleConfig(VegaLiteSchema): Parameters ---------- + animationDuration : float + Default animation duration (in seconds) for time encodings, except for `band + `__ scales. + + **Default value:** ``5`` bandPaddingInner : dict, float, :class:`ExprRef` Default inner padding for ``x`` and ``y`` band scales. @@ -18443,6 +18621,11 @@ class ScaleConfig(VegaLiteSchema): **Default:** The bar width for continuous x-scale of a vertical bar and continuous y-scale of a horizontal bar.; ``0`` otherwise. + framesPerSecond : float + Default framerate (frames per second) for time `band + `__ scales. + + **Default value:** ``2`` invalid : dict, :class:`ScaleInvalidDataConfig` An object that defines scale outputs per channel for invalid values (nulls and NaNs on a continuous scale). @@ -18558,6 +18741,7 @@ class ScaleConfig(VegaLiteSchema): def __init__( self, + animationDuration: Optional[float] = Undefined, bandPaddingInner: Optional[float | Parameter | SchemaBase | Map] = Undefined, bandPaddingOuter: Optional[float | Parameter | SchemaBase | Map] = Undefined, bandWithNestedOffsetPaddingInner: Optional[ @@ -18569,6 +18753,7 @@ def __init__( barBandPaddingInner: Optional[float | Parameter | SchemaBase | Map] = Undefined, clamp: Optional[bool | Parameter | SchemaBase | Map] = Undefined, continuousPadding: Optional[float | Parameter | SchemaBase | Map] = Undefined, + framesPerSecond: Optional[float] = Undefined, invalid: Optional[SchemaBase | Map] = Undefined, maxBandSize: Optional[float] = Undefined, maxFontSize: Optional[float] = Undefined, @@ -18602,6 +18787,7 @@ def __init__( **kwds, ): super().__init__( + animationDuration=animationDuration, bandPaddingInner=bandPaddingInner, bandPaddingOuter=bandPaddingOuter, bandWithNestedOffsetPaddingInner=bandWithNestedOffsetPaddingInner, @@ -18609,6 +18795,7 @@ def __init__( barBandPaddingInner=barBandPaddingInner, clamp=clamp, continuousPadding=continuousPadding, + framesPerSecond=framesPerSecond, invalid=invalid, maxBandSize=maxBandSize, maxFontSize=maxFontSize, @@ -19081,6 +19268,8 @@ class ScaleInvalidDataConfig(VegaLiteSchema): theta : dict, Literal['zero-or-min'], :class:`ScaleInvalidDataShowAstheta`, :class:`ScaleInvalidDataShowAsValuetheta` + time : dict, Literal['zero-or-min'], :class:`ScaleInvalidDataShowAstime`, :class:`ScaleInvalidDataShowAsValuetime` + x : dict, Literal['zero-or-min'], :class:`ScaleInvalidDataShowAsx`, :class:`ScaleInvalidDataShowAsValuex` xOffset : dict, Literal['zero-or-min'], :class:`ScaleInvalidDataShowAsxOffset`, :class:`ScaleInvalidDataShowAsValuexOffset` @@ -19108,6 +19297,7 @@ def __init__( strokeOpacity: Optional[SchemaBase | Literal["zero-or-min"] | Map] = Undefined, strokeWidth: Optional[SchemaBase | Literal["zero-or-min"] | Map] = Undefined, theta: Optional[SchemaBase | Literal["zero-or-min"] | Map] = Undefined, + time: Optional[SchemaBase | Literal["zero-or-min"] | Map] = Undefined, x: Optional[SchemaBase | Literal["zero-or-min"] | Map] = Undefined, xOffset: Optional[SchemaBase | Literal["zero-or-min"] | Map] = Undefined, y: Optional[SchemaBase | Literal["zero-or-min"] | Map] = Undefined, @@ -19128,6 +19318,7 @@ def __init__( strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, theta=theta, + time=time, x=x, xOffset=xOffset, y=y, @@ -19527,6 +19718,31 @@ def __init__(self, value: Optional[float] = Undefined, **kwds): super().__init__(value=value, **kwds) +class ScaleInvalidDataShowAstime(VegaLiteSchema): + """ScaleInvalidDataShowAstime schema wrapper.""" + + _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAs<"time">'} + + def __init__(self, *args, **kwds): + super().__init__(*args, **kwds) + + +class ScaleInvalidDataShowAsValuetime(ScaleInvalidDataShowAstime): + """ + ScaleInvalidDataShowAsValuetime schema wrapper. + + Parameters + ---------- + value : float + + """ + + _schema = {"$ref": '#/definitions/ScaleInvalidDataShowAsValue<"time">'} + + def __init__(self, value: Optional[float] = Undefined, **kwds): + super().__init__(value=value, **kwds) + + class ScaleInvalidDataShowAsx(VegaLiteSchema): """ScaleInvalidDataShowAsx schema wrapper.""" @@ -19667,6 +19883,8 @@ class ScaleResolveMap(VegaLiteSchema): theta : :class:`ResolveMode`, Literal['independent', 'shared'] + time : :class:`ResolveMode`, Literal['independent', 'shared'] + x : :class:`ResolveMode`, Literal['independent', 'shared'] xOffset : :class:`ResolveMode`, Literal['independent', 'shared'] @@ -19694,6 +19912,7 @@ def __init__( strokeOpacity: Optional[SchemaBase | ResolveMode_T] = Undefined, strokeWidth: Optional[SchemaBase | ResolveMode_T] = Undefined, theta: Optional[SchemaBase | ResolveMode_T] = Undefined, + time: Optional[SchemaBase | ResolveMode_T] = Undefined, x: Optional[SchemaBase | ResolveMode_T] = Undefined, xOffset: Optional[SchemaBase | ResolveMode_T] = Undefined, y: Optional[SchemaBase | ResolveMode_T] = Undefined, @@ -19714,6 +19933,7 @@ def __init__( strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, theta=theta, + time=time, x=x, xOffset=xOffset, y=y, @@ -20663,6 +20883,8 @@ class SharedEncoding(VegaLiteSchema): theta2 : dict + time : dict + tooltip : dict, :class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`, Sequence[dict, :class:`StringFieldDef`], None The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides `the tooltip property in the mark definition @@ -20723,6 +20945,7 @@ def __init__( text: Optional[Map] = Undefined, theta: Optional[Map] = Undefined, theta2: Optional[Map] = Undefined, + time: Optional[Map] = Undefined, tooltip: Optional[ SchemaBase | Sequence[SchemaBase | Map] | Map | None ] = Undefined, @@ -20765,6 +20988,7 @@ def __init__( text=text, theta=theta, theta2=theta2, + time=time, tooltip=tooltip, url=url, x=x, @@ -20834,7 +21058,7 @@ class EncodingSortField(Sort): **Default value:** ``"sum"`` for stacked plots. Otherwise, ``"min"``. order : :class:`SortOrder`, Literal['ascending', 'descending'], None - The sort order. One of ``"ascending"`` (default), ``"descending"``, or ``null`` (no + The sort order. One of ``"ascending"`` (default), ``"descending"``, or ``null`` (do not sort). """ @@ -20888,7 +21112,7 @@ class SortByEncoding(Sort): `__ to sort by (e.g., ``"x"``, ``"y"``) order : :class:`SortOrder`, Literal['ascending', 'descending'], None - The sort order. One of ``"ascending"`` (default), ``"descending"``, or ``null`` (no + The sort order. One of ``"ascending"`` (default), ``"descending"``, or ``null`` (do not sort). """ @@ -20915,7 +21139,7 @@ class SortField(VegaLiteSchema): The name of the field to sort. order : :class:`SortOrder`, Literal['ascending', 'descending'], None Whether to sort the field in ascending or descending order. One of ``"ascending"`` - (default), ``"descending"``, or ``null`` (no not sort). + (default), ``"descending"``, or ``null`` (do not sort). """ _schema = {"$ref": "#/definitions/SortField"} @@ -22067,17 +22291,22 @@ class StringFieldDef(VegaLiteSchema): about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. + + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. - See the `format documentation `__ - for more examples. + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -22290,17 +22519,22 @@ class StringFieldDefWithCondition(VegaLiteSchema): about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - See the `format documentation `__ - for more examples. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. + + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -22648,17 +22882,22 @@ class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): since Vega-Lite only allows at most one encoded field per encoding channel. datum : str, bool, dict, float, :class:`ExprRef`, :class:`DateTime`, :class:`RepeatRef`, :class:`PrimitiveValue`, None A constant value in data domain. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. + + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. - See the `format documentation `__ - for more examples. + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -22860,17 +23099,22 @@ class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): about escaping in the `field documentation `__. 2) ``field`` is not required if ``aggregate`` is ``count``. - format : str, dict, :class:`Dict` - When used with the default ``"number"`` and ``"time"`` format type, the text - formatting pattern for labels of guides (axes, legends, headers) and text marks. + format : str, dict, :class:`Dict`, :class:`Format`, :class:`TimeFormatSpecifier` + The text format specifier for formatting number and date/time in labels of guides + (axes, legends, headers) and text marks. - * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's - `number format pattern `__. - * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time - format pattern `__. + If the format type is ``"number"`` (e.g., for quantitative fields), this is a D3's + `number format pattern string `__. - See the `format documentation `__ - for more examples. + If the format type is ``"time"`` (e.g., for temporal fields), this is either: a) + D3's `time format pattern `__ if you + desire to set a static time format. + + b) `dynamic time format specifier object + `__ if you + desire to set a dynamic time format that uses different formats depending on the + granularity of the input date (e.g., if the date lies on a year, month, date, hour, + etc. boundary). When used with a `custom formatType `__, this @@ -23384,6 +23628,8 @@ class TickConfig(AnyMarkConfig): Thickness of the tick mark. **Default value:** ``1`` + time : dict, float, :class:`ExprRef` + timeUnitBandPosition : float Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -23516,6 +23762,7 @@ def __init__( theta: Optional[float | Parameter | SchemaBase | Map] = Undefined, theta2: Optional[float | Parameter | SchemaBase | Map] = Undefined, thickness: Optional[float] = Undefined, + time: Optional[float | Parameter | SchemaBase | Map] = Undefined, timeUnitBandPosition: Optional[float] = Undefined, timeUnitBandSize: Optional[float] = Undefined, tooltip: Optional[ @@ -23604,6 +23851,7 @@ def __init__( theta=theta, theta2=theta2, thickness=thickness, + time=time, timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, @@ -23626,104 +23874,659 @@ def __init__(self, *args, **kwds): super().__init__(*args, **kwds) -class TimeInterval(TickCount): - """TimeInterval schema wrapper.""" - - _schema = {"$ref": "#/definitions/TimeInterval"} - - def __init__(self, *args): - super().__init__(*args) - - -class TimeIntervalStep(TickCount): - """ - TimeIntervalStep schema wrapper. +class TimeDef(VegaLiteSchema): + r""" + TimeDef schema wrapper. Parameters ---------- - interval : :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'] + shorthand : str, dict, Sequence[str], :class:`RepeatRef` + shorthand for field, aggregate, and type + aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"``). - step : float + **Default value:** ``undefined`` (None) - """ + **See also:** `aggregate `__ + documentation. + bandPosition : float + Relative position on a band of a stacked, binned, time unit, or band scale. For + example, the marks will be positioned at the beginning of the band if set to ``0``, + and at the middle of the band if set to ``0.5``. + bin : bool, dict, :class:`BinParams`, None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating + that the data for ``x`` or ``y`` channel are binned before they are imported into + Vega-Lite (``"binned"``). - _schema = {"$ref": "#/definitions/TimeIntervalStep"} + * If ``true``, default `binning parameters + `__ will be + applied. - def __init__( - self, - interval: Optional[SchemaBase | TimeInterval_T] = Undefined, - step: Optional[float] = Undefined, - **kwds, - ): - super().__init__(interval=interval, step=step, **kwds) + * If ``"binned"``, this indicates that the data for the ``x`` (or ``y``) channel are + already binned. You can map the bin-start field to ``x`` (or ``y``) and the + bin-end field to ``x2`` (or ``y2``). The scale and axis will be formatted similar + to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can + also set the axis's `tickMinStep + `__ property. + **Default value:** ``false`` -class TimeLocale(VegaLiteSchema): - """ - TimeLocale schema wrapper. + **See also:** `bin `__ + documentation. + field : str, dict, :class:`Field`, :class:`FieldName`, :class:`RepeatRef` + **Required.** A string defining the name of the field from which to pull a data + value or an object defining iterated values from the `repeat + `__ operator. - Locale definition for formatting dates and times. + **See also:** `field `__ + documentation. - Parameters - ---------- - date : str - The date (%x) format specifier (e.g., "%m/%d/%Y"). - dateTime : str - The date and time (%c) format specifier (e.g., "%a %b %e %X %Y"). - days : Sequence[str], :class:`Vector7string` - The full names of the weekdays, starting with Sunday. - months : Sequence[str], :class:`Vector12string` - The full names of the months (starting with January). - periods : Sequence[str], :class:`Vector2string` - The A.M. and P.M. equivalents (e.g., ["AM", "PM"]). - shortDays : Sequence[str], :class:`Vector7string` - The abbreviated names of the weekdays, starting with Sunday. - shortMonths : Sequence[str], :class:`Vector12string` - The abbreviated names of the months (starting with January). - time : str - The time (%X) format specifier (e.g., "%H:%M:%S"). - """ + **Notes:** 1) Dots (``.``) and brackets (``[`` and ``]``) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"``). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"``). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + rescale : bool - _schema = {"$ref": "#/definitions/TimeLocale"} + scale : dict, :class:`Scale`, None + An object defining properties of the channel's scale, which is the function that + transforms values in the data domain (numbers, dates, strings, etc) to visual values + (pixels, colors, sizes) of the encoding channels. - def __init__( - self, - date: Optional[str] = Undefined, - dateTime: Optional[str] = Undefined, - days: Optional[SchemaBase | Sequence[str]] = Undefined, - months: Optional[SchemaBase | Sequence[str]] = Undefined, - periods: Optional[SchemaBase | Sequence[str]] = Undefined, - shortDays: Optional[SchemaBase | Sequence[str]] = Undefined, - shortMonths: Optional[SchemaBase | Sequence[str]] = Undefined, - time: Optional[str] = Undefined, - **kwds, - ): - super().__init__( - date=date, - dateTime=dateTime, - days=days, - months=months, - periods=periods, - shortDays=shortDays, - shortMonths=shortMonths, - time=time, - **kwds, - ) + If ``null``, the scale will be `disabled and the data value will be directly encoded + `__. + **Default value:** If undefined, default `scale properties + `__ are applied. -class TimeUnit(VegaLiteSchema): - """TimeUnit schema wrapper.""" + **See also:** `scale `__ + documentation. + sort : dict, :class:`Sort`, Sequence[str], Sequence[bool], Sequence[float], :class:`SortArray`, :class:`SortOrder`, :class:`AllSortString`, :class:`SortByChannel`, :class:`SortByEncoding`, :class:`EncodingSortField`, :class:`SortByChannelDesc`, Sequence[dict, :class:`DateTime`], Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text', 'ascending', 'descending', 'x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], None + Sort order for the encoded field. - _schema = {"$ref": "#/definitions/TimeUnit"} + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. - def __init__(self, *args, **kwds): - super().__init__(*args, **kwds) + For discrete fields, ``sort`` can be one of the following: + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + JavaScript. + * `A string indicating an encoding channel name to sort by + `__ (e.g., + ``"x"`` or ``"y"``) with an optional minus prefix for descending sort (e.g., + ``"-x"`` to sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For + example, ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects + `__. In addition, for time + units ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"``). + * ``null`` indicating no sort. -class MultiTimeUnit(TimeUnit): - """MultiTimeUnit schema wrapper.""" + **Default value:** ``"ascending"`` - _schema = {"$ref": "#/definitions/MultiTimeUnit"} + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : dict, :class:`TimeUnit`, :class:`MultiTimeUnit`, :class:`BinnedTimeUnit`, :class:`SingleTimeUnit`, :class:`TimeUnitParams`, :class:`UtcMultiTimeUnit`, :class:`UtcSingleTimeUnit`, :class:`LocalMultiTimeUnit`, :class:`LocalSingleTimeUnit`, Literal['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', 'utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds', 'year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds', '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', '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'] + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours``) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : str, :class:`Text`, Sequence[str], None + A title for the field. If ``null``, the title will be removed. + + **Default value:** derived from the field's name and transformation function + (``aggregate``, ``bin`` and ``timeUnit``). If the field has an aggregate function, + the function is displayed as part of the title (e.g., ``"Sum of Profit"``). If the + field is binned or has a time unit applied, the applied function is shown in + parentheses (e.g., ``"Profit (binned)"``, ``"Transaction Date (year-month)"``). + Otherwise, the title is simply the field name. + + **Notes**: + + 1) You can customize the default field title format by providing the `fieldTitle + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] + The type of measurement (``"quantitative"``, ``"temporal"``, ``"ordinal"``, or + ``"nominal"``) for the encoded field or constant value (``datum``). It can also be a + ``"geojson"`` type for encoding `'geoshape' + `__. + + Vega-Lite automatically infers data types in many cases as discussed below. However, + type is required for a field if: (1) the field is not nominal and the field encoding + has no specified ``aggregate`` (except ``argmin`` and ``argmax``), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: + + * ``"quantitative"`` is the default type if (1) the encoded field contains ``bin`` + or ``aggregate`` except ``"argmin"`` and ``"argmax"``, (2) the encoding channel is + ``latitude`` or ``longitude`` channel or (3) if the specified scale type is `a + quantitative scale `__. + * ``"temporal"`` is the default type if (1) the encoded field contains ``timeUnit`` + or (2) the specified scale type is a time or utc scale + * ``"ordinal"`` is the default type if (1) the encoded field contains a `custom sort + order + `__, + (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding + channel is ``order``. + + 2) For a constant value in data domain (``datum``): + + * ``"quantitative"`` if the datum is a number + * ``"nominal"`` if the datum is a string + * ``"temporal"`` if the datum is `a date time object + `__ + + **Note:** + + * Data ``type`` describes the semantics of the data rather than the primitive data + types (number, string, etc.). The same primitive data type can have different + types of measurement. For example, numeric data can represent quantitative, + ordinal, or nominal data. + * Data values for a temporal field can be either a date-time string (e.g., + ``"2015-03-07 12:32:17"``, ``"17:01"``, ``"2015-03-16"``. ``"2015"``) or a + timestamp number (e.g., ``1552199579097``). + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (default, for using a temporal scale) or `"ordinal" + (for using an ordinal scale) + `__. + * When using with `aggregate + `__, the ``type`` property + refers to the post-aggregation data type. For example, we can calculate count + ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", + "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError``) do not have + ``type`` as they must have exactly the same type as their primary channels (e.g., + ``x``, ``y``). + + **See also:** `type `__ + documentation. + """ + + _schema = {"$ref": "#/definitions/TimeDef"} + + def __init__( + self, + shorthand: Optional[str | SchemaBase | Sequence[str] | Map] = Undefined, + aggregate: Optional[SchemaBase | Map | NonArgAggregateOp_T] = Undefined, + bandPosition: Optional[float] = Undefined, + bin: Optional[bool | SchemaBase | Map | None] = Undefined, + field: Optional[str | SchemaBase | Map] = Undefined, + rescale: Optional[bool] = Undefined, + scale: Optional[SchemaBase | Map | None] = Undefined, + sort: Optional[ + SchemaBase + | Sequence[str] + | Sequence[bool] + | Sequence[float] + | Sequence[Temporal | SchemaBase | Map] + | Map + | AllSortString_T + | None + ] = Undefined, + timeUnit: Optional[ + SchemaBase | Map | MultiTimeUnit_T | BinnedTimeUnit_T | SingleTimeUnit_T + ] = Undefined, + title: Optional[str | SchemaBase | Sequence[str] | None] = Undefined, + type: Optional[SchemaBase | StandardType_T] = Undefined, + **kwds, + ): + super().__init__( + shorthand=shorthand, + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + rescale=rescale, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) + + +class TimeFieldDef(VegaLiteSchema): + r""" + TimeFieldDef schema wrapper. + + Parameters + ---------- + aggregate : dict, :class:`Aggregate`, :class:`ArgmaxDef`, :class:`ArgminDef`, :class:`NonArgAggregateOp`, Literal['average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', 'variancep', 'exponential', 'exponentialb'] + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"``). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bandPosition : float + Relative position on a band of a stacked, binned, time unit, or band scale. For + example, the marks will be positioned at the beginning of the band if set to ``0``, + and at the middle of the band if set to ``0.5``. + bin : bool, dict, :class:`BinParams`, None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating + that the data for ``x`` or ``y`` channel are binned before they are imported into + Vega-Lite (``"binned"``). + + * If ``true``, default `binning parameters + `__ will be + applied. + + * If ``"binned"``, this indicates that the data for the ``x`` (or ``y``) channel are + already binned. You can map the bin-start field to ``x`` (or ``y``) and the + bin-end field to ``x2`` (or ``y2``). The scale and axis will be formatted similar + to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can + also set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : str, dict, :class:`Field`, :class:`FieldName`, :class:`RepeatRef` + **Required.** A string defining the name of the field from which to pull a data + value or an object defining iterated values from the `repeat + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots (``.``) and brackets (``[`` and ``]``) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"``). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"``). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + rescale : bool + + scale : dict, :class:`Scale`, None + An object defining properties of the channel's scale, which is the function that + transforms values in the data domain (numbers, dates, strings, etc) to visual values + (pixels, colors, sizes) of the encoding channels. + + If ``null``, the scale will be `disabled and the data value will be directly encoded + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : dict, :class:`Sort`, Sequence[str], Sequence[bool], Sequence[float], :class:`SortArray`, :class:`SortOrder`, :class:`AllSortString`, :class:`SortByChannel`, :class:`SortByEncoding`, :class:`EncodingSortField`, :class:`SortByChannelDesc`, Sequence[dict, :class:`DateTime`], Literal['-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', '-fillOpacity', '-strokeOpacity', '-opacity', '-text', 'ascending', 'descending', 'x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', 'strokeOpacity', 'opacity', 'text'], None + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + JavaScript. + * `A string indicating an encoding channel name to sort by + `__ (e.g., + ``"x"`` or ``"y"``) with an optional minus prefix for descending sort (e.g., + ``"-x"`` to sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For + example, ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects + `__. In addition, for time + units ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"``). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : dict, :class:`TimeUnit`, :class:`MultiTimeUnit`, :class:`BinnedTimeUnit`, :class:`SingleTimeUnit`, :class:`TimeUnitParams`, :class:`UtcMultiTimeUnit`, :class:`UtcSingleTimeUnit`, :class:`LocalMultiTimeUnit`, :class:`LocalSingleTimeUnit`, Literal['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', 'utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds', 'year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', 'seconds', 'milliseconds', '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', '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'] + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours``) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : str, :class:`Text`, Sequence[str], None + A title for the field. If ``null``, the title will be removed. + + **Default value:** derived from the field's name and transformation function + (``aggregate``, ``bin`` and ``timeUnit``). If the field has an aggregate function, + the function is displayed as part of the title (e.g., ``"Sum of Profit"``). If the + field is binned or has a time unit applied, the applied function is shown in + parentheses (e.g., ``"Profit (binned)"``, ``"Transaction Date (year-month)"``). + Otherwise, the title is simply the field name. + + **Notes**: + + 1) You can customize the default field title format by providing the `fieldTitle + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + type : :class:`StandardType`, Literal['quantitative', 'ordinal', 'temporal', 'nominal'] + The type of measurement (``"quantitative"``, ``"temporal"``, ``"ordinal"``, or + ``"nominal"``) for the encoded field or constant value (``datum``). It can also be a + ``"geojson"`` type for encoding `'geoshape' + `__. + + Vega-Lite automatically infers data types in many cases as discussed below. However, + type is required for a field if: (1) the field is not nominal and the field encoding + has no specified ``aggregate`` (except ``argmin`` and ``argmax``), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: + + * ``"quantitative"`` is the default type if (1) the encoded field contains ``bin`` + or ``aggregate`` except ``"argmin"`` and ``"argmax"``, (2) the encoding channel is + ``latitude`` or ``longitude`` channel or (3) if the specified scale type is `a + quantitative scale `__. + * ``"temporal"`` is the default type if (1) the encoded field contains ``timeUnit`` + or (2) the specified scale type is a time or utc scale + * ``"ordinal"`` is the default type if (1) the encoded field contains a `custom sort + order + `__, + (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding + channel is ``order``. + + 2) For a constant value in data domain (``datum``): + + * ``"quantitative"`` if the datum is a number + * ``"nominal"`` if the datum is a string + * ``"temporal"`` if the datum is `a date time object + `__ + + **Note:** + + * Data ``type`` describes the semantics of the data rather than the primitive data + types (number, string, etc.). The same primitive data type can have different + types of measurement. For example, numeric data can represent quantitative, + ordinal, or nominal data. + * Data values for a temporal field can be either a date-time string (e.g., + ``"2015-03-07 12:32:17"``, ``"17:01"``, ``"2015-03-16"``. ``"2015"``) or a + timestamp number (e.g., ``1552199579097``). + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (default, for using a temporal scale) or `"ordinal" + (for using an ordinal scale) + `__. + * When using with `aggregate + `__, the ``type`` property + refers to the post-aggregation data type. For example, we can calculate count + ``distinct`` of a categorical field ``"cat"`` using ``{"aggregate": "distinct", + "field": "cat"}``. The ``"type"`` of the aggregate output is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError``) do not have + ``type`` as they must have exactly the same type as their primary channels (e.g., + ``x``, ``y``). + + **See also:** `type `__ + documentation. + """ + + _schema = {"$ref": "#/definitions/TimeFieldDef"} + + def __init__( + self, + aggregate: Optional[SchemaBase | Map | NonArgAggregateOp_T] = Undefined, + bandPosition: Optional[float] = Undefined, + bin: Optional[bool | SchemaBase | Map | None] = Undefined, + field: Optional[str | SchemaBase | Map] = Undefined, + rescale: Optional[bool] = Undefined, + scale: Optional[SchemaBase | Map | None] = Undefined, + sort: Optional[ + SchemaBase + | Sequence[str] + | Sequence[bool] + | Sequence[float] + | Sequence[Temporal | SchemaBase | Map] + | Map + | AllSortString_T + | None + ] = Undefined, + timeUnit: Optional[ + SchemaBase | Map | MultiTimeUnit_T | BinnedTimeUnit_T | SingleTimeUnit_T + ] = Undefined, + title: Optional[str | SchemaBase | Sequence[str] | None] = Undefined, + type: Optional[SchemaBase | StandardType_T] = Undefined, + **kwds, + ): + super().__init__( + aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + field=field, + rescale=rescale, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds, + ) + + +class TimeFormatSpecifier(Format): + """ + TimeFormatSpecifier schema wrapper. + + Parameters + ---------- + date : str + + day : str + + hours : str + + milliseconds : str + + minutes : str + + month : str + + quarter : str + + seconds : str + + week : str + + year : str + + """ + + _schema = {"$ref": "#/definitions/TimeFormatSpecifier"} + + def __init__( + self, + date: Optional[str] = Undefined, + day: Optional[str] = Undefined, + hours: Optional[str] = Undefined, + milliseconds: Optional[str] = Undefined, + minutes: Optional[str] = Undefined, + month: Optional[str] = Undefined, + quarter: Optional[str] = Undefined, + seconds: Optional[str] = Undefined, + week: Optional[str] = Undefined, + year: Optional[str] = Undefined, + **kwds, + ): + super().__init__( + date=date, + day=day, + hours=hours, + milliseconds=milliseconds, + minutes=minutes, + month=month, + quarter=quarter, + seconds=seconds, + week=week, + year=year, + **kwds, + ) + + +class TimeInterval(TickCount): + """TimeInterval schema wrapper.""" + + _schema = {"$ref": "#/definitions/TimeInterval"} + + def __init__(self, *args): + super().__init__(*args) + + +class TimeIntervalStep(TickCount): + """ + TimeIntervalStep schema wrapper. + + Parameters + ---------- + interval : :class:`TimeInterval`, Literal['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'] + + step : float + + """ + + _schema = {"$ref": "#/definitions/TimeIntervalStep"} + + def __init__( + self, + interval: Optional[SchemaBase | TimeInterval_T] = Undefined, + step: Optional[float] = Undefined, + **kwds, + ): + super().__init__(interval=interval, step=step, **kwds) + + +class TimeLocale(VegaLiteSchema): + """ + TimeLocale schema wrapper. + + Locale definition for formatting dates and times. + + Parameters + ---------- + date : str + The date (%x) format specifier (e.g., "%m/%d/%Y"). + dateTime : str + The date and time (%c) format specifier (e.g., "%a %b %e %X %Y"). + days : Sequence[str], :class:`Vector7string` + The full names of the weekdays, starting with Sunday. + months : Sequence[str], :class:`Vector12string` + The full names of the months (starting with January). + periods : Sequence[str], :class:`Vector2string` + The A.M. and P.M. equivalents (e.g., ["AM", "PM"]). + shortDays : Sequence[str], :class:`Vector7string` + The abbreviated names of the weekdays, starting with Sunday. + shortMonths : Sequence[str], :class:`Vector12string` + The abbreviated names of the months (starting with January). + time : str + The time (%X) format specifier (e.g., "%H:%M:%S"). + """ + + _schema = {"$ref": "#/definitions/TimeLocale"} + + def __init__( + self, + date: Optional[str] = Undefined, + dateTime: Optional[str] = Undefined, + days: Optional[SchemaBase | Sequence[str]] = Undefined, + months: Optional[SchemaBase | Sequence[str]] = Undefined, + periods: Optional[SchemaBase | Sequence[str]] = Undefined, + shortDays: Optional[SchemaBase | Sequence[str]] = Undefined, + shortMonths: Optional[SchemaBase | Sequence[str]] = Undefined, + time: Optional[str] = Undefined, + **kwds, + ): + super().__init__( + date=date, + dateTime=dateTime, + days=days, + months=months, + periods=periods, + shortDays=shortDays, + shortMonths=shortMonths, + time=time, + **kwds, + ) + + +class TimeUnit(VegaLiteSchema): + """TimeUnit schema wrapper.""" + + _schema = {"$ref": "#/definitions/TimeUnit"} + + def __init__(self, *args, **kwds): + super().__init__(*args, **kwds) + + +class MultiTimeUnit(TimeUnit): + """MultiTimeUnit schema wrapper.""" + + _schema = {"$ref": "#/definitions/MultiTimeUnit"} def __init__(self, *args, **kwds): super().__init__(*args, **kwds) @@ -24392,7 +25195,7 @@ class TopLevelConcatSpec(TopLevelSpec): $schema : str URL to `JSON schema `__ for a Vega-Lite specification. Unless you have a reason to change this, use - ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` + ``https://vega.github.io/schema/vega-lite/v6.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ @@ -24567,7 +25370,7 @@ class TopLevelFacetSpec(TopLevelSpec): $schema : str URL to `JSON schema `__ for a Vega-Lite specification. Unless you have a reason to change this, use - ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` + ``https://vega.github.io/schema/vega-lite/v6.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ @@ -24698,7 +25501,7 @@ class TopLevelHConcatSpec(TopLevelSpec): $schema : str URL to `JSON schema `__ for a Vega-Lite specification. Unless you have a reason to change this, use - ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` + ``https://vega.github.io/schema/vega-lite/v6.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ @@ -24856,7 +25659,7 @@ class TopLevelLayerSpec(TopLevelSpec): $schema : str URL to `JSON schema `__ for a Vega-Lite specification. Unless you have a reason to change this, use - ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` + ``https://vega.github.io/schema/vega-lite/v6.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ @@ -25069,7 +25872,7 @@ class TopLevelUnitSpec(TopLevelSpec): $schema : str URL to `JSON schema `__ for a Vega-Lite specification. Unless you have a reason to change this, use - ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` + ``https://vega.github.io/schema/vega-lite/v6.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ @@ -25206,7 +26009,7 @@ class TopLevelVConcatSpec(TopLevelSpec): $schema : str URL to `JSON schema `__ for a Vega-Lite specification. Unless you have a reason to change this, use - ``https://vega.github.io/schema/vega-lite/v5.json``. Setting the ``$schema`` + ``https://vega.github.io/schema/vega-lite/v6.json``. Setting the ``$schema`` property allows automatic validation and autocomplete in editors that support JSON schema. """ @@ -26959,12 +27762,12 @@ class ViewConfig(VegaLiteSchema): The default height when the plot has a continuous y-field for x or latitude, or has arc marks. - **Default value:** ``200`` + **Default value:** ``300`` continuousWidth : float The default width when the plot has a continuous field for x or longitude, or has arc marks. - **Default value:** ``200`` + **Default value:** ``300`` cornerRadius : dict, float, :class:`ExprRef` The radius in pixels of rounded rectangles or arcs' corners. diff --git a/altair/vegalite/v5/schema/mixins.py b/altair/vegalite/v6/schema/mixins.py similarity index 99% rename from altair/vegalite/v5/schema/mixins.py rename to altair/vegalite/v6/schema/mixins.py index ad7d1303da..227dbe8921 100644 --- a/altair/vegalite/v5/schema/mixins.py +++ b/altair/vegalite/v6/schema/mixins.py @@ -424,6 +424,8 @@ class _MarkDef(SchemaBase): Thickness of the tick mark. **Default value:** ``1`` + time : dict, float, :class:`ExprRef` + timeUnitBandPosition : float Default relative band position for a time unit. If set to ``0``, the marks will be positioned at the beginning of the time unit band step. If set to ``0.5``, the marks @@ -576,6 +578,7 @@ def __init__( theta2Offset: Optional[float | Parameter | SchemaBase | Map] = Undefined, thetaOffset: Optional[float | Parameter | SchemaBase | Map] = Undefined, thickness: Optional[float] = Undefined, + time: Optional[float | Parameter | SchemaBase | Map] = Undefined, timeUnitBandPosition: Optional[float] = Undefined, timeUnitBandSize: Optional[float] = Undefined, tooltip: Optional[ @@ -675,6 +678,7 @@ def __init__( theta2Offset=theta2Offset, thetaOffset=thetaOffset, thickness=thickness, + time=time, timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, @@ -832,7 +836,7 @@ class _ErrorBarDef(SchemaBase): extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the rule. Available options include: - * ``"ci"``: Extend the rule to the confidence interval of the mean. + * ``"ci"``: Extend the rule to the 95% bootstrapped confidence interval of the mean. * ``"stderr"``: The size of rule are set to the value of standard error, extending from the mean. * ``"stdev"``: The size of rule are set to the value of standard deviation, @@ -910,7 +914,7 @@ class _ErrorBandDef(SchemaBase): extent : :class:`ErrorBarExtent`, Literal['ci', 'iqr', 'stderr', 'stdev'] The extent of the band. Available options include: - * ``"ci"``: Extend the band to the confidence interval of the mean. + * ``"ci"``: Extend the band to the 95% bootstrapped confidence interval of the mean. * ``"stderr"``: The size of band are set to the value of standard error, extending from the mean. * ``"stdev"``: The size of band are set to the value of standard deviation, diff --git a/altair/vegalite/v5/schema/vega-lite-schema.json b/altair/vegalite/v6/schema/vega-lite-schema.json similarity index 97% rename from altair/vegalite/v5/schema/vega-lite-schema.json rename to altair/vegalite/v6/schema/vega-lite-schema.json index c99b9e876e..cb3d8b1c24 100644 --- a/altair/vegalite/v5/schema/vega-lite-schema.json +++ b/altair/vegalite/v6/schema/vega-lite-schema.json @@ -862,6 +862,16 @@ ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, + "time": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" @@ -1151,15 +1161,8 @@ ] }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -2108,15 +2111,8 @@ ] }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -3717,6 +3713,16 @@ ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, + "time": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" @@ -5088,6 +5094,9 @@ "$ref": "#/definitions/Position2Def", "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, + "time": { + "$ref": "#/definitions/TimeDef" + }, "tooltip": { "anyOf": [ { @@ -6271,15 +6280,8 @@ "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -7285,15 +7287,8 @@ "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -8412,7 +8407,7 @@ "type": "null" } ], - "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (do not sort)." } }, "type": "object" @@ -8446,7 +8441,7 @@ }, "extent": { "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the 95% bootstrapped confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, "interpolate": { "$ref": "#/definitions/Interpolate", @@ -8504,7 +8499,7 @@ }, "extent": { "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the 95% bootstrapped confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, "interpolate": { "$ref": "#/definitions/Interpolate", @@ -8545,7 +8540,7 @@ "properties": { "extent": { "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the 95% bootstrapped confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, "rule": { "anyOf": [ @@ -8601,7 +8596,7 @@ }, "extent": { "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the 95% bootstrapped confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, "opacity": { "description": "The opacity (value between [0,1]) of the mark.", @@ -9227,6 +9222,9 @@ "$ref": "#/definitions/Position2Def", "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, + "time": { + "$ref": "#/definitions/TimeDef" + }, "tooltip": { "anyOf": [ { @@ -9480,7 +9478,7 @@ "properties": { "bbox": { "$ref": "#/definitions/BBox", - "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" }, "geometry": { "$ref": "#/definitions/Geometry", @@ -9516,7 +9514,7 @@ "properties": { "bbox": { "$ref": "#/definitions/BBox", - "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" }, "geometry": { "$ref": "#/definitions/Geometry", @@ -9552,7 +9550,7 @@ "properties": { "bbox": { "$ref": "#/definitions/BBox", - "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" }, "features": { "items": { @@ -10568,15 +10566,8 @@ "description": "A constant value in data domain." }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -10651,15 +10642,8 @@ "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -10748,15 +10732,8 @@ "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -10996,6 +10973,19 @@ "number" ] }, + "Format": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TimeFormatSpecifier" + }, + { + "$ref": "#/definitions/Dict" + } + ] + }, "FormatConfig": { "additionalProperties": false, "properties": { @@ -11541,7 +11531,7 @@ "$ref": "#/definitions/GeometryCollection" } ], - "description": "Union of geometry objects. https://tools.ietf.org/html/rfc7946#section-3" + "description": "Geometry object. https://tools.ietf.org/html/rfc7946#section-3" }, "GeometryCollection": { "additionalProperties": false, @@ -11549,7 +11539,7 @@ "properties": { "bbox": { "$ref": "#/definitions/BBox", - "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" }, "geometries": { "items": { @@ -11661,15 +11651,8 @@ "description": "Headers of row / column channels for faceted plots.", "properties": { "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -11955,15 +11938,8 @@ "additionalProperties": false, "properties": { "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -13082,15 +13058,8 @@ ] }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -14125,7 +14094,7 @@ "$ref": "#/definitions/ExprRef" } ], - "description": "The strategy to use for resolving overlap of labels in gradient legends. If `false`, no overlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing every other label is used. If set to `\"greedy\"`, a linear scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `\"greedy\"` for `log scales otherwise `true`." + "description": "The strategy to use for resolving overlap of labels in gradient legends. If `false`, no overlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing every other label is used. If set to `\"greedy\"`, a linear scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `\"greedy\"` for log scales otherwise `true`." }, "labelPadding": { "anyOf": [ @@ -14664,6 +14633,9 @@ }, "strokeWidth": { "$ref": "#/definitions/ResolveMode" + }, + "time": { + "$ref": "#/definitions/ResolveMode" } }, "type": "object" @@ -15389,6 +15361,16 @@ ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, + "time": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" @@ -15511,7 +15493,7 @@ "properties": { "bbox": { "$ref": "#/definitions/BBox", - "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "items": { @@ -16529,6 +16511,16 @@ ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, + "time": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" @@ -17462,6 +17454,16 @@ "minimum": 0, "type": "number" }, + "time": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" @@ -17771,7 +17773,7 @@ "properties": { "bbox": { "$ref": "#/definitions/BBox", - "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "items": { @@ -17800,7 +17802,7 @@ "properties": { "bbox": { "$ref": "#/definitions/BBox", - "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "items": { @@ -17826,7 +17828,7 @@ "properties": { "bbox": { "$ref": "#/definitions/BBox", - "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "items": { @@ -18979,6 +18981,16 @@ ], "description": "Offset for theta." }, + "time": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" @@ -19274,7 +19286,7 @@ "properties": { "bbox": { "$ref": "#/definitions/BBox", - "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "$ref": "#/definitions/Position" @@ -19438,7 +19450,7 @@ "properties": { "bbox": { "$ref": "#/definitions/BBox", - "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" + "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. The value of the bbox member is an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "items": { @@ -19462,7 +19474,7 @@ "type": "object" }, "Position": { - "description": "A Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined.", + "description": "A Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined.\n\nNote: the type will not be narrowed down to `[number, number] | [number, number, number]` due to marginal benefits and the large impact of breaking change.\n\nSee previous discussions on the type narrowing:\n- {@link https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21590 Nov 2017 } \n- {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67773 Dec 2023 } \n- {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/71441 Dec 2024 } \n\nOne can use a {@link https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates user-defined type guard that returns a type predicate } to determine if a position is a 2D or 3D position.", "items": { "type": "number" }, @@ -21208,6 +21220,16 @@ ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, + "time": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" @@ -21996,6 +22018,10 @@ "ScaleConfig": { "additionalProperties": false, "properties": { + "animationDuration": { + "description": "Default animation duration (in seconds) for time encodings, except for [`band`](https://vega.github.io/vega-lite/docs/scale.html#band) scales.\n\n__Default value:__ `5`", + "type": "number" + }, "bandPaddingInner": { "anyOf": [ { @@ -22084,6 +22110,10 @@ "description": "Default padding for continuous x/y scales.\n\n__Default:__ The bar width for continuous x-scale of a vertical bar and continuous y-scale of a horizontal bar.; `0` otherwise.", "minimum": 0 }, + "framesPerSecond": { + "description": "Default framerate (frames per second) for time [`band`](https://vega.github.io/vega-lite/docs/scale.html#band) scales.\n\n__Default value:__ `2`", + "type": "number" + }, "invalid": { "$ref": "#/definitions/ScaleInvalidDataConfig", "description": "An object that defines scale outputs per channel for invalid values (nulls and NaNs on a continuous scale).\n- The keys in this object are the scale channels.\n- The values is either `\"zero-or-min\"` (use zero if the scale includes zero or min value otherwise) or a value definition `{value: ...}`.\n\n_Example:_ Setting this `config.scale.invalid` property to `{color: {value: '#aaa'}}` will make the visualization color all invalid values with '#aaa'.\n\nSee [https://vega.github.io/vega-lite/docs/invalid-data.html](Invalid Data Docs) for more details." @@ -22452,6 +22482,9 @@ "theta": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"theta\">" }, + "time": { + "$ref": "#/definitions/ScaleInvalidDataShowAs<\"time\">" + }, "x": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"x\">" }, @@ -22610,6 +22643,17 @@ } ] }, + "ScaleInvalidDataShowAs<\"time\">": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"time\">" + }, + { + "const": "zero-or-min", + "type": "string" + } + ] + }, "ScaleInvalidDataShowAs<\"x\">": { "anyOf": [ { @@ -22834,6 +22878,15 @@ }, "type": "object" }, + "ScaleInvalidDataShowAsValue<\"time\">": { + "additionalProperties": false, + "properties": { + "value": { + "type": "number" + } + }, + "type": "object" + }, "ScaleInvalidDataShowAsValue<\"x\">": { "additionalProperties": false, "properties": { @@ -22932,6 +22985,9 @@ "theta": { "$ref": "#/definitions/ResolveMode" }, + "time": { + "$ref": "#/definitions/ResolveMode" + }, "x": { "$ref": "#/definitions/ResolveMode" }, @@ -23846,15 +23902,8 @@ "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -24322,15 +24371,8 @@ "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -26272,15 +26314,8 @@ "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -26568,6 +26603,87 @@ }, "type": "object" }, + "time": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bandPosition": { + "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." + }, + "rescale": { + "type": "boolean" + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/BinnedTimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, "tooltip": { "anyOf": [ { @@ -26660,15 +26776,8 @@ "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -27673,6 +27782,7 @@ "theta2", "radius", "radius2", + "time", "color", "fill", "stroke", @@ -27797,7 +27907,7 @@ "type": "null" } ], - "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (do not sort)." } }, "required": [ @@ -27822,7 +27932,7 @@ "type": "null" } ], - "description": "Whether to sort the field in ascending or descending order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + "description": "Whether to sort the field in ascending or descending order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (do not sort)." } }, "required": [ @@ -27851,7 +27961,6 @@ "type": "boolean" }, { - "additionalProperties": false, "type": "object" } ], @@ -28007,15 +28116,8 @@ "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/Dict" - } - ], - "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + "$ref": "#/definitions/Format", + "description": "The text format specifier for formatting number and date/time in labels of guides (axes, legends, headers) and text marks.\n\nIf the format type is `\"number\"` (e.g., for quantitative fields), this is a D3's [number format pattern string](https://github.com/d3/d3-format#locale_format).\n\nIf the format type is `\"time\"` (e.g., for temporal fields), this is either: a) D3's [time format pattern](https://d3js.org/d3-time-format#locale_format) if you desire to set a static time format.\n\n b) [dynamic time format specifier object](https://vega.github.io/vega-lite/docs/format.html#dynamic-time-format) if you desire to set a dynamic time format that uses different formats depending on the granularity of the input date (e.g., if the date lies on a year, month, date, hour, etc. boundary).\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", @@ -28951,6 +29053,16 @@ "minimum": 0, "type": "number" }, + "time": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" @@ -29080,6 +29192,126 @@ } ] }, + "TimeDef": { + "$ref": "#/definitions/TimeFieldDef" + }, + "TimeFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bandPosition": { + "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." + }, + "rescale": { + "type": "boolean" + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/BinnedTimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "TimeFormatSpecifier": { + "additionalProperties": false, + "properties": { + "date": { + "type": "string" + }, + "day": { + "type": "string" + }, + "hours": { + "type": "string" + }, + "milliseconds": { + "type": "string" + }, + "minutes": { + "type": "string" + }, + "month": { + "type": "string" + }, + "quarter": { + "type": "string" + }, + "seconds": { + "type": "string" + }, + "week": { + "type": "string" + }, + "year": { + "type": "string" + } + }, + "type": "object" + }, "TimeInterval": { "enum": [ "millisecond", @@ -29609,7 +29841,7 @@ "additionalProperties": false, "properties": { "$schema": { - "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v6.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, @@ -29768,7 +30000,7 @@ "additionalProperties": false, "properties": { "$schema": { - "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v6.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, @@ -29898,7 +30130,7 @@ "additionalProperties": false, "properties": { "$schema": { - "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v6.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, @@ -30028,7 +30260,7 @@ "additionalProperties": false, "properties": { "$schema": { - "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v6.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, @@ -30193,7 +30425,7 @@ "additionalProperties": false, "properties": { "$schema": { - "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v6.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, @@ -30364,7 +30596,7 @@ "additionalProperties": false, "properties": { "$schema": { - "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v6.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, @@ -30534,7 +30766,7 @@ "additionalProperties": false, "properties": { "$schema": { - "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v6.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, @@ -30819,7 +31051,7 @@ "additionalProperties": false, "properties": { "$schema": { - "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v6.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, @@ -31914,11 +32146,11 @@ "type": "boolean" }, "continuousHeight": { - "description": "The default height when the plot has a continuous y-field for x or latitude, or has arc marks.\n\n__Default value:__ `200`", + "description": "The default height when the plot has a continuous y-field for x or latitude, or has arc marks.\n\n__Default value:__ `300`", "type": "number" }, "continuousWidth": { - "description": "The default width when the plot has a continuous field for x or longitude, or has arc marks.\n\n__Default value:__ `200`", + "description": "The default width when the plot has a continuous field for x or longitude, or has arc marks.\n\n__Default value:__ `300`", "type": "number" }, "cornerRadius": { diff --git a/altair/vegalite/v5/schema/vega-themes.json b/altair/vegalite/v6/schema/vega-themes.json similarity index 100% rename from altair/vegalite/v5/schema/vega-themes.json rename to altair/vegalite/v6/schema/vega-themes.json diff --git a/altair/vegalite/v5/theme.py b/altair/vegalite/v6/theme.py similarity index 95% rename from altair/vegalite/v5/theme.py rename to altair/vegalite/v6/theme.py index 77f4808293..78fae038df 100644 --- a/altair/vegalite/v5/theme.py +++ b/altair/vegalite/v6/theme.py @@ -6,8 +6,8 @@ from altair.utils.deprecation import deprecated_static_only from altair.utils.plugin_registry import Plugin, PluginRegistry -from altair.vegalite.v5.schema._config import ThemeConfig -from altair.vegalite.v5.schema._typing import VegaThemes +from altair.vegalite.v6.schema._config import ThemeConfig +from altair.vegalite.v6.schema._typing import VegaThemes if TYPE_CHECKING: import sys @@ -99,7 +99,7 @@ def __repr__(self) -> str: # The entry point group that can be used by other packages to declare other # themes that will be auto-detected. Explicit registration is also # allowed by the PluginRegistry API. -ENTRY_POINT_GROUP: Final = "altair.vegalite.v5.theme" +ENTRY_POINT_GROUP: Final = "altair.vegalite.v6.theme" # NOTE: `themes` def has an entry point group themes = ThemeRegistry(entry_point_group=ENTRY_POINT_GROUP) diff --git a/doc/_static/chart.html b/doc/_static/chart.html index fb04963899..3e314cfb64 100644 --- a/doc/_static/chart.html +++ b/doc/_static/chart.html @@ -1,15 +1,15 @@ - - + +
- + +