From 14bbb8de37794d9b1040e847f333fbd5792afec8 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 26 Nov 2021 16:59:08 -0800 Subject: [PATCH 01/24] Initial creation of vegalite/v5 folder Duplicated the vegalite/v4 folder, and changed some occurrences of "4" to "5". Ran generate_schema_wrapper. As is the library will not work, because for example v5/api.py refers to definitions that no longer exist within the Vega-Lite schema, such as core.SelectionDef. --- altair/vegalite/__init__.py | 2 +- altair/vegalite/v5/__init__.py | 23 + altair/vegalite/v5/api.py | 2519 ++ altair/vegalite/v5/data.py | 43 + altair/vegalite/v5/display.py | 119 + altair/vegalite/v5/schema/__init__.py | 5 + altair/vegalite/v5/schema/channels.py | 11875 ++++++ altair/vegalite/v5/schema/core.py | 20186 ++++++++++ altair/vegalite/v5/schema/mixins.py | 1318 + .../vegalite/v5/schema/vega-lite-schema.json | 30999 ++++++++++++++++ altair/vegalite/v5/tests/__init__.py | 0 altair/vegalite/v5/tests/test_api.py | 958 + altair/vegalite/v5/tests/test_data.py | 33 + altair/vegalite/v5/tests/test_display.py | 69 + .../vegalite/v5/tests/test_geo_interface.py | 204 + altair/vegalite/v5/tests/test_renderers.py | 65 + altair/vegalite/v5/tests/test_theme.py | 19 + altair/vegalite/v5/theme.py | 56 + tools/generate_schema_wrapper.py | 3 +- 19 files changed, 68493 insertions(+), 3 deletions(-) create mode 100644 altair/vegalite/v5/__init__.py create mode 100644 altair/vegalite/v5/api.py create mode 100644 altair/vegalite/v5/data.py create mode 100644 altair/vegalite/v5/display.py create mode 100644 altair/vegalite/v5/schema/__init__.py create mode 100644 altair/vegalite/v5/schema/channels.py create mode 100644 altair/vegalite/v5/schema/core.py create mode 100644 altair/vegalite/v5/schema/mixins.py create mode 100644 altair/vegalite/v5/schema/vega-lite-schema.json create mode 100644 altair/vegalite/v5/tests/__init__.py create mode 100644 altair/vegalite/v5/tests/test_api.py create mode 100644 altair/vegalite/v5/tests/test_data.py create mode 100644 altair/vegalite/v5/tests/test_display.py create mode 100644 altair/vegalite/v5/tests/test_geo_interface.py create mode 100644 altair/vegalite/v5/tests/test_renderers.py create mode 100644 altair/vegalite/v5/tests/test_theme.py create mode 100644 altair/vegalite/v5/theme.py diff --git a/altair/vegalite/__init__.py b/altair/vegalite/__init__.py index c67625df6..eec9f692d 100644 --- a/altair/vegalite/__init__.py +++ b/altair/vegalite/__init__.py @@ -1,2 +1,2 @@ # flake8: noqa -from .v4 import * +from .v5 import * diff --git a/altair/vegalite/v5/__init__.py b/altair/vegalite/v5/__init__.py new file mode 100644 index 000000000..90b76bf87 --- /dev/null +++ b/altair/vegalite/v5/__init__.py @@ -0,0 +1,23 @@ +# flake8: noqa +from .schema import * +from .api import * + +from ...datasets import list_datasets, load_dataset + +from ... import expr +from ...expr import datum + +from .display import VegaLite, renderers + +from .data import ( + MaxRowsError, + pipe, + curry, + limit_rows, + sample, + to_json, + to_csv, + to_values, + default_data_transformer, + data_transformers, +) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py new file mode 100644 index 000000000..84162e114 --- /dev/null +++ b/altair/vegalite/v5/api.py @@ -0,0 +1,2519 @@ +import warnings + +import hashlib +import io +import json +import jsonschema +import pandas as pd +from toolz.curried import pipe as _pipe + +from .schema import core, channels, mixins, Undefined, SCHEMA_URL + +from .data import data_transformers +from ... import utils, expr +from .display import renderers, VEGALITE_VERSION, VEGAEMBED_VERSION, VEGA_VERSION +from .theme import themes + + +# ------------------------------------------------------------------------ +# Data Utilities +def _dataset_name(values): + """Generate a unique hash of the data + + Parameters + ---------- + values : list or dict + A list/dict representation of data values. + + Returns + ------- + name : string + A unique name generated from the hash of the values. + """ + if isinstance(values, core.InlineDataset): + values = values.to_dict() + if values == [{}]: + return "empty" + values_json = json.dumps(values, sort_keys=True) + hsh = hashlib.md5(values_json.encode()).hexdigest() + return "data-" + hsh + + +def _consolidate_data(data, context): + """If data is specified inline, then move it to context['datasets'] + + This function will modify context in-place, and return a new version of data + """ + values = Undefined + kwds = {} + + if isinstance(data, core.InlineData): + if data.name is Undefined and data.values is not Undefined: + if isinstance(data.values, core.InlineDataset): + values = data.to_dict()["values"] + else: + values = data.values + kwds = {"format": data.format} + + elif isinstance(data, dict): + if "name" not in data and "values" in data: + values = data["values"] + kwds = {k: v for k, v in data.items() if k != "values"} + + if values is not Undefined: + name = _dataset_name(values) + data = core.NamedData(name=name, **kwds) + context.setdefault("datasets", {})[name] = values + + return data + + +def _prepare_data(data, context=None): + """Convert input data to data for use within schema + + Parameters + ---------- + data : + The input dataset in the form of a DataFrame, dictionary, altair data + object, or other type that is recognized by the data transformers. + context : dict (optional) + The to_dict context in which the data is being prepared. This is used + to keep track of information that needs to be passed up and down the + recursive serialization routine, such as global named datasets. + """ + if data is Undefined: + return data + + # convert dataframes or objects with __geo_interface__ to dict + if isinstance(data, pd.DataFrame) or hasattr(data, "__geo_interface__"): + data = _pipe(data, data_transformers.get()) + + # convert string input to a URLData + if isinstance(data, str): + data = core.UrlData(data) + + # consolidate inline data to top-level datasets + if context is not None and data_transformers.consolidate_datasets: + data = _consolidate_data(data, context) + + # if data is still not a recognized type, then return + if not isinstance(data, (dict, core.Data)): + warnings.warn("data of type {} not recognized".format(type(data))) + + return data + + +# ------------------------------------------------------------------------ +# Aliases & specializations +Bin = core.BinParams + + +@utils.use_signature(core.LookupData) +class LookupData(core.LookupData): + def to_dict(self, *args, **kwargs): + """Convert the chart to a dictionary suitable for JSON export.""" + copy = self.copy(deep=False) + copy.data = _prepare_data(copy.data, kwargs.get("context")) + return super(LookupData, copy).to_dict(*args, **kwargs) + + +@utils.use_signature(core.FacetMapping) +class FacetMapping(core.FacetMapping): + _class_is_valid_at_instantiation = False + + def to_dict(self, *args, **kwargs): + copy = self.copy(deep=False) + context = kwargs.get("context", {}) + data = context.get("data", None) + if isinstance(self.row, str): + copy.row = core.FacetFieldDef(**utils.parse_shorthand(self.row, data)) + if isinstance(self.column, str): + copy.column = core.FacetFieldDef(**utils.parse_shorthand(self.column, data)) + return super(FacetMapping, copy).to_dict(*args, **kwargs) + + +# ------------------------------------------------------------------------ +# Encoding will contain channel objects that aren't valid at instantiation +core.FacetedEncoding._class_is_valid_at_instantiation = False + +# ------------------------------------------------------------------------ +# These are parameters that are valid at the top level, but are not valid +# for specs that are within a composite chart +# (layer, hconcat, vconcat, facet, repeat) +TOPLEVEL_ONLY_KEYS = {"background", "config", "autosize", "padding", "$schema"} + + +def _get_channels_mapping(): + mapping = {} + for attr in dir(channels): + cls = getattr(channels, attr) + if isinstance(cls, type) and issubclass(cls, core.SchemaBase): + mapping[cls] = attr.replace("Value", "").lower() + return mapping + + +# ------------------------------------------------------------------------- +# Tools for working with selections +class Selection(object): + """A Selection object""" + + _counter = 0 + + @classmethod + def _get_name(cls): + cls._counter += 1 + return "selector{:03d}".format(cls._counter) + + def __init__(self, name, selection): + if name is None: + name = self._get_name() + self.name = name + self.selection = selection + + def __repr__(self): + return "Selection({0!r}, {1})".format(self.name, self.selection) + + def ref(self): + return self.to_dict() + + def to_dict(self): + return { + "selection": self.name.to_dict() + if hasattr(self.name, "to_dict") + else self.name + } + + def __invert__(self): + return Selection(core.SelectionNot(**{"not": self.name}), self.selection) + + def __and__(self, other): + if isinstance(other, Selection): + other = other.name + return Selection( + core.SelectionAnd(**{"and": [self.name, other]}), self.selection + ) + + def __or__(self, other): + if isinstance(other, Selection): + other = other.name + return Selection(core.SelectionOr(**{"or": [self.name, other]}), self.selection) + + def __getattr__(self, field_name): + if field_name.startswith("__") and field_name.endswith("__"): + raise AttributeError(field_name) + return expr.core.GetAttrExpression(self.name, field_name) + + def __getitem__(self, field_name): + return expr.core.GetItemExpression(self.name, field_name) + + +# ------------------------------------------------------------------------ +# Top-Level Functions + + +def value(value, **kwargs): + """Specify a value for use in an encoding""" + return dict(value=value, **kwargs) + + +def selection(name=None, type=Undefined, **kwds): + """Create a named selection. + + Parameters + ---------- + name : string (optional) + The name of the selection. If not specified, a unique name will be + created. + type : string + The type of the selection: one of ["interval", "single", or "multi"] + **kwds : + additional keywords will be used to construct a SelectionDef instance + that controls the selection. + + Returns + ------- + selection: Selection + The selection object that can be used in chart creation. + """ + return Selection(name, core.SelectionDef(type=type, **kwds)) + + +@utils.use_signature(core.IntervalSelection) +def selection_interval(**kwargs): + """Create a selection with type='interval'""" + return selection(type="interval", **kwargs) + + +@utils.use_signature(core.MultiSelection) +def selection_multi(**kwargs): + """Create a selection with type='multi'""" + return selection(type="multi", **kwargs) + + +@utils.use_signature(core.SingleSelection) +def selection_single(**kwargs): + """Create a selection with type='single'""" + return selection(type="single", **kwargs) + + +@utils.use_signature(core.Binding) +def binding(input, **kwargs): + """A generic binding""" + return core.Binding(input=input, **kwargs) + + +@utils.use_signature(core.BindCheckbox) +def binding_checkbox(**kwargs): + """A checkbox binding""" + return core.BindCheckbox(input="checkbox", **kwargs) + + +@utils.use_signature(core.BindRadioSelect) +def binding_radio(**kwargs): + """A radio button binding""" + return core.BindRadioSelect(input="radio", **kwargs) + + +@utils.use_signature(core.BindRadioSelect) +def binding_select(**kwargs): + """A select binding""" + return core.BindRadioSelect(input="select", **kwargs) + + +@utils.use_signature(core.BindRange) +def binding_range(**kwargs): + """A range binding""" + return core.BindRange(input="range", **kwargs) + + +def condition(predicate, if_true, if_false, **kwargs): + """A conditional attribute or encoding + + Parameters + ---------- + predicate: Selection, PredicateComposition, expr.Expression, dict, or string + the selection predicate or test predicate for the condition. + if a string is passed, it will be treated as a test operand. + if_true: + the spec or object to use if the selection predicate is true + if_false: + the spec or object to use if the selection predicate is false + **kwargs: + additional keyword args are added to the resulting dict + + Returns + ------- + spec: dict or VegaLiteSchema + the spec that describes the condition + """ + test_predicates = (str, expr.Expression, core.PredicateComposition) + + if isinstance(predicate, Selection): + condition = {"selection": predicate.name} + elif isinstance(predicate, core.SelectionComposition): + condition = {"selection": predicate} + elif isinstance(predicate, test_predicates): + condition = {"test": predicate} + elif isinstance(predicate, dict): + condition = predicate + else: + raise NotImplementedError( + "condition predicate of type {}" "".format(type(predicate)) + ) + + if isinstance(if_true, core.SchemaBase): + # convert to dict for now; the from_dict call below will wrap this + # dict in the appropriate schema + if_true = if_true.to_dict() + elif isinstance(if_true, str): + if_true = {"shorthand": if_true} + if_true.update(kwargs) + condition.update(if_true) + + if isinstance(if_false, core.SchemaBase): + # For the selection, the channel definitions all allow selections + # already. So use this SchemaBase wrapper if possible. + selection = if_false.copy() + selection.condition = condition + elif isinstance(if_false, str): + selection = {"condition": condition, "shorthand": if_false} + selection.update(kwargs) + else: + selection = dict(condition=condition, **if_false) + + return selection + + +# -------------------------------------------------------------------- +# Top-level objects + + +class TopLevelMixin(mixins.ConfigMethodMixin): + """Mixin for top-level chart objects such as Chart, LayeredChart, etc.""" + + _class_is_valid_at_instantiation = False + + def to_dict(self, *args, **kwargs): + """Convert the chart to a dictionary suitable for JSON export""" + # We make use of three context markers: + # - 'data' points to the data that should be referenced for column type + # inference. + # - 'top_level' is a boolean flag that is assumed to be true; if it's + # true then a "$schema" arg is added to the dict. + # - 'datasets' is a dict of named datasets that should be inserted + # in the top-level object + + # note: not a deep copy because we want datasets and data arguments to + # be passed by reference + context = kwargs.get("context", {}).copy() + context.setdefault("datasets", {}) + is_top_level = context.get("top_level", True) + + copy = self.copy(deep=False) + original_data = getattr(copy, "data", Undefined) + copy.data = _prepare_data(original_data, context) + + if original_data is not Undefined: + context["data"] = original_data + + # remaining to_dict calls are not at top level + context["top_level"] = False + kwargs["context"] = context + + try: + dct = super(TopLevelMixin, copy).to_dict(*args, **kwargs) + except jsonschema.ValidationError: + dct = None + + # If we hit an error, then re-convert with validate='deep' to get + # a more useful traceback. We don't do this by default because it's + # much slower in the case that there are no errors. + if dct is None: + kwargs["validate"] = "deep" + dct = super(TopLevelMixin, copy).to_dict(*args, **kwargs) + + # TODO: following entries are added after validation. Should they be validated? + if is_top_level: + # since this is top-level we add $schema if it's missing + if "$schema" not in dct: + dct["$schema"] = SCHEMA_URL + + # apply theme from theme registry + the_theme = themes.get() + dct = utils.update_nested(the_theme(), dct, copy=True) + + # update datasets + if context["datasets"]: + dct.setdefault("datasets", {}).update(context["datasets"]) + + return dct + + def to_html( + self, + base_url="https://cdn.jsdelivr.net/npm/", + output_div="vis", + embed_options=None, + json_kwds=None, + fullhtml=True, + requirejs=False, + ): + return utils.spec_to_html( + self.to_dict(), + mode="vega-lite", + vegalite_version=VEGALITE_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vega_version=VEGA_VERSION, + base_url=base_url, + output_div=output_div, + embed_options=embed_options, + json_kwds=json_kwds, + fullhtml=fullhtml, + requirejs=requirejs, + ) + + def save( + self, + fp, + format=None, + override_data_transformer=True, + scale_factor=1.0, + vegalite_version=VEGALITE_VERSION, + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + **kwargs, + ): + """Save a chart to file in a variety of formats + + Supported formats are json, html, png, svg, pdf; the last three require + the altair_saver package to be installed. + + Parameters + ---------- + fp : string filename or file-like object + file in which to write the chart. + format : string (optional) + the format to write: one of ['json', 'html', 'png', 'svg', 'pdf']. + If not specified, the format will be determined from the filename. + override_data_transformer : boolean (optional) + If True (default), then the save action will be done with + the MaxRowsError disabled. If False, then do not change the data + transformer. + scale_factor : float + For svg or png formats, scale the image by this factor when saving. + This can be used to control the size or resolution of the output. + Default is 1.0 + **kwargs : + Additional keyword arguments are passed to the output method + associated with the specified format. + + """ + from ...utils.save import save + + kwds = dict( + chart=self, + fp=fp, + format=format, + scale_factor=scale_factor, + vegalite_version=vegalite_version, + vega_version=vega_version, + vegaembed_version=vegaembed_version, + **kwargs, + ) + + # By default we override the data transformer. This makes it so + # that save() will succeed even for large datasets that would + # normally trigger a MaxRowsError + if override_data_transformer: + with data_transformers.disable_max_rows(): + result = save(**kwds) + else: + result = save(**kwds) + return result + + # Fallback for when rendering fails; the full repr is too long to be + # useful in nearly all cases. + def __repr__(self): + return "alt.{}(...)".format(self.__class__.__name__) + + # Layering and stacking + def __add__(self, other): + if not isinstance(other, TopLevelMixin): + raise ValueError("Only Chart objects can be layered.") + return layer(self, other) + + def __and__(self, other): + if not isinstance(other, TopLevelMixin): + raise ValueError("Only Chart objects can be concatenated.") + return vconcat(self, other) + + def __or__(self, other): + if not isinstance(other, TopLevelMixin): + raise ValueError("Only Chart objects can be concatenated.") + return hconcat(self, other) + + def repeat( + self, + repeat=Undefined, + row=Undefined, + column=Undefined, + layer=Undefined, + columns=Undefined, + **kwargs, + ): + """Return a RepeatChart built from the chart + + Fields within the chart can be set to correspond to the row or + column using `alt.repeat('row')` and `alt.repeat('column')`. + + Parameters + ---------- + repeat : list + a list of data column names to be repeated. This cannot be + used along with the ``row``, ``column`` or ``layer`` argument. + row : list + a list of data column names to be mapped to the row facet + column : list + a list of data column names to be mapped to the column facet + layer : list + a list of data column names to be layered. This cannot be + used along with the ``row``, ``column`` or ``repeat`` argument. + columns : int + the maximum number of columns before wrapping. Only referenced + if ``repeat`` is specified. + **kwargs : + additional keywords passed to RepeatChart. + + Returns + ------- + chart : RepeatChart + a repeated chart. + """ + repeat_specified = repeat is not Undefined + rowcol_specified = row is not Undefined or column is not Undefined + layer_specified = layer is not Undefined + + if repeat_specified and rowcol_specified: + raise ValueError( + "repeat argument cannot be combined with row/column argument." + ) + elif repeat_specified and layer_specified: + raise ValueError("repeat argument cannot be combined with layer argument.") + elif layer_specified and rowcol_specified: + raise ValueError( + "layer argument cannot be combined with row/column argument." + ) + + if repeat_specified: + repeat = repeat + elif layer_specified: + repeat = core.LayerRepeatMapping(layer=layer) + else: + repeat = core.RepeatMapping(row=row, column=column) + + return RepeatChart(spec=self, repeat=repeat, columns=columns, **kwargs) + + def properties(self, **kwargs): + """Set top-level properties of the Chart. + + Argument names and types are the same as class initialization. + """ + copy = self.copy(deep=False) + for key, val in kwargs.items(): + if key == "selection" and isinstance(val, Selection): + # For backward compatibility with old selection interface. + setattr(copy, key, {val.name: val.selection}) + else: + # Don't validate data, because it hasn't been processed. + if key != "data": + self.validate_property(key, val) + setattr(copy, key, val) + return copy + + def project( + self, + type="mercator", + center=Undefined, + clipAngle=Undefined, + clipExtent=Undefined, + coefficient=Undefined, + distance=Undefined, + fraction=Undefined, + lobes=Undefined, + parallel=Undefined, + precision=Undefined, + radius=Undefined, + ratio=Undefined, + reflectX=Undefined, + reflectY=Undefined, + rotate=Undefined, + scale=Undefined, + spacing=Undefined, + tilt=Undefined, + translate=Undefined, + **kwds, + ): + """Add a geographic projection to the chart. + + This is generally used either with ``mark_geoshape`` or with the + ``latitude``/``longitude`` encodings. + + Available projection types are + ['albers', 'albersUsa', 'azimuthalEqualArea', 'azimuthalEquidistant', + 'conicConformal', 'conicEqualArea', 'conicEquidistant', 'equalEarth', 'equirectangular', + 'gnomonic', 'identity', 'mercator', 'orthographic', 'stereographic', 'transverseMercator'] + + Attributes + ---------- + type : ProjectionType + The cartographic projection to use. This value is case-insensitive, for example + `"albers"` and `"Albers"` indicate the same projection type. You can find all valid + projection types [in the + documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types). + + **Default value:** `mercator` + center : List(float) + Sets the projection’s center to the specified center, a two-element array of + longitude and latitude in degrees. + + **Default value:** `[0, 0]` + clipAngle : float + Sets the projection’s clipping circle radius to the specified angle in degrees. If + `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting + rather than small-circle clipping. + clipExtent : List(List(float)) + Sets the projection’s viewport clip extent to the specified bounds in pixels. The + extent bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the + left-side of the viewport, `y0` is the top, `x1` is the right and `y1` is the + bottom. If `null`, no viewport clipping is performed. + coefficient : float + + distance : float + + fraction : float + + lobes : float + + parallel : float + + precision : Mapping(required=[length]) + Sets the threshold for the projection’s [adaptive + resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. + This value corresponds to the [Douglas–Peucker + distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm). + If precision is not specified, returns the projection’s current resampling + precision which defaults to `√0.5 ≅ 0.70710…`. + radius : float + + ratio : float + + reflectX : boolean + + reflectY : boolean + + rotate : List(float) + Sets the projection’s three-axis rotation to the specified angles, which must be a + two- or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the + rotation angles in degrees about each spherical axis. (These correspond to yaw, + pitch and roll.) + + **Default value:** `[0, 0, 0]` + scale : float + Sets the projection's scale (zoom) value, overriding automatic fitting. + + spacing : float + + tilt : float + + translate : List(float) + Sets the projection's translation (pan) value, overriding automatic fitting. + + """ + projection = core.Projection( + center=center, + clipAngle=clipAngle, + clipExtent=clipExtent, + coefficient=coefficient, + distance=distance, + fraction=fraction, + lobes=lobes, + parallel=parallel, + precision=precision, + radius=radius, + ratio=ratio, + reflectX=reflectX, + reflectY=reflectY, + rotate=rotate, + scale=scale, + spacing=spacing, + tilt=tilt, + translate=translate, + type=type, + **kwds, + ) + return self.properties(projection=projection) + + def _add_transform(self, *transforms): + """Copy the chart and add specified transforms to chart.transform""" + copy = self.copy(deep=["transform"]) + if copy.transform is Undefined: + copy.transform = [] + copy.transform.extend(transforms) + return copy + + def transform_aggregate(self, aggregate=Undefined, groupby=Undefined, **kwds): + """ + Add an AggregateTransform to the schema. + + Parameters + ---------- + aggregate : List(:class:`AggregatedFieldDef`) + Array of objects that define fields to aggregate. + groupby : List(string) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + **kwds : + additional keywords are converted to aggregates using standard + shorthand parsing. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + The aggregate transform allows you to specify transforms directly using + the same shorthand syntax as used in encodings: + + >>> import altair as alt + >>> chart1 = alt.Chart().transform_aggregate( + ... mean_acc='mean(Acceleration)', + ... groupby=['Origin'] + ... ) + >>> print(chart1.transform[0].to_json()) # doctest: +NORMALIZE_WHITESPACE + { + "aggregate": [ + { + "as": "mean_acc", + "field": "Acceleration", + "op": "mean" + } + ], + "groupby": [ + "Origin" + ] + } + + It also supports including AggregatedFieldDef instances or dicts directly, + so you can create the above transform like this: + + >>> chart2 = alt.Chart().transform_aggregate( + ... [alt.AggregatedFieldDef(field='Acceleration', op='mean', + ... **{'as': 'mean_acc'})], + ... groupby=['Origin'] + ... ) + >>> chart2.transform == chart1.transform + True + + See Also + -------- + alt.AggregateTransform : underlying transform object + + """ + if aggregate is Undefined: + aggregate = [] + for key, val in kwds.items(): + parsed = utils.parse_shorthand(val) + dct = { + "as": key, + "field": parsed.get("field", Undefined), + "op": parsed.get("aggregate", Undefined), + } + aggregate.append(core.AggregatedFieldDef(**dct)) + return self._add_transform( + core.AggregateTransform(aggregate=aggregate, groupby=groupby) + ) + + def transform_bin(self, as_=Undefined, field=Undefined, bin=True, **kwargs): + """ + Add a BinTransform to the schema. + + Parameters + ---------- + as_ : anyOf(string, List(string)) + The output fields at which to write the start and end bin values. + bin : anyOf(boolean, :class:`BinParams`) + An object indicating bin properties, or simply ``true`` for using default bin + parameters. + field : string + The data field to bin. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> chart = alt.Chart().transform_bin("x_binned", "x") + >>> chart.transform[0] + BinTransform({ + as: 'x_binned', + bin: True, + field: 'x' + }) + + >>> chart = alt.Chart().transform_bin("x_binned", "x", + ... bin=alt.Bin(maxbins=10)) + >>> chart.transform[0] + BinTransform({ + as: 'x_binned', + bin: BinParams({ + maxbins: 10 + }), + field: 'x' + }) + + See Also + -------- + alt.BinTransform : underlying transform object + + """ + if as_ is not Undefined: + if "as" in kwargs: + raise ValueError( + "transform_bin: both 'as_' and 'as' passed as arguments." + ) + kwargs["as"] = as_ + kwargs["bin"] = bin + kwargs["field"] = field + return self._add_transform(core.BinTransform(**kwargs)) + + def transform_calculate(self, as_=Undefined, calculate=Undefined, **kwargs): + """ + Add a CalculateTransform to the schema. + + Parameters + ---------- + as_ : string + The field for storing the computed formula value. + calculate : string or alt.expr expression + A `expression `__ + string. Use the variable ``datum`` to refer to the current data object. + **kwargs + transforms can also be passed by keyword argument; see Examples + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> from altair import datum, expr + + >>> chart = alt.Chart().transform_calculate(y = 2 * expr.sin(datum.x)) + >>> chart.transform[0] + CalculateTransform({ + as: 'y', + calculate: (2 * sin(datum.x)) + }) + + It's also possible to pass the ``CalculateTransform`` arguments directly: + + >>> kwds = {'as': 'y', 'calculate': '2 * sin(datum.x)'} + >>> chart = alt.Chart().transform_calculate(**kwds) + >>> chart.transform[0] + CalculateTransform({ + as: 'y', + calculate: '2 * sin(datum.x)' + }) + + As the first form is easier to write and understand, that is the + recommended method. + + See Also + -------- + alt.CalculateTransform : underlying transform object + """ + if as_ is Undefined: + as_ = kwargs.pop("as", Undefined) + elif "as" in kwargs: + raise ValueError( + "transform_calculate: both 'as_' and 'as' passed as arguments." + ) + if as_ is not Undefined or calculate is not Undefined: + dct = {"as": as_, "calculate": calculate} + self = self._add_transform(core.CalculateTransform(**dct)) + for as_, calculate in kwargs.items(): + dct = {"as": as_, "calculate": calculate} + self = self._add_transform(core.CalculateTransform(**dct)) + return self + + def transform_density( + self, + density, + as_=Undefined, + bandwidth=Undefined, + counts=Undefined, + cumulative=Undefined, + extent=Undefined, + groupby=Undefined, + maxsteps=Undefined, + minsteps=Undefined, + steps=Undefined, + ): + """Add a DensityTransform to the spec. + + Attributes + ---------- + density : str + The data field for which to perform density estimation. + as_ : [str, str] + The output fields for the sample value and corresponding density estimate. + **Default value:** ``["value", "density"]`` + bandwidth : float + The bandwidth (standard deviation) of the Gaussian kernel. If unspecified or set to + zero, the bandwidth value is automatically estimated from the input data using + Scott’s rule. + counts : boolean + A boolean flag indicating if the output values should be probability estimates + (false) or smoothed counts (true). + **Default value:** ``false`` + cumulative : boolean + A boolean flag indicating whether to produce density estimates (false) or cumulative + density estimates (true). + **Default value:** ``false`` + extent : List([float, float]) + A [min, max] domain from which to sample the distribution. If unspecified, the + extent will be determined by the observed minimum and maximum values of the density + value field. + groupby : List(str) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + maxsteps : float + The maximum number of samples to take along the extent domain for plotting the + density. **Default value:** ``200`` + minsteps : float + The minimum number of samples to take along the extent domain for plotting the + density. **Default value:** ``25`` + steps : float + The exact number of samples to take along the extent domain for plotting the + density. If specified, overrides both minsteps and maxsteps to set an exact number + of uniform samples. Potentially useful in conjunction with a fixed extent to ensure + consistent sample points for stacked densities. + """ + return self._add_transform( + core.DensityTransform( + density=density, + bandwidth=bandwidth, + counts=counts, + cumulative=cumulative, + extent=extent, + groupby=groupby, + maxsteps=maxsteps, + minsteps=minsteps, + steps=steps, + **{"as": as_}, + ) + ) + + def transform_impute( + self, + impute, + key, + frame=Undefined, + groupby=Undefined, + keyvals=Undefined, + method=Undefined, + value=Undefined, + ): + """ + Add an ImputeTransform to the schema. + + Parameters + ---------- + impute : string + The data field for which the missing values should be imputed. + key : string + A key field that uniquely identifies data objects within a group. + Missing key values (those occurring in the data but not in the current group) will + be imputed. + frame : List(anyOf(None, float)) + A frame specification as a two-element array used to control the window over which + the specified method is applied. The array entries should either be a number + indicating the offset from the current data object, or null to indicate unbounded + rows preceding or following the current data object. For example, the value ``[-5, + 5]`` indicates that the window should include five objects preceding and five + objects following the current object. + **Default value:** : ``[null, null]`` indicating that the window includes all + objects. + groupby : List(string) + An optional array of fields by which to group the values. + Imputation will then be performed on a per-group basis. + keyvals : anyOf(List(Mapping(required=[])), :class:`ImputeSequence`) + Defines the key values that should be considered for imputation. + An array of key values or an object defining a `number sequence + `__. + If provided, this will be used in addition to the key values observed within the + input data. If not provided, the values will be derived from all unique values of + the ``key`` field. For ``impute`` in ``encoding``, the key field is the x-field if + the y-field is imputed, or vice versa. + If there is no impute grouping, this property *must* be specified. + method : :class:`ImputeMethod` + The imputation method to use for the field value of imputed data objects. + One of ``value``, ``mean``, ``median``, ``max`` or ``min``. + **Default value:** ``"value"`` + value : Mapping(required=[]) + The field value to use when the imputation ``method`` is ``"value"``. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.ImputeTransform : underlying transform object + """ + return self._add_transform( + core.ImputeTransform( + impute=impute, + key=key, + frame=frame, + groupby=groupby, + keyvals=keyvals, + method=method, + value=value, + ) + ) + + def transform_joinaggregate( + self, joinaggregate=Undefined, groupby=Undefined, **kwargs + ): + """ + Add a JoinAggregateTransform to the schema. + + Parameters + ---------- + joinaggregate : List(:class:`JoinAggregateFieldDef`) + The definition of the fields in the join aggregate, and what calculations to use. + groupby : List(string) + The data fields for partitioning the data objects into separate groups. If + unspecified, all data points will be in a single group. + **kwargs + joinaggregates can also be passed by keyword argument; see Examples. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> chart = alt.Chart().transform_joinaggregate(x='sum(y)') + >>> chart.transform[0] + JoinAggregateTransform({ + joinaggregate: [JoinAggregateFieldDef({ + as: 'x', + field: 'y', + op: 'sum' + })] + }) + + See Also + -------- + alt.JoinAggregateTransform : underlying transform object + """ + if joinaggregate is Undefined: + joinaggregate = [] + for key, val in kwargs.items(): + parsed = utils.parse_shorthand(val) + dct = { + "as": key, + "field": parsed.get("field", Undefined), + "op": parsed.get("aggregate", Undefined), + } + joinaggregate.append(core.JoinAggregateFieldDef(**dct)) + return self._add_transform( + core.JoinAggregateTransform(joinaggregate=joinaggregate, groupby=groupby) + ) + + def transform_filter(self, filter, **kwargs): + """ + Add a FilterTransform to the schema. + + Parameters + ---------- + filter : a filter expression or :class:`PredicateComposition` + The `filter` property must be one of the predicate definitions: + (1) a string or alt.expr expression + (2) a range predicate + (3) a selection predicate + (4) a logical operand combining (1)-(3) + (5) a Selection object + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.FilterTransform : underlying transform object + + """ + if isinstance(filter, Selection): + filter = {"selection": filter.name} + elif isinstance(filter, core.SelectionComposition): + filter = {"selection": filter} + return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) + + def transform_flatten(self, flatten, as_=Undefined): + """Add a FlattenTransform to the schema. + + Parameters + ---------- + flatten : List(string) + An array of one or more data fields containing arrays to flatten. + If multiple fields are specified, their array values should have a parallel + structure, ideally with the same length. + If the lengths of parallel arrays do not match, + the longest array will be used with ``null`` values added for missing entries. + as : List(string) + The output field names for extracted array values. + **Default value:** The field name of the corresponding array field + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.FlattenTransform : underlying transform object + """ + return self._add_transform( + core.FlattenTransform(flatten=flatten, **{"as": as_}) + ) + + def transform_fold(self, fold, as_=Undefined): + """Add a FoldTransform to the spec. + + Parameters + ---------- + fold : List(string) + An array of data fields indicating the properties to fold. + as : [string, string] + The output field names for the key and value properties produced by the fold + transform. Default: ``["key", "value"]`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + Chart.transform_pivot : pivot transform - opposite of fold. + alt.FoldTransform : underlying transform object + """ + return self._add_transform(core.FoldTransform(fold=fold, **{"as": as_})) + + def transform_loess( + self, on, loess, as_=Undefined, bandwidth=Undefined, groupby=Undefined + ): + """Add a LoessTransform to the spec. + + Parameters + ---------- + on : str + The data field of the independent variable to use a predictor. + loess : str + The data field of the dependent variable to smooth. + as_ : [str, str] + The output field names for the smoothed points generated by the loess transform. + **Default value:** The field names of the input x and y values. + bandwidth : float + A bandwidth parameter in the range ``[0, 1]`` that determines the amount of + smoothing. **Default value:** ``0.3`` + groupby : List(str) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + Chart.transform_regression: regression transform + alt.LoessTransform : underlying transform object + """ + return self._add_transform( + core.LoessTransform( + loess=loess, on=on, bandwidth=bandwidth, groupby=groupby, **{"as": as_} + ) + ) + + def transform_lookup( + self, + lookup=Undefined, + from_=Undefined, + as_=Undefined, + default=Undefined, + **kwargs, + ): + """Add a DataLookupTransform or SelectionLookupTransform to the chart + + Attributes + ---------- + lookup : string + Key in primary data source. + from_ : anyOf(:class:`LookupData`, :class:`LookupSelection`) + Secondary data reference. + as_ : anyOf(string, List(string)) + The output fields on which to store the looked up data values. + + For data lookups, this property may be left blank if ``from_.fields`` + has been specified (those field names will be used); if ``from_.fields`` + has not been specified, ``as_`` must be a string. + + For selection lookups, this property is optional: if unspecified, + looked up values will be stored under a property named for the selection; + and if specified, it must correspond to ``from_.fields``. + default : string + The default value to use if lookup fails. **Default value:** ``null`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.DataLookupTransform : underlying transform object + alt.SelectionLookupTransform : underlying transform object + """ + if as_ is not Undefined: + if "as" in kwargs: + raise ValueError( + "transform_lookup: both 'as_' and 'as' passed as arguments." + ) + kwargs["as"] = as_ + if from_ is not Undefined: + if "from" in kwargs: + raise ValueError( + "transform_lookup: both 'from_' and 'from' passed as arguments." + ) + kwargs["from"] = from_ + kwargs["lookup"] = lookup + kwargs["default"] = default + return self._add_transform(core.LookupTransform(**kwargs)) + + def transform_pivot( + self, pivot, value, groupby=Undefined, limit=Undefined, op=Undefined + ): + """Add a pivot transform to the chart. + + Parameters + ---------- + pivot : str + The data field to pivot on. The unique values of this field become new field names + in the output stream. + value : str + The data field to populate pivoted fields. The aggregate values of this field become + the values of the new pivoted fields. + groupby : List(str) + The optional data fields to group by. If not specified, a single group containing + all data objects will be used. + limit : float + An optional parameter indicating the maximum number of pivoted fields to generate. + The default ( ``0`` ) applies no limit. The pivoted ``pivot`` names are sorted in + ascending order prior to enforcing the limit. + **Default value:** ``0`` + op : string + The aggregation operation to apply to grouped ``value`` field values. + **Default value:** ``sum`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + Chart.transform_fold : fold transform - opposite of pivot. + alt.PivotTransform : underlying transform object + """ + return self._add_transform( + core.PivotTransform( + pivot=pivot, value=value, groupby=groupby, limit=limit, op=op + ) + ) + + def transform_quantile( + self, + quantile, + as_=Undefined, + groupby=Undefined, + probs=Undefined, + step=Undefined, + ): + """Add a quantile transform to the chart + + Parameters + ---------- + quantile : str + The data field for which to perform quantile estimation. + as : [str, str] + The output field names for the probability and quantile values. + groupby : List(str) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + probs : List(float) + An array of probabilities in the range (0, 1) for which to compute quantile values. + If not specified, the *step* parameter will be used. + step : float + A probability step size (default 0.01) for sampling quantile values. All values from + one-half the step size up to 1 (exclusive) will be sampled. This parameter is only + used if the *probs* parameter is not provided. **Default value:** ``["prob", "value"]`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.QuantileTransform : underlying transform object + """ + return self._add_transform( + core.QuantileTransform( + quantile=quantile, + groupby=groupby, + probs=probs, + step=step, + **{"as": as_}, + ) + ) + + def transform_regression( + self, + on, + regression, + as_=Undefined, + extent=Undefined, + groupby=Undefined, + method=Undefined, + order=Undefined, + params=Undefined, + ): + """Add a RegressionTransform to the chart. + + Parameters + ---------- + on : str + The data field of the independent variable to use a predictor. + regression : str + The data field of the dependent variable to predict. + as_ : [str, str] + The output field names for the smoothed points generated by the regression + transform. **Default value:** The field names of the input x and y values. + extent : [float, float] + A [min, max] domain over the independent (x) field for the starting and ending + points of the generated trend line. + groupby : List(str) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + method : enum('linear', 'log', 'exp', 'pow', 'quad', 'poly') + The functional form of the regression model. One of ``"linear"``, ``"log"``, + ``"exp"``, ``"pow"``, ``"quad"``, or ``"poly"``. **Default value:** ``"linear"`` + order : float + The polynomial order (number of coefficients) for the 'poly' method. + **Default value:** ``3`` + params : boolean + A boolean flag indicating if the transform should return the regression model + parameters (one object per group), rather than trend line points. + The resulting objects include a ``coef`` array of fitted coefficient values + (starting with the intercept term and then including terms of increasing order) + and an ``rSquared`` value (indicating the total variance explained by the model). + **Default value:** ``false`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + Chart.transform_loess : LOESS transform + alt.RegressionTransform : underlying transform object + """ + return self._add_transform( + core.RegressionTransform( + regression=regression, + on=on, + extent=extent, + groupby=groupby, + method=method, + order=order, + params=params, + **{"as": as_}, + ) + ) + + def transform_sample(self, sample=1000): + """ + Add a SampleTransform to the schema. + + Parameters + ---------- + sample : float + The maximum number of data objects to include in the sample. Default: 1000. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.SampleTransform : underlying transform object + """ + return self._add_transform(core.SampleTransform(sample)) + + def transform_stack(self, as_, stack, groupby, offset=Undefined, sort=Undefined): + """ + Add a StackTransform to the schema. + + Parameters + ---------- + as_ : anyOf(string, List(string)) + Output field names. This can be either a string or an array of strings with + two elements denoting the name for the fields for stack start and stack end + respectively. + If a single string(eg."val") is provided, the end field will be "val_end". + stack : string + The field which is stacked. + groupby : List(string) + The data fields to group by. + offset : enum('zero', 'center', 'normalize') + Mode for stacking marks. Default: 'zero'. + sort : List(:class:`SortField`) + Field that determines the order of leaves in the stacked charts. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.StackTransform : underlying transform object + """ + return self._add_transform( + core.StackTransform( + stack=stack, groupby=groupby, offset=offset, sort=sort, **{"as": as_} + ) + ) + + def transform_timeunit( + self, as_=Undefined, field=Undefined, timeUnit=Undefined, **kwargs + ): + """ + Add a TimeUnitTransform to the schema. + + Parameters + ---------- + as_ : string + The output field to write the timeUnit value. + field : string + The data field to apply time unit. + timeUnit : :class:`TimeUnit` + The timeUnit. + **kwargs + transforms can also be passed by keyword argument; see Examples + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> from altair import datum, expr + + >>> chart = alt.Chart().transform_timeunit(month='month(date)') + >>> chart.transform[0] + TimeUnitTransform({ + as: 'month', + field: 'date', + timeUnit: 'month' + }) + + It's also possible to pass the ``TimeUnitTransform`` arguments directly; + this is most useful in cases where the desired field name is not a + valid python identifier: + + >>> kwds = {'as': 'month', 'timeUnit': 'month', 'field': 'The Month'} + >>> chart = alt.Chart().transform_timeunit(**kwds) + >>> chart.transform[0] + TimeUnitTransform({ + as: 'month', + field: 'The Month', + timeUnit: 'month' + }) + + As the first form is easier to write and understand, that is the + recommended method. + + See Also + -------- + alt.TimeUnitTransform : underlying transform object + + """ + if as_ is Undefined: + as_ = kwargs.pop("as", Undefined) + else: + if "as" in kwargs: + raise ValueError( + "transform_timeunit: both 'as_' and 'as' passed as arguments." + ) + if as_ is not Undefined: + dct = {"as": as_, "timeUnit": timeUnit, "field": field} + self = self._add_transform(core.TimeUnitTransform(**dct)) + for as_, shorthand in kwargs.items(): + dct = utils.parse_shorthand( + shorthand, + parse_timeunits=True, + parse_aggregates=False, + parse_types=False, + ) + dct.pop("type", None) + dct["as"] = as_ + if "timeUnit" not in dct: + raise ValueError("'{}' must include a valid timeUnit".format(shorthand)) + self = self._add_transform(core.TimeUnitTransform(**dct)) + return self + + def transform_window( + self, + window=Undefined, + frame=Undefined, + groupby=Undefined, + ignorePeers=Undefined, + sort=Undefined, + **kwargs, + ): + """Add a WindowTransform to the schema + + Parameters + ---------- + window : List(:class:`WindowFieldDef`) + The definition of the fields in the window, and what calculations to use. + frame : List(anyOf(None, float)) + A frame specification as a two-element array indicating how the sliding window + should proceed. The array entries should either be a number indicating the offset + from the current data object, or null to indicate unbounded rows preceding or + following the current data object. The default value is ``[null, 0]``, indicating + that the sliding window includes the current object and all preceding objects. The + value ``[-5, 5]`` indicates that the window should include five objects preceding + and five objects following the current object. Finally, ``[null, null]`` indicates + that the window frame should always include all data objects. The only operators + affected are the aggregation operations and the ``first_value``, ``last_value``, and + ``nth_value`` window operations. The other window operations are not affected by + this. + + **Default value:** : ``[null, 0]`` (includes the current object and all preceding + objects) + groupby : List(string) + The data fields for partitioning the data objects into separate windows. If + unspecified, all data points will be in a single group. + ignorePeers : boolean + Indicates if the sliding window frame should ignore peer values. (Peer values are + those considered identical by the sort criteria). The default is false, causing the + window frame to expand to include all peer values. If set to true, the window frame + will be defined by offset values only. This setting only affects those operations + that depend on the window frame, namely aggregation operations and the first_value, + last_value, and nth_value window operations. + + **Default value:** ``false`` + sort : List(:class:`SortField`) + A sort field definition for sorting data objects within a window. If two data + objects are considered equal by the comparator, they are considered “peer” values of + equal rank. If sort is not specified, the order is undefined: data objects are + processed in the order they are observed and none are considered peers (the + ignorePeers parameter is ignored and treated as if set to ``true`` ). + **kwargs + transforms can also be passed by keyword argument; see Examples + + Examples + -------- + A cumulative line chart + + >>> import altair as alt + >>> import numpy as np + >>> import pandas as pd + >>> data = pd.DataFrame({'x': np.arange(100), + ... 'y': np.random.randn(100)}) + >>> chart = alt.Chart(data).mark_line().encode( + ... x='x:Q', + ... y='ycuml:Q' + ... ).transform_window( + ... ycuml='sum(y)' + ... ) + >>> chart.transform[0] + WindowTransform({ + window: [WindowFieldDef({ + as: 'ycuml', + field: 'y', + op: 'sum' + })] + }) + + """ + if kwargs: + if window is Undefined: + window = [] + for as_, shorthand in kwargs.items(): + kwds = {"as": as_} + kwds.update( + utils.parse_shorthand( + shorthand, + parse_aggregates=False, + parse_window_ops=True, + parse_timeunits=False, + parse_types=False, + ) + ) + window.append(core.WindowFieldDef(**kwds)) + + return self._add_transform( + core.WindowTransform( + window=window, + frame=frame, + groupby=groupby, + ignorePeers=ignorePeers, + sort=sort, + ) + ) + + # Display-related methods + + def _repr_mimebundle_(self, include=None, exclude=None): + """Return a MIME bundle for display in Jupyter frontends.""" + # Catch errors explicitly to get around issues in Jupyter frontend + # see https://github.com/ipython/ipython/issues/11038 + try: + dct = self.to_dict() + except Exception: + utils.display_traceback(in_ipython=True) + return {} + else: + return renderers.get()(dct) + + def display(self, renderer=Undefined, theme=Undefined, actions=Undefined, **kwargs): + """Display chart in Jupyter notebook or JupyterLab + + Parameters are passed as options to vega-embed within supported frontends. + See https://github.com/vega/vega-embed#options for details. + + Parameters + ---------- + renderer : string ('canvas' or 'svg') + The renderer to use + theme : string + The Vega theme name to use; see https://github.com/vega/vega-themes + actions : bool or dict + Specify whether action links ("Open In Vega Editor", etc.) are + included in the view. + **kwargs : + Additional parameters are also passed to vega-embed as options. + + """ + from IPython.display import display + + if renderer is not Undefined: + kwargs["renderer"] = renderer + if theme is not Undefined: + kwargs["theme"] = theme + if actions is not Undefined: + kwargs["actions"] = actions + + if kwargs: + options = renderers.options.copy() + options["embed_options"] = options.get("embed_options", {}).copy() + options["embed_options"].update(kwargs) + with renderers.enable(**options): + display(self) + else: + display(self) + + @utils.deprecation.deprecated(message="serve() is deprecated. Use show() instead.") + def serve( + self, + ip="127.0.0.1", + port=8888, + n_retries=50, + files=None, + jupyter_warning=True, + open_browser=True, + http_server=None, + **kwargs, + ): + """Open a browser window and display a rendering of the chart + + Parameters + ---------- + html : string + HTML to serve + ip : string (default = '127.0.0.1') + ip address at which the HTML will be served. + port : int (default = 8888) + the port at which to serve the HTML + n_retries : int (default = 50) + the number of nearby ports to search if the specified port + is already in use. + files : dictionary (optional) + dictionary of extra content to serve + jupyter_warning : bool (optional) + if True (default), then print a warning if this is used + within the Jupyter notebook + open_browser : bool (optional) + if True (default), then open a web browser to the given HTML + http_server : class (optional) + optionally specify an HTTPServer class to use for showing the + figure. The default is Python's basic HTTPServer. + **kwargs : + additional keyword arguments passed to the save() method + + """ + from ...utils.server import serve + + html = io.StringIO() + self.save(html, format="html", **kwargs) + html.seek(0) + + serve( + html.read(), + ip=ip, + port=port, + n_retries=n_retries, + files=files, + jupyter_warning=jupyter_warning, + open_browser=open_browser, + http_server=http_server, + ) + + def show(self, embed_opt=None, open_browser=None): + """Show the chart in an external browser window. + + This requires a recent version of the altair_viewer package. + + Parameters + ---------- + embed_opt : dict (optional) + The Vega embed options that control the dispay of the chart. + open_browser : bool (optional) + Specify whether a browser window should be opened. If not specified, + a browser window will be opened only if the server is not already + connected to a browser. + """ + try: + import altair_viewer # type: ignore + except ImportError: + raise ValueError( + "show() method requires the altair_viewer package. " + "See http://github.com/altair-viz/altair_viewer" + ) + altair_viewer.show(self, embed_opt=embed_opt, open_browser=open_browser) + + @utils.use_signature(core.Resolve) + def _set_resolve(self, **kwargs): + """Copy the chart and update the resolve property with kwargs""" + if not hasattr(self, "resolve"): + raise ValueError( + "{} object has no attribute " "'resolve'".format(self.__class__) + ) + copy = self.copy(deep=["resolve"]) + if copy.resolve is Undefined: + copy.resolve = core.Resolve() + for key, val in kwargs.items(): + copy.resolve[key] = val + return copy + + @utils.use_signature(core.AxisResolveMap) + def resolve_axis(self, *args, **kwargs): + return self._set_resolve(axis=core.AxisResolveMap(*args, **kwargs)) + + @utils.use_signature(core.LegendResolveMap) + def resolve_legend(self, *args, **kwargs): + return self._set_resolve(legend=core.LegendResolveMap(*args, **kwargs)) + + @utils.use_signature(core.ScaleResolveMap) + def resolve_scale(self, *args, **kwargs): + return self._set_resolve(scale=core.ScaleResolveMap(*args, **kwargs)) + + +class _EncodingMixin(object): + @utils.use_signature(core.FacetedEncoding) + def encode(self, *args, **kwargs): + # Convert args to kwargs based on their types. + kwargs = utils.infer_encoding_types(args, kwargs, channels) + + # get a copy of the dict representation of the previous encoding + copy = self.copy(deep=["encoding"]) + encoding = copy._get("encoding", {}) + if isinstance(encoding, core.VegaLiteSchema): + encoding = {k: v for k, v in encoding._kwds.items() if v is not Undefined} + + # update with the new encodings, and apply them to the copy + encoding.update(kwargs) + copy.encoding = core.FacetedEncoding(**encoding) + return copy + + def facet( + self, + facet=Undefined, + row=Undefined, + column=Undefined, + data=Undefined, + columns=Undefined, + **kwargs, + ): + """Create a facet chart from the current chart. + + Faceted charts require data to be specified at the top level; if data + is not specified, the data from the current chart will be used at the + top level. + + Parameters + ---------- + facet : string or alt.Facet (optional) + The data column to use as an encoding for a wrapped facet. + If specified, then neither row nor column may be specified. + column : string or alt.Column (optional) + The data column to use as an encoding for a column facet. + May be combined with row argument, but not with facet argument. + row : string or alt.Column (optional) + The data column to use as an encoding for a row facet. + May be combined with column argument, but not with facet argument. + data : string or dataframe (optional) + The dataset to use for faceting. If not supplied, then data must + be specified in the top-level chart that calls this method. + columns : integer + the maximum number of columns for a wrapped facet. + + Returns + ------- + self : + for chaining + """ + facet_specified = facet is not Undefined + rowcol_specified = row is not Undefined or column is not Undefined + + if facet_specified and rowcol_specified: + raise ValueError( + "facet argument cannot be combined with row/column argument." + ) + + if data is Undefined: + if self.data is Undefined: + raise ValueError( + "Facet charts require data to be specified at the top level." + ) + self = self.copy(deep=False) + data, self.data = self.data, Undefined + + if facet_specified: + if isinstance(facet, str): + facet = channels.Facet(facet) + else: + facet = FacetMapping(row=row, column=column) + + return FacetChart(spec=self, facet=facet, data=data, columns=columns, **kwargs) + + +class Chart( + TopLevelMixin, _EncodingMixin, mixins.MarkMethodMixin, core.TopLevelUnitSpec +): + """Create a basic Altair/Vega-Lite chart. + + Although it is possible to set all Chart properties as constructor attributes, + it is more idiomatic to use methods such as ``mark_point()``, ``encode()``, + ``transform_filter()``, ``properties()``, etc. See Altair's documentation + for details and examples: http://altair-viz.github.io/. + + Attributes + ---------- + data : Data + An object describing the data source + mark : AnyMark + A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, + `"line"`, * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a + MarkDef object. + encoding : FacetedEncoding + A key-value mapping between encoding channels and definition of fields. + autosize : anyOf(AutosizeType, AutoSizeParams) + Sets how the visualization size should be determined. If a string, should be one of + `"pad"`, `"fit"` or `"none"`. Object values can additionally specify parameters for + content sizing and automatic resizing. `"fit"` is only supported for single and + layered views that don't use `rangeStep`. __Default value__: `pad` + background : string + CSS color property to use as the background of visualization. + + **Default value:** none (transparent) + config : Config + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + description : string + Description of this mark for commenting purpose. + height : float + The height of a visualization. + name : string + Name of the visualization for later reference. + padding : Padding + The default visualization padding, in pixels, from the edge of the visualization + canvas to the data rectangle. If a number, specifies padding for all sides. If an + object, the value should have the format `{"left": 5, "top": 5, "right": 5, + "bottom": 5}` to specify padding for each side of the visualization. __Default + value__: `5` + projection : Projection + An object defining properties of geographic projection. Works with `"geoshape"` + marks and `"point"` or `"line"` marks that have a channel (one or more of `"X"`, + `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + title : anyOf(string, TitleParams) + Title for the plot. + transform : List(Transform) + An array of data transformations such as filter and new field calculation. + width : float + The width of a visualization. + """ + + def __init__( + self, + data=Undefined, + encoding=Undefined, + mark=Undefined, + width=Undefined, + height=Undefined, + **kwargs, + ): + super(Chart, self).__init__( + data=data, + encoding=encoding, + mark=mark, + width=width, + height=height, + **kwargs, + ) + + @classmethod + def from_dict(cls, dct, validate=True): + """Construct class from a dictionary representation + + Parameters + ---------- + dct : dictionary + The dict from which to construct the class + validate : boolean + If True (default), then validate the input against the schema. + + Returns + ------- + obj : Chart object + The wrapped schema + + Raises + ------ + jsonschema.ValidationError : + if validate=True and dct does not conform to the schema + """ + for class_ in TopLevelMixin.__subclasses__(): + if class_ is Chart: + class_ = super(Chart, cls) + try: + return class_.from_dict(dct, validate=validate) + except jsonschema.ValidationError: + pass + + # As a last resort, try using the Root vegalite object + return core.Root.from_dict(dct, validate) + + def to_dict(self, *args, **kwargs): + """Convert the chart to a dictionary suitable for JSON export.""" + context = kwargs.get("context", {}) + if self.data is Undefined and "data" not in context: + # No data specified here or in parent: inject empty data + # for easier specification of datum encodings. + copy = self.copy(deep=False) + copy.data = core.InlineData(values=[{}]) + return super(Chart, copy).to_dict(*args, **kwargs) + return super().to_dict(*args, **kwargs) + + def add_selection(self, *selections): + """Add one or more selections to the chart.""" + if not selections: + return self + copy = self.copy(deep=["selection"]) + if copy.selection is Undefined: + copy.selection = {} + + for s in selections: + copy.selection[s.name] = s.selection + return copy + + def interactive(self, name=None, bind_x=True, bind_y=True): + """Make chart axes scales interactive + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + encodings = [] + if bind_x: + encodings.append("x") + if bind_y: + encodings.append("y") + return self.add_selection( + selection_interval(bind="scales", encodings=encodings) + ) + + +def _check_if_valid_subspec(spec, classname): + """Check if the spec is a valid sub-spec. + + If it is not, then raise a ValueError + """ + err = ( + 'Objects with "{0}" attribute cannot be used within {1}. ' + "Consider defining the {0} attribute in the {1} object instead." + ) + + if not isinstance(spec, (core.SchemaBase, dict)): + raise ValueError("Only chart objects can be used in {0}.".format(classname)) + for attr in TOPLEVEL_ONLY_KEYS: + if isinstance(spec, core.SchemaBase): + val = getattr(spec, attr, Undefined) + else: + val = spec.get(attr, Undefined) + if val is not Undefined: + raise ValueError(err.format(attr, classname)) + + +def _check_if_can_be_layered(spec): + """Check if the spec can be layered.""" + + def _get(spec, attr): + if isinstance(spec, core.SchemaBase): + return spec._get(attr) + else: + return spec.get(attr, Undefined) + + encoding = _get(spec, "encoding") + if encoding is not Undefined: + for channel in ["row", "column", "facet"]: + if _get(encoding, channel) is not Undefined: + raise ValueError("Faceted charts cannot be layered.") + if isinstance(spec, (Chart, LayerChart)): + return + + if not isinstance(spec, (core.SchemaBase, dict)): + raise ValueError("Only chart objects can be layered.") + if _get(spec, "facet") is not Undefined: + raise ValueError("Faceted charts cannot be layered.") + if isinstance(spec, FacetChart) or _get(spec, "facet") is not Undefined: + raise ValueError("Faceted charts cannot be layered.") + if isinstance(spec, RepeatChart) or _get(spec, "repeat") is not Undefined: + raise ValueError("Repeat charts cannot be layered.") + if isinstance(spec, ConcatChart) or _get(spec, "concat") is not Undefined: + raise ValueError("Concatenated charts cannot be layered.") + if isinstance(spec, HConcatChart) or _get(spec, "hconcat") is not Undefined: + raise ValueError("Concatenated charts cannot be layered.") + if isinstance(spec, VConcatChart) or _get(spec, "vconcat") is not Undefined: + raise ValueError("Concatenated charts cannot be layered.") + + +@utils.use_signature(core.TopLevelRepeatSpec) +class RepeatChart(TopLevelMixin, core.TopLevelRepeatSpec): + """A chart repeated across rows and columns with small changes""" + + # Because TopLevelRepeatSpec is defined as a union as of Vega-Lite schema 4.9, + # we set the arguments explicitly here. + # TODO: Should we instead use tools/schemapi/codegen._get_args? + def __init__( + self, + repeat=Undefined, + spec=Undefined, + align=Undefined, + autosize=Undefined, + background=Undefined, + bounds=Undefined, + center=Undefined, + columns=Undefined, + config=Undefined, + data=Undefined, + datasets=Undefined, + description=Undefined, + name=Undefined, + padding=Undefined, + params=Undefined, + resolve=Undefined, + spacing=Undefined, + title=Undefined, + transform=Undefined, + usermeta=Undefined, + **kwds, + ): + _check_if_valid_subspec(spec, "RepeatChart") + super(RepeatChart, self).__init__( + repeat=repeat, + spec=spec, + align=align, + autosize=autosize, + background=background, + bounds=bounds, + center=center, + columns=columns, + config=config, + data=data, + datasets=datasets, + description=description, + name=name, + padding=padding, + params=params, + resolve=resolve, + spacing=spacing, + title=title, + transform=transform, + usermeta=usermeta, + **kwds, + ) + + def interactive(self, name=None, bind_x=True, bind_y=True): + """Make chart axes scales interactive + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + copy = self.copy(deep=False) + copy.spec = copy.spec.interactive(name=name, bind_x=bind_x, bind_y=bind_y) + return copy + + def add_selection(self, *selections): + """Add one or more selections to the chart.""" + if not selections or self.spec is Undefined: + return self + copy = self.copy() + copy.spec = copy.spec.add_selection(*selections) + return copy + + +def repeat(repeater="repeat"): + """Tie a channel to the row or column within a repeated chart + + The output of this should be passed to the ``field`` attribute of + a channel. + + Parameters + ---------- + repeater : {'row'|'column'|'repeat'|'layer'} + The repeater to tie the field to. Default is 'repeat'. + + Returns + ------- + repeat : RepeatRef object + """ + if repeater not in ["row", "column", "repeat", "layer"]: + raise ValueError("repeater must be one of ['row', 'column', 'repeat', 'layer']") + return core.RepeatRef(repeat=repeater) + + +@utils.use_signature(core.TopLevelNormalizedConcatSpecGenericSpec) +class ConcatChart(TopLevelMixin, core.TopLevelNormalizedConcatSpecGenericSpec): + """A chart with horizontally-concatenated facets""" + + def __init__(self, data=Undefined, concat=(), columns=Undefined, **kwargs): + # TODO: move common data to top level? + for spec in concat: + _check_if_valid_subspec(spec, "ConcatChart") + super(ConcatChart, self).__init__( + data=data, concat=list(concat), columns=columns, **kwargs + ) + self.data, self.concat = _combine_subchart_data(self.data, self.concat) + + def __ior__(self, other): + _check_if_valid_subspec(other, "ConcatChart") + self.concat.append(other) + self.data, self.concat = _combine_subchart_data(self.data, self.concat) + return self + + def __or__(self, other): + copy = self.copy(deep=["concat"]) + copy |= other + return copy + + def add_selection(self, *selections): + """Add one or more selections to all subcharts.""" + if not selections or not self.concat: + return self + copy = self.copy() + copy.concat = [chart.add_selection(*selections) for chart in copy.concat] + return copy + + +def concat(*charts, **kwargs): + """Concatenate charts horizontally""" + return ConcatChart(concat=charts, **kwargs) + + +@utils.use_signature(core.TopLevelNormalizedHConcatSpecGenericSpec) +class HConcatChart(TopLevelMixin, core.TopLevelNormalizedHConcatSpecGenericSpec): + """A chart with horizontally-concatenated facets""" + + def __init__(self, data=Undefined, hconcat=(), **kwargs): + # TODO: move common data to top level? + for spec in hconcat: + _check_if_valid_subspec(spec, "HConcatChart") + super(HConcatChart, self).__init__(data=data, hconcat=list(hconcat), **kwargs) + self.data, self.hconcat = _combine_subchart_data(self.data, self.hconcat) + + def __ior__(self, other): + _check_if_valid_subspec(other, "HConcatChart") + self.hconcat.append(other) + self.data, self.hconcat = _combine_subchart_data(self.data, self.hconcat) + return self + + def __or__(self, other): + copy = self.copy(deep=["hconcat"]) + copy |= other + return copy + + def add_selection(self, *selections): + """Add one or more selections to all subcharts.""" + if not selections or not self.hconcat: + return self + copy = self.copy() + copy.hconcat = [chart.add_selection(*selections) for chart in copy.hconcat] + return copy + + +def hconcat(*charts, **kwargs): + """Concatenate charts horizontally""" + return HConcatChart(hconcat=charts, **kwargs) + + +@utils.use_signature(core.TopLevelNormalizedVConcatSpecGenericSpec) +class VConcatChart(TopLevelMixin, core.TopLevelNormalizedVConcatSpecGenericSpec): + """A chart with vertically-concatenated facets""" + + def __init__(self, data=Undefined, vconcat=(), **kwargs): + # TODO: move common data to top level? + for spec in vconcat: + _check_if_valid_subspec(spec, "VConcatChart") + super(VConcatChart, self).__init__(data=data, vconcat=list(vconcat), **kwargs) + self.data, self.vconcat = _combine_subchart_data(self.data, self.vconcat) + + def __iand__(self, other): + _check_if_valid_subspec(other, "VConcatChart") + self.vconcat.append(other) + self.data, self.vconcat = _combine_subchart_data(self.data, self.vconcat) + return self + + def __and__(self, other): + copy = self.copy(deep=["vconcat"]) + copy &= other + return copy + + def add_selection(self, *selections): + """Add one or more selections to all subcharts.""" + if not selections or not self.vconcat: + return self + copy = self.copy() + copy.vconcat = [chart.add_selection(*selections) for chart in copy.vconcat] + return copy + + +def vconcat(*charts, **kwargs): + """Concatenate charts vertically""" + return VConcatChart(vconcat=charts, **kwargs) + + +@utils.use_signature(core.TopLevelLayerSpec) +class LayerChart(TopLevelMixin, _EncodingMixin, core.TopLevelLayerSpec): + """A Chart with layers within a single panel""" + + def __init__(self, data=Undefined, layer=(), **kwargs): + # TODO: move common data to top level? + # TODO: check for conflicting interaction + for spec in layer: + _check_if_valid_subspec(spec, "LayerChart") + _check_if_can_be_layered(spec) + super(LayerChart, self).__init__(data=data, layer=list(layer), **kwargs) + self.data, self.layer = _combine_subchart_data(self.data, self.layer) + + def __iadd__(self, other): + _check_if_valid_subspec(other, "LayerChart") + _check_if_can_be_layered(other) + self.layer.append(other) + self.data, self.layer = _combine_subchart_data(self.data, self.layer) + return self + + def __add__(self, other): + copy = self.copy(deep=["layer"]) + copy += other + return copy + + def add_layers(self, *layers): + copy = self.copy(deep=["layer"]) + for layer in layers: + copy += layer + return copy + + def interactive(self, name=None, bind_x=True, bind_y=True): + """Make chart axes scales interactive + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + if not self.layer: + raise ValueError( + "LayerChart: cannot call interactive() until a " "layer is defined" + ) + copy = self.copy(deep=["layer"]) + copy.layer[0] = copy.layer[0].interactive( + name=name, bind_x=bind_x, bind_y=bind_y + ) + return copy + + def add_selection(self, *selections): + """Add one or more selections to all subcharts.""" + if not selections or not self.layer: + return self + copy = self.copy() + copy.layer[0] = copy.layer[0].add_selection(*selections) + return copy + + +def layer(*charts, **kwargs): + """layer multiple charts""" + return LayerChart(layer=charts, **kwargs) + + +@utils.use_signature(core.TopLevelFacetSpec) +class FacetChart(TopLevelMixin, core.TopLevelFacetSpec): + """A Chart with layers within a single panel""" + + def __init__(self, data=Undefined, spec=Undefined, facet=Undefined, **kwargs): + _check_if_valid_subspec(spec, "FacetChart") + super(FacetChart, self).__init__(data=data, spec=spec, facet=facet, **kwargs) + + def interactive(self, name=None, bind_x=True, bind_y=True): + """Make chart axes scales interactive + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + copy = self.copy(deep=False) + copy.spec = copy.spec.interactive(name=name, bind_x=bind_x, bind_y=bind_y) + return copy + + def add_selection(self, *selections): + """Add one or more selections to the chart.""" + if not selections or self.spec is Undefined: + return self + copy = self.copy() + copy.spec = copy.spec.add_selection(*selections) + return copy + + +def topo_feature(url, feature, **kwargs): + """A convenience function for extracting features from a topojson url + + Parameters + ---------- + url : string + An URL from which to load the data set. + + feature : string + The name of the TopoJSON object set to convert to a GeoJSON feature collection. For + example, in a map of the world, there may be an object set named `"countries"`. + Using the feature property, we can extract this set and generate a GeoJSON feature + object for each country. + + **kwargs : + additional keywords passed to TopoDataFormat + """ + return core.UrlData( + url=url, format=core.TopoDataFormat(type="topojson", feature=feature, **kwargs) + ) + + +def _combine_subchart_data(data, subcharts): + def remove_data(subchart): + if subchart.data is not Undefined: + subchart = subchart.copy() + subchart.data = Undefined + return subchart + + if not subcharts: + # No subcharts = nothing to do. + pass + elif data is Undefined: + # Top level has no data; all subchart data must + # be identical to proceed. + subdata = subcharts[0].data + if subdata is not Undefined and all(c.data is subdata for c in subcharts): + data = subdata + subcharts = [remove_data(c) for c in subcharts] + else: + # Top level has data; subchart data must be either + # undefined or identical to proceed. + if all(c.data is Undefined or c.data is data for c in subcharts): + subcharts = [remove_data(c) for c in subcharts] + + return data, subcharts + + +@utils.use_signature(core.SequenceParams) +def sequence(start, stop=None, step=Undefined, as_=Undefined, **kwds): + """Sequence generator.""" + if stop is None: + start, stop = 0, start + params = core.SequenceParams(start=start, stop=stop, step=step, **{"as": as_}) + return core.SequenceGenerator(sequence=params, **kwds) + + +@utils.use_signature(core.GraticuleParams) +def graticule(**kwds): + """Graticule generator.""" + if not kwds: + # graticule: True indicates default parameters + graticule = True + else: + graticule = core.GraticuleParams(**kwds) + return core.GraticuleGenerator(graticule=graticule) + + +def sphere(): + """Sphere generator.""" + return core.SphereGenerator(sphere=True) diff --git a/altair/vegalite/v5/data.py b/altair/vegalite/v5/data.py new file mode 100644 index 000000000..e379a2034 --- /dev/null +++ b/altair/vegalite/v5/data.py @@ -0,0 +1,43 @@ +from ..data import ( + MaxRowsError, + curry, + default_data_transformer, + limit_rows, + pipe, + sample, + to_csv, + to_json, + to_values, + DataTransformerRegistry, +) + + +# ============================================================================== +# VegaLite 4 data transformers +# ============================================================================== + + +ENTRY_POINT_GROUP = "altair.vegalite.v4.data_transformer" # type: str + + +data_transformers = DataTransformerRegistry( + entry_point_group=ENTRY_POINT_GROUP +) # type: DataTransformerRegistry +data_transformers.register("default", default_data_transformer) +data_transformers.register("json", to_json) +data_transformers.register("csv", to_csv) +data_transformers.enable("default") + + +__all__ = ( + "MaxRowsError", + "curry", + "default_data_transformer", + "limit_rows", + "pipe", + "sample", + "to_csv", + "to_json", + "to_values", + "data_transformers", +) diff --git a/altair/vegalite/v5/display.py b/altair/vegalite/v5/display.py new file mode 100644 index 000000000..b86a4c936 --- /dev/null +++ b/altair/vegalite/v5/display.py @@ -0,0 +1,119 @@ +import os + +from ...utils.mimebundle import spec_to_mimebundle +from ..display import Displayable +from ..display import default_renderer_base +from ..display import json_renderer_base +from ..display import RendererRegistry +from ..display import HTMLRenderer + +from .schema import SCHEMA_VERSION + +VEGALITE_VERSION = SCHEMA_VERSION.lstrip("v") +VEGA_VERSION = "5" +VEGAEMBED_VERSION = "6" + + +# ============================================================================== +# VegaLite v5 renderer logic +# ============================================================================== + + +# The MIME type for Vega-Lite 5.x releases. +VEGALITE_MIME_TYPE = "application/vnd.vegalite.v5+json" # type: str + +# 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 PluginRegistery API. +ENTRY_POINT_GROUP = "altair.vegalite.v5.renderer" # type: str + +# The display message when rendering fails +DEFAULT_DISPLAY = """\ + + +If you see this message, it means the renderer has not been properly enabled +for the frontend that you are using. For more information, see +https://altair-viz.github.io/user_guide/troubleshooting.html +""" + +renderers = RendererRegistry(entry_point_group=ENTRY_POINT_GROUP) + +here = os.path.dirname(os.path.realpath(__file__)) + + +def mimetype_renderer(spec, **metadata): + return default_renderer_base(spec, VEGALITE_MIME_TYPE, DEFAULT_DISPLAY, **metadata) + + +def json_renderer(spec, **metadata): + return json_renderer_base(spec, DEFAULT_DISPLAY, **metadata) + + +def png_renderer(spec, **metadata): + return spec_to_mimebundle( + spec, + format="png", + mode="vega-lite", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, + **metadata, + ) + + +def svg_renderer(spec, **metadata): + return spec_to_mimebundle( + spec, + format="svg", + mode="vega-lite", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, + **metadata, + ) + + +html_renderer = HTMLRenderer( + mode="vega-lite", + template="universal", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, +) + +renderers.register("default", html_renderer) +renderers.register("html", html_renderer) +renderers.register("colab", html_renderer) +renderers.register("kaggle", html_renderer) +renderers.register("zeppelin", html_renderer) +renderers.register("mimetype", mimetype_renderer) +renderers.register("jupyterlab", mimetype_renderer) +renderers.register("nteract", mimetype_renderer) +renderers.register("json", json_renderer) +renderers.register("png", png_renderer) +renderers.register("svg", svg_renderer) +renderers.enable("default") + + +class VegaLite(Displayable): + """An IPython/Jupyter display class for rendering VegaLite 5.""" + + renderers = renderers + schema_path = (__name__, "schema/vega-lite-schema.json") + + +def vegalite(spec, validate=True): + """Render and optionally validate a VegaLite 5 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. + validate: bool + Should the spec be validated against the VegaLite 5 schema? + """ + from IPython.display import display + + display(VegaLite(spec, validate=validate)) diff --git a/altair/vegalite/v5/schema/__init__.py b/altair/vegalite/v5/schema/__init__.py new file mode 100644 index 000000000..424eec291 --- /dev/null +++ b/altair/vegalite/v5/schema/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa +from .core import * +from .channels import * +SCHEMA_VERSION = 'v5.2.0' +SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.2.0.json' diff --git a/altair/vegalite/v5/schema/channels.py b/altair/vegalite/v5/schema/channels.py new file mode 100644 index 000000000..602a492ba --- /dev/null +++ b/altair/vegalite/v5/schema/channels.py @@ -0,0 +1,11875 @@ +# The contents of this file are automatically written by +# tools/generate_schema_wrapper.py. Do not modify directly. + +from . import core +import pandas as pd +from altair.utils.schemapi import Undefined +from altair.utils import parse_shorthand + + +class FieldChannelMixin(object): + def to_dict(self, validate=True, ignore=(), context=None): + context = context or {} + shorthand = self._get('shorthand') + field = self._get('field') + + if shorthand is not Undefined and field is not Undefined: + raise ValueError("{} specifies both shorthand={} and field={}. " + "".format(self.__class__.__name__, shorthand, field)) + + if isinstance(shorthand, (tuple, list)): + # If given a list of shorthands, then transform it to a list of classes + kwds = self._kwds.copy() + kwds.pop('shorthand') + return [self.__class__(sh, **kwds).to_dict(validate=validate, ignore=ignore, context=context) + for sh in shorthand] + + if shorthand is Undefined: + parsed = {} + elif isinstance(shorthand, str): + parsed = parse_shorthand(shorthand, data=context.get('data', None)) + type_required = 'type' in self._kwds + type_in_shorthand = 'type' in parsed + type_defined_explicitly = self._get('type') is not Undefined + if not type_required: + # Secondary field names don't require a type argument in VegaLite 3+. + # We still parse it out of the shorthand, but drop it here. + parsed.pop('type', None) + elif not (type_in_shorthand or type_defined_explicitly): + if isinstance(context.get('data', None), pd.DataFrame): + raise ValueError("{} encoding field is specified without a type; " + "the type cannot be inferred because it does not " + "match any column in the data.".format(shorthand)) + else: + raise ValueError("{} encoding field is specified without a type; " + "the type cannot be automatically inferred because " + "the data is not specified as a pandas.DataFrame." + "".format(shorthand)) + else: + # Shorthand is not a string; we pass the definition to field, + # and do not do any parsing. + parsed = {'field': shorthand} + + # Set shorthand to Undefined, because it's not part of the base schema. + self.shorthand = Undefined + self._kwds.update({k: v for k, v in parsed.items() + if self._get(k) is Undefined}) + return super(FieldChannelMixin, self).to_dict( + validate=validate, + ignore=ignore, + context=context + ) + + +class ValueChannelMixin(object): + def to_dict(self, validate=True, ignore=(), context=None): + context = context or {} + condition = getattr(self, 'condition', Undefined) + copy = self # don't copy unless we need to + if condition is not Undefined: + if isinstance(condition, core.SchemaBase): + pass + elif 'field' in condition and 'type' not in condition: + kwds = parse_shorthand(condition['field'], context.get('data', None)) + copy = self.copy(deep=['condition']) + copy.condition.update(kwds) + return super(ValueChannelMixin, copy).to_dict(validate=validate, + ignore=ignore, + context=context) + + +class DatumChannelMixin(object): + def to_dict(self, validate=True, ignore=(), context=None): + context = context or {} + datum = getattr(self, 'datum', Undefined) + copy = self # don't copy unless we need to + if datum is not Undefined: + if isinstance(datum, core.SchemaBase): + pass + return super(DatumChannelMixin, copy).to_dict(validate=validate, + ignore=ignore, + context=context) + + +class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """Angle schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "angle" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Angle, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, condition=condition, field=field, legend=legend, + scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class AngleDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """AngleDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "angle" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(AngleDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, + title=title, type=type, **kwds) + + +class AngleValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """AngleValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "angle" + + def __init__(self, value, condition=Undefined, **kwds): + super(AngleValue, self).__init__(value=value, condition=condition, **kwds) + + +class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): + """Color schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "color" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Color, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, condition=condition, field=field, legend=legend, + scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class ColorDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull): + """ColorDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "color" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(ColorDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, + title=title, type=type, **kwds) + + +class ColorValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """ColorValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "color" + + def __init__(self, value, condition=Undefined, **kwds): + super(ColorValue, self).__init__(value=value, condition=condition, **kwds) + + +class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): + """Column schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + align : :class:`LayoutAlign` + The alignment to apply to row/column facet's subplot. The supported string values + are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + **Default value:** ``"all"``. + 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 : anyOf(boolean, :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. + center : boolean + Boolean flag indicating if facet's subviews should be centered relative to their + respective rows or columns. + + **Default value:** ``false`` + field : :class:`Field` + **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``. + header : anyOf(:class:`Header`, None) + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, 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 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`` is not supported for ``row`` and ``column``. + spacing : float + The spacing in pixels between facet's sub-views. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "column" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, + bandPosition=Undefined, bin=Undefined, center=Undefined, field=Undefined, + header=Undefined, sort=Undefined, spacing=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(Column, self).__init__(shorthand=shorthand, aggregate=aggregate, align=align, + bandPosition=bandPosition, bin=bin, center=center, field=field, + header=header, sort=sort, spacing=spacing, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class Description(FieldChannelMixin, core.StringFieldDefWithCondition): + """Description schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "description" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Description, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, condition=condition, + field=field, format=format, formatType=formatType, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class DescriptionValue(ValueChannelMixin, core.StringValueDefWithCondition): + """DescriptionValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "description" + + def __init__(self, value, condition=Undefined, **kwds): + super(DescriptionValue, self).__init__(value=value, condition=condition, **kwds) + + +class Detail(FieldChannelMixin, core.FieldDefWithoutScale): + """Detail schema wrapper + + Mapping(required=[shorthand]) + Definition object for a data field, its type and transformation of an encoding channel. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "detail" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Detail, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): + """Facet schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + 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 : anyOf(boolean, :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. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + field : :class:`Field` + **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``. + header : anyOf(:class:`Header`, None) + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, 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 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`` is not supported for ``row`` and ``column``. + spacing : anyOf(float, :class:`RowColnumber`) + The spacing in pixels between sub-views of the composition operator. An object of + the form ``{"row": number, "column": number}`` can be used to set different spacing + values for rows and columns. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "facet" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, + bandPosition=Undefined, bin=Undefined, bounds=Undefined, center=Undefined, + columns=Undefined, field=Undefined, header=Undefined, sort=Undefined, + spacing=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Facet, self).__init__(shorthand=shorthand, aggregate=aggregate, align=align, + bandPosition=bandPosition, bin=bin, bounds=bounds, center=center, + columns=columns, field=field, header=header, sort=sort, + spacing=spacing, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): + """Fill schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "fill" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Fill, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, condition=condition, field=field, legend=legend, + scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class FillDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull): + """FillDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "fill" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(FillDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, + title=title, type=type, **kwds) + + +class FillValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """FillValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "fill" + + def __init__(self, value, condition=Undefined, **kwds): + super(FillValue, self).__init__(value=value, condition=condition, **kwds) + + +class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """FillOpacity schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "fillOpacity" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(FillOpacity, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, condition=condition, + field=field, legend=legend, scale=scale, sort=sort, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class FillOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """FillOpacityDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "fillOpacity" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(FillOpacityDatum, self).__init__(datum=datum, bandPosition=bandPosition, + condition=condition, title=title, type=type, **kwds) + + +class FillOpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """FillOpacityValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "fillOpacity" + + def __init__(self, value, condition=Undefined, **kwds): + super(FillOpacityValue, self).__init__(value=value, condition=condition, **kwds) + + +class Href(FieldChannelMixin, core.StringFieldDefWithCondition): + """Href schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "href" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Href, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, condition=condition, field=field, format=format, + formatType=formatType, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class HrefValue(ValueChannelMixin, core.StringValueDefWithCondition): + """HrefValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "href" + + def __init__(self, value, condition=Undefined, **kwds): + super(HrefValue, self).__init__(value=value, condition=condition, **kwds) + + +class Key(FieldChannelMixin, core.FieldDefWithoutScale): + """Key schema wrapper + + Mapping(required=[shorthand]) + Definition object for a data field, its type and transformation of an encoding channel. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "key" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Key, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, field=field, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class Latitude(FieldChannelMixin, core.LatLongFieldDef): + """Latitude schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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 : string + 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 = "latitude" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Latitude, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class LatitudeDatum(DatumChannelMixin, core.DatumDef): + """LatitudeDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "latitude" + def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): + super(LatitudeDatum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, + type=type, **kwds) + + +class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): + """Latitude2 schema wrapper + + Mapping(required=[shorthand]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "latitude2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Latitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class Latitude2Datum(DatumChannelMixin, core.DatumDef): + """Latitude2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "latitude2" + def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): + super(Latitude2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, + type=type, **kwds) + + +class Latitude2Value(ValueChannelMixin, core.PositionValueDef): + """Latitude2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "latitude2" + + def __init__(self, value, **kwds): + super(Latitude2Value, self).__init__(value=value, **kwds) + + +class Longitude(FieldChannelMixin, core.LatLongFieldDef): + """Longitude schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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 : string + 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 = "longitude" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Longitude, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class LongitudeDatum(DatumChannelMixin, core.DatumDef): + """LongitudeDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "longitude" + def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): + super(LongitudeDatum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, + type=type, **kwds) + + +class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): + """Longitude2 schema wrapper + + Mapping(required=[shorthand]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "longitude2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Longitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class Longitude2Datum(DatumChannelMixin, core.DatumDef): + """Longitude2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "longitude2" + def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): + super(Longitude2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, + type=type, **kwds) + + +class Longitude2Value(ValueChannelMixin, core.PositionValueDef): + """Longitude2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "longitude2" + + def __init__(self, value, **kwds): + super(Longitude2Value, self).__init__(value=value, **kwds) + + +class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """Opacity schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "opacity" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Opacity, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, condition=condition, + field=field, legend=legend, scale=scale, sort=sort, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class OpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """OpacityDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "opacity" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(OpacityDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, + title=title, type=type, **kwds) + + +class OpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """OpacityValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "opacity" + + def __init__(self, value, condition=Undefined, **kwds): + super(OpacityValue, self).__init__(value=value, condition=condition, **kwds) + + +class Order(FieldChannelMixin, core.OrderFieldDef): + """Order schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + sort : :class:`SortOrder` + The sort order. One of ``"ascending"`` (default) or ``"descending"``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "order" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, + **kwds): + super(Order, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, field=field, sort=sort, timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class OrderValue(ValueChannelMixin, core.OrderValueDef): + """OrderValue schema wrapper + + Mapping(required=[value]) + + Attributes + ---------- + + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + condition : anyOf(:class:`ConditionalValueDefnumber`, + List(:class:`ConditionalValueDefnumber`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "order" + + def __init__(self, value, condition=Undefined, **kwds): + super(OrderValue, self).__init__(value=value, condition=condition, **kwds) + + +class Radius(FieldChannelMixin, core.PositionFieldDefBase): + """Radius schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + scale : anyOf(: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 : :class:`Sort` + 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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "radius" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(Radius, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, scale=scale, + sort=sort, stack=stack, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class RadiusDatum(DatumChannelMixin, core.PositionDatumDefBase): + """RadiusDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + scale : anyOf(: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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "radius" + def __init__(self, datum, bandPosition=Undefined, scale=Undefined, stack=Undefined, title=Undefined, + type=Undefined, **kwds): + super(RadiusDatum, self).__init__(datum=datum, bandPosition=bandPosition, scale=scale, + stack=stack, title=title, type=type, **kwds) + + +class RadiusValue(ValueChannelMixin, core.PositionValueDef): + """RadiusValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "radius" + + def __init__(self, value, **kwds): + super(RadiusValue, self).__init__(value=value, **kwds) + + +class Radius2(FieldChannelMixin, core.SecondaryFieldDef): + """Radius2 schema wrapper + + Mapping(required=[shorthand]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "radius2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Radius2, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class Radius2Datum(DatumChannelMixin, core.DatumDef): + """Radius2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "radius2" + def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): + super(Radius2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, + type=type, **kwds) + + +class Radius2Value(ValueChannelMixin, core.PositionValueDef): + """Radius2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "radius2" + + def __init__(self, value, **kwds): + super(Radius2Value, self).__init__(value=value, **kwds) + + +class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): + """Row schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + align : :class:`LayoutAlign` + The alignment to apply to row/column facet's subplot. The supported string values + are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + **Default value:** ``"all"``. + 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 : anyOf(boolean, :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. + center : boolean + Boolean flag indicating if facet's subviews should be centered relative to their + respective rows or columns. + + **Default value:** ``false`` + field : :class:`Field` + **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``. + header : anyOf(:class:`Header`, None) + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, 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 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`` is not supported for ``row`` and ``column``. + spacing : float + The spacing in pixels between facet's sub-views. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "row" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, + bandPosition=Undefined, bin=Undefined, center=Undefined, field=Undefined, + header=Undefined, sort=Undefined, spacing=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(Row, self).__init__(shorthand=shorthand, aggregate=aggregate, align=align, + bandPosition=bandPosition, bin=bin, center=center, field=field, + header=header, sort=sort, spacing=spacing, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull): + """Shape schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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:`TypeForShape` + 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 = "shape" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Shape, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, condition=condition, field=field, legend=legend, + scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class ShapeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefstringnull): + """ShapeDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "shape" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(ShapeDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, + title=title, type=type, **kwds) + + +class ShapeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull): + """ShapeValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "shape" + + def __init__(self, value, condition=Undefined, **kwds): + super(ShapeValue, self).__init__(value=value, condition=condition, **kwds) + + +class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """Size schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "size" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Size, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, condition=condition, field=field, legend=legend, + scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class SizeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """SizeDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "size" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(SizeDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, + title=title, type=type, **kwds) + + +class SizeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """SizeValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "size" + + def __init__(self, value, condition=Undefined, **kwds): + super(SizeValue, self).__init__(value=value, condition=condition, **kwds) + + +class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): + """Stroke schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "stroke" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Stroke, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, condition=condition, + field=field, legend=legend, scale=scale, sort=sort, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StrokeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull): + """StrokeDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "stroke" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(StrokeDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, + title=title, type=type, **kwds) + + +class StrokeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """StrokeValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "stroke" + + def __init__(self, value, condition=Undefined, **kwds): + super(StrokeValue, self).__init__(value=value, condition=condition, **kwds) + + +class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray): + """StrokeDash schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "strokeDash" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(StrokeDash, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, condition=condition, + field=field, legend=legend, scale=scale, sort=sort, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StrokeDashDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumberArray): + """StrokeDashDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "strokeDash" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(StrokeDashDatum, self).__init__(datum=datum, bandPosition=bandPosition, + condition=condition, title=title, type=type, **kwds) + + +class StrokeDashValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray): + """StrokeDashValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(List(float), :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeDash" + + def __init__(self, value, condition=Undefined, **kwds): + super(StrokeDashValue, self).__init__(value=value, condition=condition, **kwds) + + +class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """StrokeOpacity schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "strokeOpacity" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(StrokeOpacity, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, condition=condition, + field=field, legend=legend, scale=scale, sort=sort, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StrokeOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """StrokeOpacityDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "strokeOpacity" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(StrokeOpacityDatum, self).__init__(datum=datum, bandPosition=bandPosition, + condition=condition, title=title, type=type, **kwds) + + +class StrokeOpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """StrokeOpacityValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeOpacity" + + def __init__(self, value, condition=Undefined, **kwds): + super(StrokeOpacityValue, self).__init__(value=value, condition=condition, **kwds) + + +class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """StrokeWidth schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "strokeWidth" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(StrokeWidth, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, condition=condition, + field=field, legend=legend, scale=scale, sort=sort, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StrokeWidthDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """StrokeWidthDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "strokeWidth" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, title=Undefined, + type=Undefined, **kwds): + super(StrokeWidthDatum, self).__init__(datum=datum, bandPosition=bandPosition, + condition=condition, title=title, type=type, **kwds) + + +class StrokeWidthValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """StrokeWidthValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeWidth" + + def __init__(self, value, condition=Undefined, **kwds): + super(StrokeWidthValue, self).__init__(value=value, condition=condition, **kwds) + + +class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefText): + """Text schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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. + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "text" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Text, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, condition=condition, field=field, format=format, + formatType=formatType, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class TextDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionStringDatumDefText): + """TextDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "text" + def __init__(self, datum, bandPosition=Undefined, condition=Undefined, format=Undefined, + formatType=Undefined, title=Undefined, type=Undefined, **kwds): + super(TextDatum, self).__init__(datum=datum, bandPosition=bandPosition, condition=condition, + format=format, formatType=formatType, title=title, type=type, + **kwds) + + +class TextValue(ValueChannelMixin, core.ValueDefWithConditionStringFieldDefText): + """TextValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalStringFieldDef`, + :class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(:class:`Text`, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "text" + + def __init__(self, value, condition=Undefined, **kwds): + super(TextValue, self).__init__(value=value, condition=condition, **kwds) + + +class Theta(FieldChannelMixin, core.PositionFieldDefBase): + """Theta schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + scale : anyOf(: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 : :class:`Sort` + 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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "theta" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(Theta, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, field=field, scale=scale, sort=sort, stack=stack, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class ThetaDatum(DatumChannelMixin, core.PositionDatumDefBase): + """ThetaDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + scale : anyOf(: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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "theta" + def __init__(self, datum, bandPosition=Undefined, scale=Undefined, stack=Undefined, title=Undefined, + type=Undefined, **kwds): + super(ThetaDatum, self).__init__(datum=datum, bandPosition=bandPosition, scale=scale, + stack=stack, title=title, type=type, **kwds) + + +class ThetaValue(ValueChannelMixin, core.PositionValueDef): + """ThetaValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "theta" + + def __init__(self, value, **kwds): + super(ThetaValue, self).__init__(value=value, **kwds) + + +class Theta2(FieldChannelMixin, core.SecondaryFieldDef): + """Theta2 schema wrapper + + Mapping(required=[shorthand]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "theta2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Theta2, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, timeUnit=timeUnit, + title=title, **kwds) + + +class Theta2Datum(DatumChannelMixin, core.DatumDef): + """Theta2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "theta2" + def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): + super(Theta2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, + type=type, **kwds) + + +class Theta2Value(ValueChannelMixin, core.PositionValueDef): + """Theta2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "theta2" + + def __init__(self, value, **kwds): + super(Theta2Value, self).__init__(value=value, **kwds) + + +class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): + """Tooltip schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "tooltip" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Tooltip, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, condition=condition, + field=field, format=format, formatType=formatType, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class TooltipValue(ValueChannelMixin, core.StringValueDefWithCondition): + """TooltipValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "tooltip" + + def __init__(self, value, condition=Undefined, **kwds): + super(TooltipValue, self).__init__(value=value, condition=condition, **kwds) + + +class Url(FieldChannelMixin, core.StringFieldDefWithCondition): + """Url schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "url" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Url, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, condition=condition, field=field, format=format, + formatType=formatType, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class UrlValue(ValueChannelMixin, core.StringValueDefWithCondition): + """UrlValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "url" + + def __init__(self, value, condition=Undefined, **kwds): + super(UrlValue, self).__init__(value=value, condition=condition, **kwds) + + +class X(FieldChannelMixin, core.PositionFieldDef): + """X schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + impute : anyOf(:class:`ImputeParams`, None) + An object defining the properties of the Impute Operation to be applied. The field + value of the other positional channel is taken as ``key`` of the ``Impute`` + Operation. The field of the ``color`` channel if specified is used as ``groupby`` of + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "x" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, bandPosition=Undefined, + bin=Undefined, field=Undefined, impute=Undefined, scale=Undefined, sort=Undefined, + stack=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(X, self).__init__(shorthand=shorthand, aggregate=aggregate, axis=axis, + bandPosition=bandPosition, bin=bin, field=field, impute=impute, + scale=scale, sort=sort, stack=stack, timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class XDatum(DatumChannelMixin, core.PositionDatumDef): + """XDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + impute : anyOf(:class:`ImputeParams`, None) + An object defining the properties of the Impute Operation to be applied. The field + value of the other positional channel is taken as ``key`` of the ``Impute`` + Operation. The field of the ``color`` channel if specified is used as ``groupby`` of + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + scale : anyOf(: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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "x" + def __init__(self, datum, axis=Undefined, bandPosition=Undefined, impute=Undefined, scale=Undefined, + stack=Undefined, title=Undefined, type=Undefined, **kwds): + super(XDatum, self).__init__(datum=datum, axis=axis, bandPosition=bandPosition, impute=impute, + scale=scale, stack=stack, title=title, type=type, **kwds) + + +class XValue(ValueChannelMixin, core.PositionValueDef): + """XValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "x" + + def __init__(self, value, **kwds): + super(XValue, self).__init__(value=value, **kwds) + + +class X2(FieldChannelMixin, core.SecondaryFieldDef): + """X2 schema wrapper + + Mapping(required=[shorthand]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "x2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(X2, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, field=field, timeUnit=timeUnit, title=title, **kwds) + + +class X2Datum(DatumChannelMixin, core.DatumDef): + """X2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "x2" + def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): + super(X2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, type=type, + **kwds) + + +class X2Value(ValueChannelMixin, core.PositionValueDef): + """X2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "x2" + + def __init__(self, value, **kwds): + super(X2Value, self).__init__(value=value, **kwds) + + +class XError(FieldChannelMixin, core.SecondaryFieldDef): + """XError schema wrapper + + Mapping(required=[shorthand]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "xError" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(XError, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, timeUnit=timeUnit, + title=title, **kwds) + + +class XErrorValue(ValueChannelMixin, core.ValueDefnumber): + """XErrorValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "xError" + + def __init__(self, value, **kwds): + super(XErrorValue, self).__init__(value=value, **kwds) + + +class XError2(FieldChannelMixin, core.SecondaryFieldDef): + """XError2 schema wrapper + + Mapping(required=[shorthand]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "xError2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(XError2, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class XError2Value(ValueChannelMixin, core.ValueDefnumber): + """XError2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "xError2" + + def __init__(self, value, **kwds): + super(XError2Value, self).__init__(value=value, **kwds) + + +class XOffset(FieldChannelMixin, core.ScaleFieldDef): + """XOffset schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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 : :class:`Field` + **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``. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "xOffset" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, + type=Undefined, **kwds): + super(XOffset, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class XOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): + """XOffsetDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + scale : anyOf(: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. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "xOffset" + def __init__(self, datum, bandPosition=Undefined, scale=Undefined, title=Undefined, type=Undefined, + **kwds): + super(XOffsetDatum, self).__init__(datum=datum, bandPosition=bandPosition, scale=scale, + title=title, type=type, **kwds) + + +class XOffsetValue(ValueChannelMixin, core.ValueDefnumber): + """XOffsetValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "xOffset" + + def __init__(self, value, **kwds): + super(XOffsetValue, self).__init__(value=value, **kwds) + + +class Y(FieldChannelMixin, core.PositionFieldDef): + """Y schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + impute : anyOf(:class:`ImputeParams`, None) + An object defining the properties of the Impute Operation to be applied. The field + value of the other positional channel is taken as ``key`` of the ``Impute`` + Operation. The field of the ``color`` channel if specified is used as ``groupby`` of + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "y" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, bandPosition=Undefined, + bin=Undefined, field=Undefined, impute=Undefined, scale=Undefined, sort=Undefined, + stack=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Y, self).__init__(shorthand=shorthand, aggregate=aggregate, axis=axis, + bandPosition=bandPosition, bin=bin, field=field, impute=impute, + scale=scale, sort=sort, stack=stack, timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class YDatum(DatumChannelMixin, core.PositionDatumDef): + """YDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + impute : anyOf(:class:`ImputeParams`, None) + An object defining the properties of the Impute Operation to be applied. The field + value of the other positional channel is taken as ``key`` of the ``Impute`` + Operation. The field of the ``color`` channel if specified is used as ``groupby`` of + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + scale : anyOf(: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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "y" + def __init__(self, datum, axis=Undefined, bandPosition=Undefined, impute=Undefined, scale=Undefined, + stack=Undefined, title=Undefined, type=Undefined, **kwds): + super(YDatum, self).__init__(datum=datum, axis=axis, bandPosition=bandPosition, impute=impute, + scale=scale, stack=stack, title=title, type=type, **kwds) + + +class YValue(ValueChannelMixin, core.PositionValueDef): + """YValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "y" + + def __init__(self, value, **kwds): + super(YValue, self).__init__(value=value, **kwds) + + +class Y2(FieldChannelMixin, core.SecondaryFieldDef): + """Y2 schema wrapper + + Mapping(required=[shorthand]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "y2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Y2, self).__init__(shorthand=shorthand, aggregate=aggregate, bandPosition=bandPosition, + bin=bin, field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Y2Datum(DatumChannelMixin, core.DatumDef): + """Y2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "y2" + def __init__(self, datum, bandPosition=Undefined, title=Undefined, type=Undefined, **kwds): + super(Y2Datum, self).__init__(datum=datum, bandPosition=bandPosition, title=title, type=type, + **kwds) + + +class Y2Value(ValueChannelMixin, core.PositionValueDef): + """Y2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "y2" + + def __init__(self, value, **kwds): + super(Y2Value, self).__init__(value=value, **kwds) + + +class YError(FieldChannelMixin, core.SecondaryFieldDef): + """YError schema wrapper + + Mapping(required=[shorthand]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "yError" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(YError, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, timeUnit=timeUnit, + title=title, **kwds) + + +class YErrorValue(ValueChannelMixin, core.ValueDefnumber): + """YErrorValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "yError" + + def __init__(self, value, **kwds): + super(YErrorValue, self).__init__(value=value, **kwds) + + +class YError2(FieldChannelMixin, core.SecondaryFieldDef): + """YError2 schema wrapper + + Mapping(required=[shorthand]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "yError2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(YError2, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class YError2Value(ValueChannelMixin, core.ValueDefnumber): + """YError2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "yError2" + + def __init__(self, value, **kwds): + super(YError2Value, self).__init__(value=value, **kwds) + + +class YOffset(FieldChannelMixin, core.ScaleFieldDef): + """YOffset schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + shorthand : string + shorthand for field, aggregate, and type + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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 : :class:`Field` + **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``. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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 = "yOffset" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, + type=Undefined, **kwds): + super(YOffset, self).__init__(shorthand=shorthand, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, field=field, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class YOffsetDatum(DatumChannelMixin, core.ScaleDatumDef): + """YOffsetDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + scale : anyOf(: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. + title : anyOf(:class:`Text`, 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:`Type` + 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 = "yOffset" + def __init__(self, datum, bandPosition=Undefined, scale=Undefined, title=Undefined, type=Undefined, + **kwds): + super(YOffsetDatum, self).__init__(datum=datum, bandPosition=bandPosition, scale=scale, + title=title, type=type, **kwds) + + +class YOffsetValue(ValueChannelMixin, core.ValueDefnumber): + """YOffsetValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "yOffset" + + def __init__(self, value, **kwds): + super(YOffsetValue, self).__init__(value=value, **kwds) diff --git a/altair/vegalite/v5/schema/core.py b/altair/vegalite/v5/schema/core.py new file mode 100644 index 000000000..a63d8cda4 --- /dev/null +++ b/altair/vegalite/v5/schema/core.py @@ -0,0 +1,20186 @@ +# The contents of this file are automatically written by +# tools/generate_schema_wrapper.py. Do not modify directly. + +from altair.utils.schemapi import SchemaBase, Undefined, _subclasses + +import pkgutil +import json + +def load_schema(): + """Load the json schema associated with this module's functions""" + return json.loads(pkgutil.get_data(__name__, 'vega-lite-schema.json').decode('utf-8')) + + +class VegaLiteSchema(SchemaBase): + _rootschema = load_schema() + @classmethod + def _default_wrapper_classes(cls): + return _subclasses(VegaLiteSchema) + + +class Root(VegaLiteSchema): + """Root schema wrapper + + anyOf(:class:`TopLevelUnitSpec`, :class:`TopLevelFacetSpec`, :class:`TopLevelLayerSpec`, + :class:`TopLevelRepeatSpec`, :class:`TopLevelConcatSpec`, :class:`TopLevelVConcatSpec`, + :class:`TopLevelHConcatSpec`) + A Vega-Lite top-level specification. This is the root class for all Vega-Lite + specifications. (The json schema is generated from this type.) + """ + _schema = VegaLiteSchema._rootschema + + def __init__(self, *args, **kwds): + super(Root, self).__init__(*args, **kwds) + + +class Aggregate(VegaLiteSchema): + """Aggregate schema wrapper + + anyOf(:class:`NonArgAggregateOp`, :class:`ArgmaxDef`, :class:`ArgminDef`) + """ + _schema = {'$ref': '#/definitions/Aggregate'} + + def __init__(self, *args, **kwds): + super(Aggregate, self).__init__(*args, **kwds) + + +class AggregateOp(VegaLiteSchema): + """AggregateOp schema wrapper + + enum('argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', + 'missing', 'product', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', + 'values', 'variance', 'variancep') + """ + _schema = {'$ref': '#/definitions/AggregateOp'} + + def __init__(self, *args): + super(AggregateOp, self).__init__(*args) + + +class AggregatedFieldDef(VegaLiteSchema): + """AggregatedFieldDef schema wrapper + + Mapping(required=[op, as]) + + Attributes + ---------- + + op : :class:`AggregateOp` + The aggregation operation to apply to the fields (e.g., ``"sum"``, ``"average"``, or + ``"count"`` ). See the `full list of supported aggregation operations + `__ for more information. + field : :class:`FieldName` + The data field for which to compute aggregate function. This is required for all + aggregation operations except ``"count"``. + as : :class:`FieldName` + The output field names to use for each aggregated field. + """ + _schema = {'$ref': '#/definitions/AggregatedFieldDef'} + + def __init__(self, op=Undefined, field=Undefined, **kwds): + super(AggregatedFieldDef, self).__init__(op=op, field=field, **kwds) + + +class Align(VegaLiteSchema): + """Align schema wrapper + + enum('left', 'center', 'right') + """ + _schema = {'$ref': '#/definitions/Align'} + + def __init__(self, *args): + super(Align, self).__init__(*args) + + +class AnyMark(VegaLiteSchema): + """AnyMark schema wrapper + + anyOf(:class:`CompositeMark`, :class:`CompositeMarkDef`, :class:`Mark`, :class:`MarkDef`) + """ + _schema = {'$ref': '#/definitions/AnyMark'} + + def __init__(self, *args, **kwds): + super(AnyMark, self).__init__(*args, **kwds) + + +class AnyMarkConfig(VegaLiteSchema): + """AnyMarkConfig schema wrapper + + anyOf(:class:`MarkConfig`, :class:`AreaConfig`, :class:`BarConfig`, :class:`RectConfig`, + :class:`LineConfig`, :class:`TickConfig`) + """ + _schema = {'$ref': '#/definitions/AnyMarkConfig'} + + def __init__(self, *args, **kwds): + super(AnyMarkConfig, self).__init__(*args, **kwds) + + +class AreaConfig(AnyMarkConfig): + """AreaConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). + One of ``"left"``, ``"right"``, ``"center"``. + + **Note:** Expression reference is *not* supported for range marks. + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an + expression reference that provides one of the valid values. The ``"line-top"`` and + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default fill color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove fill. + + **Default value:** (None) + fillOpacity : anyOf(float, :class:`ExprRef`) + + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + + **Default value:** ``0`` + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). + + + * If set to ``"filter"`` (default), all data items with null values will be skipped + (for line, trail, and area marks) or filtered (for other marks). + * If ``null``, all data items are included. In this case, invalid values will be + interpreted as zeroes. + limit : anyOf(float, :class:`ExprRef`) + + line : anyOf(boolean, :class:`OverlayMarkDef`) + A flag for overlaying line on top of area marks, or an object defining the + properties of the overlayed lines. + + + If this value is an empty object ( ``{}`` ) or ``true``, lines with default + properties will be used. + + If this value is ``false``, no lines would be automatically added to area marks. + + **Default value:** ``false``. + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). + + **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, + ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. + order : anyOf(None, boolean) + For line and trail marks, this ``order`` property can be set to ``null`` or + ``false`` to make the lines use the original order in the data sources. + orient : :class:`Orientation` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + the line if ``config.sortLineBy`` is not specified. For stacked charts, this is + always determined by the orientation of the stack; therefore explicitly specified + value will be ignored. + outerRadius : anyOf(float, :class:`ExprRef`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + + **Default value:** ``0`` + padAngle : anyOf(float, :class:`ExprRef`) + + point : anyOf(boolean, :class:`OverlayMarkDef`, string) + A flag for overlaying points on top of line or area marks, or an object defining the + properties of the overlayed points. + + + If this property is ``"transparent"``, transparent points will be used (for + enhancing tooltips and selections). + + If this property is an empty object ( ``{}`` ) or ``true``, filled points with + default properties will be used. + + If this property is ``false``, no points would be automatically added to line or + area marks. + + **Default value:** ``false``. + radius : anyOf(float, :class:`ExprRef`) + For arc mark, the primary (outer) radius in pixels. + + For text marks, polar coordinate radial offset, in pixels, of the text from the + origin determined by the ``x`` and ``y`` properties. + + **Default value:** ``min(plot_width, plot_height)/2`` + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + + **Default value:** ``0`` + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. Note that this value sets the area of the symbol; the side lengths will + increase with the square root of this value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** + + + * ``30`` for point, circle, square marks; width/height's ``step`` + * ``2`` for bar marks with discrete dimensions; + * ``5`` for bar marks with continuous dimensions; + * ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default stroke color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove stroke. + + **Default value:** (None) + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : anyOf(float, :class:`ExprRef`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + 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 + will be positioned in the middle of the time unit band step. + timeUnitBandSize : float + Default relative band size for a time unit. If set to ``1``, the bandwidth of the + marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the + marks will be half of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : anyOf(float, string, :class:`ExprRef`) + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + y : anyOf(float, string, :class:`ExprRef`) + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : anyOf(float, string, :class:`ExprRef`) + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + """ + _schema = {'$ref': '#/definitions/AreaConfig'} + + def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, blend=Undefined, + color=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, + cornerRadiusBottomRight=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, + dx=Undefined, dy=Undefined, ellipsis=Undefined, endAngle=Undefined, fill=Undefined, + fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, + fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, + innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, limit=Undefined, + line=Undefined, lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, outerRadius=Undefined, padAngle=Undefined, + point=Undefined, radius=Undefined, radius2=Undefined, shape=Undefined, size=Undefined, + smooth=Undefined, startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + theta2=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + y=Undefined, y2=Undefined, **kwds): + super(AreaConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, + baseline=baseline, blend=blend, color=color, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, + description=description, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, endAngle=endAngle, fill=fill, + fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, + interpolate=interpolate, invalid=invalid, limit=limit, + line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, + outerRadius=outerRadius, padAngle=padAngle, point=point, + radius=radius, radius2=radius2, shape=shape, size=size, + smooth=smooth, startAngle=startAngle, stroke=stroke, + strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, theta2=theta2, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, + width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class ArgmaxDef(Aggregate): + """ArgmaxDef schema wrapper + + Mapping(required=[argmax]) + + Attributes + ---------- + + argmax : :class:`FieldName` + + """ + _schema = {'$ref': '#/definitions/ArgmaxDef'} + + def __init__(self, argmax=Undefined, **kwds): + super(ArgmaxDef, self).__init__(argmax=argmax, **kwds) + + +class ArgminDef(Aggregate): + """ArgminDef schema wrapper + + Mapping(required=[argmin]) + + Attributes + ---------- + + argmin : :class:`FieldName` + + """ + _schema = {'$ref': '#/definitions/ArgminDef'} + + def __init__(self, argmin=Undefined, **kwds): + super(ArgminDef, self).__init__(argmin=argmin, **kwds) + + +class AutoSizeParams(VegaLiteSchema): + """AutoSizeParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + contains : enum('content', 'padding') + Determines how size calculation should be performed, one of ``"content"`` or + ``"padding"``. The default setting ( ``"content"`` ) interprets the width and height + settings as the data rectangle (plotting) dimensions, to which padding is then + added. In contrast, the ``"padding"`` setting includes the padding within the view + size calculations, such that the width and height settings indicate the **total** + intended size of the view. + + **Default value** : ``"content"`` + resize : boolean + A boolean flag indicating if autosize layout should be re-calculated on every view + update. + + **Default value** : ``false`` + type : :class:`AutosizeType` + The sizing format type. One of ``"pad"``, ``"fit"``, ``"fit-x"``, ``"fit-y"``, or + ``"none"``. See the `autosize type + `__ documentation for + descriptions of each. + + **Default value** : ``"pad"`` + """ + _schema = {'$ref': '#/definitions/AutoSizeParams'} + + def __init__(self, contains=Undefined, resize=Undefined, type=Undefined, **kwds): + super(AutoSizeParams, self).__init__(contains=contains, resize=resize, type=type, **kwds) + + +class AutosizeType(VegaLiteSchema): + """AutosizeType schema wrapper + + enum('pad', 'none', 'fit', 'fit-x', 'fit-y') + """ + _schema = {'$ref': '#/definitions/AutosizeType'} + + def __init__(self, *args): + super(AutosizeType, self).__init__(*args) + + +class Axis(VegaLiteSchema): + """Axis schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aria : anyOf(boolean, :class:`ExprRef`) + + bandPosition : anyOf(float, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + domain : boolean + A boolean flag indicating if the domain (the axis baseline) should be included as + part of the axis. + + **Default value:** ``true`` + domainCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + domainColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + domainDash : anyOf(List(float), :class:`ExprRef`) + + domainDashOffset : anyOf(float, :class:`ExprRef`) + + domainOpacity : anyOf(float, :class:`ExprRef`) + + domainWidth : anyOf(float, :class:`ExprRef`) + + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + grid : boolean + A boolean flag indicating if grid lines should be included as part of the axis + + **Default value:** ``true`` for `continuous scales + `__ that are not + binned; otherwise, ``false``. + gridCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + gridColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + gridDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + + gridDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + gridOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + gridWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`, :class:`ConditionalAxisLabelAlign`) + + labelAngle : anyOf(float, :class:`ExprRef`) + + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`, + :class:`ConditionalAxisLabelBaseline`) + + labelBound : anyOf(anyOf(float, boolean), :class:`ExprRef`) + + labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + labelExpr : string + `Vega expression `__ for customizing + labels. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + labelFlush : anyOf(boolean, float) + Indicates if the first and last axis labels should be aligned flush with the scale + range. Flush alignment for a horizontal axis will left-align the first label and + right-align the last label. For vertical axes, bottom and top text baselines are + applied instead. If this property is a number, it also indicates the number of + pixels by which to offset the first and last labels; for example, a value of 2 will + flush-align the first and last labels and also push them 2 pixels outward from the + center of the axis. The additional adjustment can sometimes help the labels better + visually group with corresponding axis ticks. + + **Default value:** ``true`` for axis of a continuous x-scale. Otherwise, ``false``. + labelFlushOffset : anyOf(float, :class:`ExprRef`) + + labelFont : anyOf(string, :class:`ExprRef`, :class:`ConditionalAxisString`) + + labelFontSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontStyle`) + + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontWeight`) + + labelLimit : anyOf(float, :class:`ExprRef`) + + labelLineHeight : anyOf(float, :class:`ExprRef`) + + labelOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + The strategy to use for resolving overlap of axis labels. If ``false`` (the + default), no overlap reduction is attempted. If set to ``true`` or ``"parity"``, a + strategy of removing every other label is used (this works well for standard linear + axes). If set to ``"greedy"``, a linear scan of the labels is performed, removing + any labels that overlaps with the last visible label (this often works better for + log-scaled axes). + + **Default value:** ``true`` for non-nominal fields with non-log scales; ``"greedy"`` + for log scales; otherwise ``false``. + labelPadding : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelSeparation : anyOf(float, :class:`ExprRef`) + + labels : boolean + A boolean flag indicating if labels should be included as part of the axis. + + **Default value:** ``true``. + maxExtent : anyOf(float, :class:`ExprRef`) + + minExtent : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + The offset, in pixels, by which to displace the axis from the edge of the enclosing + group or data rectangle. + + **Default value:** derived from the `axis config + `__ 's + ``offset`` ( ``0`` by default) + orient : anyOf(:class:`AxisOrient`, :class:`ExprRef`) + The orientation of the axis. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. The orientation can be used to further specialize the axis type (e.g., + a y-axis oriented towards the right edge of the chart). + + **Default value:** ``"bottom"`` for x-axes and ``"left"`` for y-axes. + position : anyOf(float, :class:`ExprRef`) + The anchor position of the axis in pixels. For x-axes with top or bottom + orientation, this sets the axis group x coordinate. For y-axes with left or right + orientation, this sets the axis group y coordinate. + + **Default value** : ``0`` + style : anyOf(string, List(string)) + A string or array of strings indicating the name of custom styles to apply to the + axis. A style is a named collection of axis property defined within the `style + configuration `__. If + style is an array, later styles will override earlier styles. + + **Default value:** (none) **Note:** Any specified style will augment the default + style. For example, an x-axis mark with ``"style": "foo"`` will use ``config.axisX`` + and ``config.style.foo`` (the specified style ``"foo"`` has higher precedence). + tickBand : anyOf(enum('center', 'extent'), :class:`ExprRef`) + + tickCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + tickColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + tickCount : anyOf(float, :class:`TimeInterval`, :class:`TimeIntervalStep`, :class:`ExprRef`) + A desired number of ticks, for axes visualizing quantitative scales. The resulting + number may be different so that values are "nice" (multiples of 2, 5, 10) and lie + within the underlying scale's range. + + For scales of type ``"time"`` or ``"utc"``, the tick count can instead be a time + interval specifier. Legal string values are ``"millisecond"``, ``"second"``, + ``"minute"``, ``"hour"``, ``"day"``, ``"week"``, ``"month"``, and ``"year"``. + Alternatively, an object-valued interval specifier of the form ``{"interval": + "month", "step": 3}`` includes a desired number of interval steps. Here, ticks are + generated for each quarter (Jan, Apr, Jul, Oct) boundary. + + **Default value** : Determine using a formula ``ceil(width/40)`` for x and + ``ceil(height/40)`` for y. + tickDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + + tickDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickExtra : boolean + Boolean flag indicating if an extra axis tick should be added for the initial + position of the axis. This flag is useful for styling axes for ``band`` scales such + that ticks are placed on band boundaries rather in the middle of a band. Use in + conjunction with ``"bandPosition": 1`` and an axis ``"padding"`` value of ``0``. + tickMinStep : anyOf(float, :class:`ExprRef`) + The minimum desired step between axis ticks, in terms of scale domain values. For + example, a value of ``1`` indicates that ticks should not be less than 1 unit apart. + If ``tickMinStep`` is specified, the ``tickCount`` value will be adjusted, if + necessary, to enforce the minimum step value. + tickOffset : anyOf(float, :class:`ExprRef`) + + tickOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickRound : boolean + Boolean flag indicating if pixel position values should be rounded to the nearest + integer. + + **Default value:** ``true`` + tickSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + ticks : boolean + Boolean value that determines whether the axis should include ticks. + + **Default value:** ``true`` + title : anyOf(:class:`Text`, 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. + titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + + titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + titleAngle : anyOf(float, :class:`ExprRef`) + + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + titleFont : anyOf(string, :class:`ExprRef`) + + titleFontSize : anyOf(float, :class:`ExprRef`) + + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + titleLimit : anyOf(float, :class:`ExprRef`) + + titleLineHeight : anyOf(float, :class:`ExprRef`) + + titleOpacity : anyOf(float, :class:`ExprRef`) + + titlePadding : anyOf(float, :class:`ExprRef`) + + titleX : anyOf(float, :class:`ExprRef`) + + titleY : anyOf(float, :class:`ExprRef`) + + translate : anyOf(float, :class:`ExprRef`) + + values : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`), + :class:`ExprRef`) + Explicitly set the visible axis tick values. + zindex : float + A non-negative integer indicating the z-index of the axis. If zindex is 0, axes + should be drawn behind all chart elements. To put them in front, set ``zindex`` to + ``1`` or more. + + **Default value:** ``0`` (behind the marks). + """ + _schema = {'$ref': '#/definitions/Axis'} + + def __init__(self, aria=Undefined, bandPosition=Undefined, description=Undefined, domain=Undefined, + domainCap=Undefined, domainColor=Undefined, domainDash=Undefined, + domainDashOffset=Undefined, domainOpacity=Undefined, domainWidth=Undefined, + format=Undefined, formatType=Undefined, grid=Undefined, gridCap=Undefined, + gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, + gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, + labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, + labelExpr=Undefined, labelFlush=Undefined, labelFlushOffset=Undefined, + labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, + labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, + labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, + labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, + maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, + position=Undefined, style=Undefined, tickBand=Undefined, tickCap=Undefined, + tickColor=Undefined, tickCount=Undefined, tickDash=Undefined, tickDashOffset=Undefined, + tickExtra=Undefined, tickMinStep=Undefined, tickOffset=Undefined, + tickOpacity=Undefined, tickRound=Undefined, tickSize=Undefined, tickWidth=Undefined, + ticks=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, + titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, + titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, + titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, + titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, + translate=Undefined, values=Undefined, zindex=Undefined, **kwds): + super(Axis, self).__init__(aria=aria, bandPosition=bandPosition, description=description, + domain=domain, domainCap=domainCap, domainColor=domainColor, + domainDash=domainDash, domainDashOffset=domainDashOffset, + domainOpacity=domainOpacity, domainWidth=domainWidth, format=format, + formatType=formatType, grid=grid, gridCap=gridCap, + gridColor=gridColor, gridDash=gridDash, + gridDashOffset=gridDashOffset, gridOpacity=gridOpacity, + gridWidth=gridWidth, labelAlign=labelAlign, labelAngle=labelAngle, + labelBaseline=labelBaseline, labelBound=labelBound, + labelColor=labelColor, labelExpr=labelExpr, labelFlush=labelFlush, + labelFlushOffset=labelFlushOffset, labelFont=labelFont, + labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, labelLimit=labelLimit, + labelLineHeight=labelLineHeight, labelOffset=labelOffset, + labelOpacity=labelOpacity, labelOverlap=labelOverlap, + labelPadding=labelPadding, labelSeparation=labelSeparation, + labels=labels, maxExtent=maxExtent, minExtent=minExtent, + offset=offset, orient=orient, position=position, style=style, + tickBand=tickBand, tickCap=tickCap, tickColor=tickColor, + tickCount=tickCount, tickDash=tickDash, + tickDashOffset=tickDashOffset, tickExtra=tickExtra, + tickMinStep=tickMinStep, tickOffset=tickOffset, + tickOpacity=tickOpacity, tickRound=tickRound, tickSize=tickSize, + tickWidth=tickWidth, ticks=ticks, title=title, titleAlign=titleAlign, + titleAnchor=titleAnchor, titleAngle=titleAngle, + titleBaseline=titleBaseline, titleColor=titleColor, + titleFont=titleFont, titleFontSize=titleFontSize, + titleFontStyle=titleFontStyle, titleFontWeight=titleFontWeight, + titleLimit=titleLimit, titleLineHeight=titleLineHeight, + titleOpacity=titleOpacity, titlePadding=titlePadding, titleX=titleX, + titleY=titleY, translate=translate, values=values, zindex=zindex, + **kwds) + + +class AxisConfig(VegaLiteSchema): + """AxisConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aria : anyOf(boolean, :class:`ExprRef`) + + bandPosition : anyOf(float, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + disable : boolean + Disable axis by default. + domain : boolean + A boolean flag indicating if the domain (the axis baseline) should be included as + part of the axis. + + **Default value:** ``true`` + domainCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + domainColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + domainDash : anyOf(List(float), :class:`ExprRef`) + + domainDashOffset : anyOf(float, :class:`ExprRef`) + + domainOpacity : anyOf(float, :class:`ExprRef`) + + domainWidth : anyOf(float, :class:`ExprRef`) + + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + grid : boolean + A boolean flag indicating if grid lines should be included as part of the axis + + **Default value:** ``true`` for `continuous scales + `__ that are not + binned; otherwise, ``false``. + gridCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + gridColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + gridDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + + gridDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + gridOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + gridWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`, :class:`ConditionalAxisLabelAlign`) + + labelAngle : anyOf(float, :class:`ExprRef`) + + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`, + :class:`ConditionalAxisLabelBaseline`) + + labelBound : anyOf(anyOf(float, boolean), :class:`ExprRef`) + + labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + labelExpr : string + `Vega expression `__ for customizing + labels. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + labelFlush : anyOf(boolean, float) + Indicates if the first and last axis labels should be aligned flush with the scale + range. Flush alignment for a horizontal axis will left-align the first label and + right-align the last label. For vertical axes, bottom and top text baselines are + applied instead. If this property is a number, it also indicates the number of + pixels by which to offset the first and last labels; for example, a value of 2 will + flush-align the first and last labels and also push them 2 pixels outward from the + center of the axis. The additional adjustment can sometimes help the labels better + visually group with corresponding axis ticks. + + **Default value:** ``true`` for axis of a continuous x-scale. Otherwise, ``false``. + labelFlushOffset : anyOf(float, :class:`ExprRef`) + + labelFont : anyOf(string, :class:`ExprRef`, :class:`ConditionalAxisString`) + + labelFontSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontStyle`) + + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontWeight`) + + labelLimit : anyOf(float, :class:`ExprRef`) + + labelLineHeight : anyOf(float, :class:`ExprRef`) + + labelOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + The strategy to use for resolving overlap of axis labels. If ``false`` (the + default), no overlap reduction is attempted. If set to ``true`` or ``"parity"``, a + strategy of removing every other label is used (this works well for standard linear + axes). If set to ``"greedy"``, a linear scan of the labels is performed, removing + any labels that overlaps with the last visible label (this often works better for + log-scaled axes). + + **Default value:** ``true`` for non-nominal fields with non-log scales; ``"greedy"`` + for log scales; otherwise ``false``. + labelPadding : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelSeparation : anyOf(float, :class:`ExprRef`) + + labels : boolean + A boolean flag indicating if labels should be included as part of the axis. + + **Default value:** ``true``. + maxExtent : anyOf(float, :class:`ExprRef`) + + minExtent : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + The offset, in pixels, by which to displace the axis from the edge of the enclosing + group or data rectangle. + + **Default value:** derived from the `axis config + `__ 's + ``offset`` ( ``0`` by default) + orient : anyOf(:class:`AxisOrient`, :class:`ExprRef`) + The orientation of the axis. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. The orientation can be used to further specialize the axis type (e.g., + a y-axis oriented towards the right edge of the chart). + + **Default value:** ``"bottom"`` for x-axes and ``"left"`` for y-axes. + position : anyOf(float, :class:`ExprRef`) + The anchor position of the axis in pixels. For x-axes with top or bottom + orientation, this sets the axis group x coordinate. For y-axes with left or right + orientation, this sets the axis group y coordinate. + + **Default value** : ``0`` + style : anyOf(string, List(string)) + A string or array of strings indicating the name of custom styles to apply to the + axis. A style is a named collection of axis property defined within the `style + configuration `__. If + style is an array, later styles will override earlier styles. + + **Default value:** (none) **Note:** Any specified style will augment the default + style. For example, an x-axis mark with ``"style": "foo"`` will use ``config.axisX`` + and ``config.style.foo`` (the specified style ``"foo"`` has higher precedence). + tickBand : anyOf(enum('center', 'extent'), :class:`ExprRef`) + + tickCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + tickColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + tickCount : anyOf(float, :class:`TimeInterval`, :class:`TimeIntervalStep`, :class:`ExprRef`) + A desired number of ticks, for axes visualizing quantitative scales. The resulting + number may be different so that values are "nice" (multiples of 2, 5, 10) and lie + within the underlying scale's range. + + For scales of type ``"time"`` or ``"utc"``, the tick count can instead be a time + interval specifier. Legal string values are ``"millisecond"``, ``"second"``, + ``"minute"``, ``"hour"``, ``"day"``, ``"week"``, ``"month"``, and ``"year"``. + Alternatively, an object-valued interval specifier of the form ``{"interval": + "month", "step": 3}`` includes a desired number of interval steps. Here, ticks are + generated for each quarter (Jan, Apr, Jul, Oct) boundary. + + **Default value** : Determine using a formula ``ceil(width/40)`` for x and + ``ceil(height/40)`` for y. + tickDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + + tickDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickExtra : boolean + Boolean flag indicating if an extra axis tick should be added for the initial + position of the axis. This flag is useful for styling axes for ``band`` scales such + that ticks are placed on band boundaries rather in the middle of a band. Use in + conjunction with ``"bandPosition": 1`` and an axis ``"padding"`` value of ``0``. + tickMinStep : anyOf(float, :class:`ExprRef`) + The minimum desired step between axis ticks, in terms of scale domain values. For + example, a value of ``1`` indicates that ticks should not be less than 1 unit apart. + If ``tickMinStep`` is specified, the ``tickCount`` value will be adjusted, if + necessary, to enforce the minimum step value. + tickOffset : anyOf(float, :class:`ExprRef`) + + tickOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickRound : boolean + Boolean flag indicating if pixel position values should be rounded to the nearest + integer. + + **Default value:** ``true`` + tickSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + ticks : boolean + Boolean value that determines whether the axis should include ticks. + + **Default value:** ``true`` + title : anyOf(:class:`Text`, 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. + titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + + titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + titleAngle : anyOf(float, :class:`ExprRef`) + + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + titleFont : anyOf(string, :class:`ExprRef`) + + titleFontSize : anyOf(float, :class:`ExprRef`) + + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + titleLimit : anyOf(float, :class:`ExprRef`) + + titleLineHeight : anyOf(float, :class:`ExprRef`) + + titleOpacity : anyOf(float, :class:`ExprRef`) + + titlePadding : anyOf(float, :class:`ExprRef`) + + titleX : anyOf(float, :class:`ExprRef`) + + titleY : anyOf(float, :class:`ExprRef`) + + translate : anyOf(float, :class:`ExprRef`) + + values : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`), + :class:`ExprRef`) + Explicitly set the visible axis tick values. + zindex : float + A non-negative integer indicating the z-index of the axis. If zindex is 0, axes + should be drawn behind all chart elements. To put them in front, set ``zindex`` to + ``1`` or more. + + **Default value:** ``0`` (behind the marks). + """ + _schema = {'$ref': '#/definitions/AxisConfig'} + + def __init__(self, aria=Undefined, bandPosition=Undefined, description=Undefined, disable=Undefined, + domain=Undefined, domainCap=Undefined, domainColor=Undefined, domainDash=Undefined, + domainDashOffset=Undefined, domainOpacity=Undefined, domainWidth=Undefined, + format=Undefined, formatType=Undefined, grid=Undefined, gridCap=Undefined, + gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, + gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, + labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, + labelExpr=Undefined, labelFlush=Undefined, labelFlushOffset=Undefined, + labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, + labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, + labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, + labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, + maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, + position=Undefined, style=Undefined, tickBand=Undefined, tickCap=Undefined, + tickColor=Undefined, tickCount=Undefined, tickDash=Undefined, tickDashOffset=Undefined, + tickExtra=Undefined, tickMinStep=Undefined, tickOffset=Undefined, + tickOpacity=Undefined, tickRound=Undefined, tickSize=Undefined, tickWidth=Undefined, + ticks=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, + titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, + titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, + titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, + titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, + translate=Undefined, values=Undefined, zindex=Undefined, **kwds): + super(AxisConfig, self).__init__(aria=aria, bandPosition=bandPosition, description=description, + disable=disable, domain=domain, domainCap=domainCap, + domainColor=domainColor, domainDash=domainDash, + domainDashOffset=domainDashOffset, domainOpacity=domainOpacity, + domainWidth=domainWidth, format=format, formatType=formatType, + grid=grid, gridCap=gridCap, gridColor=gridColor, + gridDash=gridDash, gridDashOffset=gridDashOffset, + gridOpacity=gridOpacity, gridWidth=gridWidth, + labelAlign=labelAlign, labelAngle=labelAngle, + labelBaseline=labelBaseline, labelBound=labelBound, + labelColor=labelColor, labelExpr=labelExpr, + labelFlush=labelFlush, labelFlushOffset=labelFlushOffset, + labelFont=labelFont, labelFontSize=labelFontSize, + labelFontStyle=labelFontStyle, labelFontWeight=labelFontWeight, + labelLimit=labelLimit, labelLineHeight=labelLineHeight, + labelOffset=labelOffset, labelOpacity=labelOpacity, + labelOverlap=labelOverlap, labelPadding=labelPadding, + labelSeparation=labelSeparation, labels=labels, + maxExtent=maxExtent, minExtent=minExtent, offset=offset, + orient=orient, position=position, style=style, + tickBand=tickBand, tickCap=tickCap, tickColor=tickColor, + tickCount=tickCount, tickDash=tickDash, + tickDashOffset=tickDashOffset, tickExtra=tickExtra, + tickMinStep=tickMinStep, tickOffset=tickOffset, + tickOpacity=tickOpacity, tickRound=tickRound, + tickSize=tickSize, tickWidth=tickWidth, ticks=ticks, + title=title, titleAlign=titleAlign, titleAnchor=titleAnchor, + titleAngle=titleAngle, titleBaseline=titleBaseline, + titleColor=titleColor, titleFont=titleFont, + titleFontSize=titleFontSize, titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, titleLimit=titleLimit, + titleLineHeight=titleLineHeight, titleOpacity=titleOpacity, + titlePadding=titlePadding, titleX=titleX, titleY=titleY, + translate=translate, values=values, zindex=zindex, **kwds) + + +class AxisOrient(VegaLiteSchema): + """AxisOrient schema wrapper + + enum('top', 'bottom', 'left', 'right') + """ + _schema = {'$ref': '#/definitions/AxisOrient'} + + def __init__(self, *args): + super(AxisOrient, self).__init__(*args) + + +class AxisResolveMap(VegaLiteSchema): + """AxisResolveMap schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + x : :class:`ResolveMode` + + y : :class:`ResolveMode` + + """ + _schema = {'$ref': '#/definitions/AxisResolveMap'} + + def __init__(self, x=Undefined, y=Undefined, **kwds): + super(AxisResolveMap, self).__init__(x=x, y=y, **kwds) + + +class BarConfig(AnyMarkConfig): + """BarConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). + One of ``"left"``, ``"right"``, ``"center"``. + + **Note:** Expression reference is *not* supported for range marks. + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an + expression reference that provides one of the valid values. The ``"line-top"`` and + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + binSpacing : float + Offset between bars for binned field. The ideal value for this is either 0 + (preferred by statisticians) or 1 (Vega-Lite default, D3 example style). + + **Default value:** ``1`` + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + continuousBandSize : float + The default size of the bars on continuous scales. + + **Default value:** ``5`` + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusEnd : anyOf(float, :class:`ExprRef`) + For vertical bars, top-left and top-right corner radius. + + For horizontal bars, top-right and bottom-right corner radius. + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + discreteBandSize : anyOf(float, :class:`RelativeBandSize`) + The default size of the bars with discrete dimensions. If unspecified, the default + size is ``step-2``, which provides 2 pixel offset between bars. + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default fill color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove fill. + + **Default value:** (None) + fillOpacity : anyOf(float, :class:`ExprRef`) + + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + + **Default value:** ``0`` + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). + + + * If set to ``"filter"`` (default), all data items with null values will be skipped + (for line, trail, and area marks) or filtered (for other marks). + * If ``null``, all data items are included. In this case, invalid values will be + interpreted as zeroes. + limit : anyOf(float, :class:`ExprRef`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). + + **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, + ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. + order : anyOf(None, boolean) + For line and trail marks, this ``order`` property can be set to ``null`` or + ``false`` to make the lines use the original order in the data sources. + orient : :class:`Orientation` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + the line if ``config.sortLineBy`` is not specified. For stacked charts, this is + always determined by the orientation of the stack; therefore explicitly specified + value will be ignored. + outerRadius : anyOf(float, :class:`ExprRef`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + + **Default value:** ``0`` + padAngle : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + For arc mark, the primary (outer) radius in pixels. + + For text marks, polar coordinate radial offset, in pixels, of the text from the + origin determined by the ``x`` and ``y`` properties. + + **Default value:** ``min(plot_width, plot_height)/2`` + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + + **Default value:** ``0`` + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. Note that this value sets the area of the symbol; the side lengths will + increase with the square root of this value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** + + + * ``30`` for point, circle, square marks; width/height's ``step`` + * ``2`` for bar marks with discrete dimensions; + * ``5`` for bar marks with continuous dimensions; + * ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default stroke color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove stroke. + + **Default value:** (None) + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : anyOf(float, :class:`ExprRef`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + 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 + will be positioned in the middle of the time unit band step. + timeUnitBandSize : float + Default relative band size for a time unit. If set to ``1``, the bandwidth of the + marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the + marks will be half of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : anyOf(float, string, :class:`ExprRef`) + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + y : anyOf(float, string, :class:`ExprRef`) + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : anyOf(float, string, :class:`ExprRef`) + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + """ + _schema = {'$ref': '#/definitions/BarConfig'} + + def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, + binSpacing=Undefined, blend=Undefined, color=Undefined, continuousBandSize=Undefined, + cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, + cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, + cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, + description=Undefined, dir=Undefined, discreteBandSize=Undefined, dx=Undefined, + dy=Undefined, ellipsis=Undefined, endAngle=Undefined, fill=Undefined, + fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, + fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, + innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, limit=Undefined, + lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, + orient=Undefined, outerRadius=Undefined, padAngle=Undefined, radius=Undefined, + radius2=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, + startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, + **kwds): + super(BarConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, + baseline=baseline, binSpacing=binSpacing, blend=blend, + color=color, continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, + description=description, dir=dir, + discreteBandSize=discreteBandSize, dx=dx, dy=dy, + ellipsis=ellipsis, endAngle=endAngle, fill=fill, + fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, + interpolate=interpolate, invalid=invalid, limit=limit, + lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, + order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, radius=radius, radius2=radius2, shape=shape, + size=size, smooth=smooth, startAngle=startAngle, stroke=stroke, + strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, theta2=theta2, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, + width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class BaseTitleNoValueRefs(VegaLiteSchema): + """BaseTitleNoValueRefs schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or + ``"right"``. + anchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + baseline : :class:`TextBaseline` + Vertical text baseline for title and subtitle text. One of ``"alphabetic"`` + (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or + ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly + to ``"top"`` and ``"bottom"``, but are calculated relative to the *lineHeight* + rather than *fontSize* alone. + color : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) + + limit : anyOf(float, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + + orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) + + subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + subtitleFont : anyOf(string, :class:`ExprRef`) + + subtitleFontSize : anyOf(float, :class:`ExprRef`) + + subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + subtitleLineHeight : anyOf(float, :class:`ExprRef`) + + subtitlePadding : anyOf(float, :class:`ExprRef`) + + zindex : anyOf(float, :class:`ExprRef`) + + """ + _schema = {'$ref': '#/definitions/BaseTitleNoValueRefs'} + + def __init__(self, align=Undefined, anchor=Undefined, angle=Undefined, aria=Undefined, + baseline=Undefined, color=Undefined, dx=Undefined, dy=Undefined, font=Undefined, + fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, frame=Undefined, + limit=Undefined, lineHeight=Undefined, offset=Undefined, orient=Undefined, + subtitleColor=Undefined, subtitleFont=Undefined, subtitleFontSize=Undefined, + subtitleFontStyle=Undefined, subtitleFontWeight=Undefined, + subtitleLineHeight=Undefined, subtitlePadding=Undefined, zindex=Undefined, **kwds): + super(BaseTitleNoValueRefs, self).__init__(align=align, anchor=anchor, angle=angle, aria=aria, + baseline=baseline, color=color, dx=dx, dy=dy, + font=font, fontSize=fontSize, fontStyle=fontStyle, + fontWeight=fontWeight, frame=frame, limit=limit, + lineHeight=lineHeight, offset=offset, orient=orient, + subtitleColor=subtitleColor, + subtitleFont=subtitleFont, + subtitleFontSize=subtitleFontSize, + subtitleFontStyle=subtitleFontStyle, + subtitleFontWeight=subtitleFontWeight, + subtitleLineHeight=subtitleLineHeight, + subtitlePadding=subtitlePadding, zindex=zindex, + **kwds) + + +class BinExtent(VegaLiteSchema): + """BinExtent schema wrapper + + anyOf(List(float), :class:`ParameterExtent`) + """ + _schema = {'$ref': '#/definitions/BinExtent'} + + def __init__(self, *args, **kwds): + super(BinExtent, self).__init__(*args, **kwds) + + +class BinParams(VegaLiteSchema): + """BinParams schema wrapper + + Mapping(required=[]) + Binning properties or boolean flag for determining whether to bin data or not. + + Attributes + ---------- + + anchor : float + A value in the binned domain at which to anchor the bins, shifting the bin + boundaries if necessary to ensure that a boundary aligns with the anchor value. + + **Default value:** the minimum bin extent value + base : float + The number base to use for automatic bin determination (default is base 10). + + **Default value:** ``10`` + binned : boolean + When set to ``true``, Vega-Lite treats the input data as already binned. + divide : List(float) + Scale factors indicating allowable subdivisions. The default value is [5, 2], which + indicates that for base 10 numbers (the default base), the method may consider + dividing bin sizes by 5 and/or 2. For example, for an initial step size of 10, the + method can check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might + also satisfy the given constraints. + + **Default value:** ``[5, 2]`` + extent : :class:`BinExtent` + A two-element ( ``[min, max]`` ) array indicating the range of desired bin values. + maxbins : float + Maximum number of bins. + + **Default value:** ``6`` for ``row``, ``column`` and ``shape`` channels; ``10`` for + other channels + minstep : float + A minimum allowable step size (particularly useful for integer values). + nice : boolean + If true, attempts to make the bin boundaries use human-friendly boundaries, such as + multiples of ten. + + **Default value:** ``true`` + step : float + An exact step size to use between bins. + + **Note:** If provided, options such as maxbins will be ignored. + steps : List(float) + An array of allowable step sizes to choose from. + """ + _schema = {'$ref': '#/definitions/BinParams'} + + def __init__(self, anchor=Undefined, base=Undefined, binned=Undefined, divide=Undefined, + extent=Undefined, maxbins=Undefined, minstep=Undefined, nice=Undefined, step=Undefined, + steps=Undefined, **kwds): + super(BinParams, self).__init__(anchor=anchor, base=base, binned=binned, divide=divide, + extent=extent, maxbins=maxbins, minstep=minstep, nice=nice, + step=step, steps=steps, **kwds) + + +class Binding(VegaLiteSchema): + """Binding schema wrapper + + anyOf(:class:`BindCheckbox`, :class:`BindRadioSelect`, :class:`BindRange`, + :class:`BindInput`, :class:`BindDirect`) + """ + _schema = {'$ref': '#/definitions/Binding'} + + def __init__(self, *args, **kwds): + super(Binding, self).__init__(*args, **kwds) + + +class BindCheckbox(Binding): + """BindCheckbox schema wrapper + + Mapping(required=[input]) + + Attributes + ---------- + + input : string + + debounce : float + If defined, delays event handling until the specified milliseconds have elapsed + since the last event was fired. + element : :class:`Element` + An optional CSS selector string indicating the parent element to which the input + element should be added. By default, all input elements are added within the parent + container of the Vega view. + name : string + By default, the signal name is used to label input elements. This ``name`` property + can be used instead to specify a custom label for the bound signal. + """ + _schema = {'$ref': '#/definitions/BindCheckbox'} + + def __init__(self, input=Undefined, debounce=Undefined, element=Undefined, name=Undefined, **kwds): + super(BindCheckbox, self).__init__(input=input, debounce=debounce, element=element, name=name, + **kwds) + + +class BindDirect(Binding): + """BindDirect schema wrapper + + Mapping(required=[element]) + + Attributes + ---------- + + element : anyOf(:class:`Element`, Mapping(required=[])) + An input element that exposes a *value* property and supports the `EventTarget + `__ interface, or a + CSS selector string to such an element. When the element updates and dispatches an + event, the *value* property will be used as the new, bound signal value. When the + signal updates independent of the element, the *value* property will be set to the + signal value and a new event will be dispatched on the element. + debounce : float + If defined, delays event handling until the specified milliseconds have elapsed + since the last event was fired. + event : string + The event (default ``"input"`` ) to listen for to track changes on the external + element. + """ + _schema = {'$ref': '#/definitions/BindDirect'} + + def __init__(self, element=Undefined, debounce=Undefined, event=Undefined, **kwds): + super(BindDirect, self).__init__(element=element, debounce=debounce, event=event, **kwds) + + +class BindInput(Binding): + """BindInput schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + autocomplete : string + A hint for form autofill. See the `HTML autocomplete attribute + `__ for + additional information. + debounce : float + If defined, delays event handling until the specified milliseconds have elapsed + since the last event was fired. + element : :class:`Element` + An optional CSS selector string indicating the parent element to which the input + element should be added. By default, all input elements are added within the parent + container of the Vega view. + input : string + The type of input element to use. The valid values are ``"checkbox"``, ``"radio"``, + ``"range"``, ``"select"``, and any other legal `HTML form input type + `__. + name : string + By default, the signal name is used to label input elements. This ``name`` property + can be used instead to specify a custom label for the bound signal. + placeholder : string + Text that appears in the form control when it has no value set. + """ + _schema = {'$ref': '#/definitions/BindInput'} + + def __init__(self, autocomplete=Undefined, debounce=Undefined, element=Undefined, input=Undefined, + name=Undefined, placeholder=Undefined, **kwds): + super(BindInput, self).__init__(autocomplete=autocomplete, debounce=debounce, element=element, + input=input, name=name, placeholder=placeholder, **kwds) + + +class BindRadioSelect(Binding): + """BindRadioSelect schema wrapper + + Mapping(required=[input, options]) + + Attributes + ---------- + + input : enum('radio', 'select') + + options : List(Any) + An array of options to select from. + debounce : float + If defined, delays event handling until the specified milliseconds have elapsed + since the last event was fired. + element : :class:`Element` + An optional CSS selector string indicating the parent element to which the input + element should be added. By default, all input elements are added within the parent + container of the Vega view. + labels : List(string) + An array of label strings to represent the ``options`` values. If unspecified, the + ``options`` value will be coerced to a string and used as the label. + name : string + By default, the signal name is used to label input elements. This ``name`` property + can be used instead to specify a custom label for the bound signal. + """ + _schema = {'$ref': '#/definitions/BindRadioSelect'} + + def __init__(self, input=Undefined, options=Undefined, debounce=Undefined, element=Undefined, + labels=Undefined, name=Undefined, **kwds): + super(BindRadioSelect, self).__init__(input=input, options=options, debounce=debounce, + element=element, labels=labels, name=name, **kwds) + + +class BindRange(Binding): + """BindRange schema wrapper + + Mapping(required=[input]) + + Attributes + ---------- + + input : string + + debounce : float + If defined, delays event handling until the specified milliseconds have elapsed + since the last event was fired. + element : :class:`Element` + An optional CSS selector string indicating the parent element to which the input + element should be added. By default, all input elements are added within the parent + container of the Vega view. + max : float + Sets the maximum slider value. Defaults to the larger of the signal value and + ``100``. + min : float + Sets the minimum slider value. Defaults to the smaller of the signal value and + ``0``. + name : string + By default, the signal name is used to label input elements. This ``name`` property + can be used instead to specify a custom label for the bound signal. + step : float + Sets the minimum slider increment. If undefined, the step size will be automatically + determined based on the ``min`` and ``max`` values. + """ + _schema = {'$ref': '#/definitions/BindRange'} + + def __init__(self, input=Undefined, debounce=Undefined, element=Undefined, max=Undefined, + min=Undefined, name=Undefined, step=Undefined, **kwds): + super(BindRange, self).__init__(input=input, debounce=debounce, element=element, max=max, + min=min, name=name, step=step, **kwds) + + +class Blend(VegaLiteSchema): + """Blend schema wrapper + + enum(None, 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', + 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', + 'color', 'luminosity') + """ + _schema = {'$ref': '#/definitions/Blend'} + + def __init__(self, *args): + super(Blend, self).__init__(*args) + + +class BoxPlotConfig(VegaLiteSchema): + """BoxPlotConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + box : anyOf(boolean, :class:`MarkConfig`) + + extent : anyOf(string, float) + The extent of the whiskers. Available options include: + + + * ``"min-max"`` : min and max are the lower and upper whiskers respectively. + * A number representing multiple of the interquartile range. This number will be + multiplied by the IQR to determine whisker boundary, which spans from the smallest + data to the largest data within the range *[Q1 - k * IQR, Q3 + k * IQR]* where + *Q1* and *Q3* are the first and third quartiles while *IQR* is the interquartile + range ( *Q3-Q1* ). + + **Default value:** ``1.5``. + median : anyOf(boolean, :class:`MarkConfig`) + + outliers : anyOf(boolean, :class:`MarkConfig`) + + rule : anyOf(boolean, :class:`MarkConfig`) + + size : float + Size of the box and median tick of a box plot + ticks : anyOf(boolean, :class:`MarkConfig`) + + """ + _schema = {'$ref': '#/definitions/BoxPlotConfig'} + + def __init__(self, box=Undefined, extent=Undefined, median=Undefined, outliers=Undefined, + rule=Undefined, size=Undefined, ticks=Undefined, **kwds): + super(BoxPlotConfig, self).__init__(box=box, extent=extent, median=median, outliers=outliers, + rule=rule, size=size, ticks=ticks, **kwds) + + +class BrushConfig(VegaLiteSchema): + """BrushConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + cursor : :class:`Cursor` + The mouse cursor used over the interval mark. Any valid `CSS cursor type + `__ can be used. + fill : :class:`Color` + The fill color of the interval mark. + + **Default value:** ``"#333333"`` + fillOpacity : float + The fill opacity of the interval mark (a value between ``0`` and ``1`` ). + + **Default value:** ``0.125`` + stroke : :class:`Color` + The stroke color of the interval mark. + + **Default value:** ``"#ffffff"`` + strokeDash : List(float) + An array of alternating stroke and space lengths, for creating dashed or dotted + lines. + strokeDashOffset : float + The offset (in pixels) with which to begin drawing the stroke dash array. + strokeOpacity : float + The stroke opacity of the interval mark (a value between ``0`` and ``1`` ). + strokeWidth : float + The stroke width of the interval mark. + """ + _schema = {'$ref': '#/definitions/BrushConfig'} + + def __init__(self, cursor=Undefined, fill=Undefined, fillOpacity=Undefined, stroke=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, **kwds): + super(BrushConfig, self).__init__(cursor=cursor, fill=fill, fillOpacity=fillOpacity, + stroke=stroke, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, **kwds) + + +class Color(VegaLiteSchema): + """Color schema wrapper + + anyOf(:class:`ColorName`, :class:`HexColor`, string) + """ + _schema = {'$ref': '#/definitions/Color'} + + def __init__(self, *args, **kwds): + super(Color, self).__init__(*args, **kwds) + + +class ColorDef(VegaLiteSchema): + """ColorDef schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, + :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`) + """ + _schema = {'$ref': '#/definitions/ColorDef'} + + def __init__(self, *args, **kwds): + super(ColorDef, self).__init__(*args, **kwds) + + +class ColorName(Color): + """ColorName schema wrapper + + enum('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') + """ + _schema = {'$ref': '#/definitions/ColorName'} + + def __init__(self, *args): + super(ColorName, self).__init__(*args) + + +class ColorScheme(VegaLiteSchema): + """ColorScheme schema wrapper + + anyOf(:class:`Categorical`, :class:`SequentialSingleHue`, :class:`SequentialMultiHue`, + :class:`Diverging`, :class:`Cyclical`) + """ + _schema = {'$ref': '#/definitions/ColorScheme'} + + def __init__(self, *args, **kwds): + super(ColorScheme, self).__init__(*args, **kwds) + + +class Categorical(ColorScheme): + """Categorical schema wrapper + + enum('accent', 'category10', 'category20', 'category20b', 'category20c', 'dark2', 'paired', + 'pastel1', 'pastel2', 'set1', 'set2', 'set3', 'tableau10', 'tableau20') + """ + _schema = {'$ref': '#/definitions/Categorical'} + + def __init__(self, *args): + super(Categorical, self).__init__(*args) + + +class CompositeMark(AnyMark): + """CompositeMark schema wrapper + + anyOf(:class:`BoxPlot`, :class:`ErrorBar`, :class:`ErrorBand`) + """ + _schema = {'$ref': '#/definitions/CompositeMark'} + + def __init__(self, *args, **kwds): + super(CompositeMark, self).__init__(*args, **kwds) + + +class BoxPlot(CompositeMark): + """BoxPlot schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/BoxPlot'} + + def __init__(self, *args): + super(BoxPlot, self).__init__(*args) + + +class CompositeMarkDef(AnyMark): + """CompositeMarkDef schema wrapper + + anyOf(:class:`BoxPlotDef`, :class:`ErrorBarDef`, :class:`ErrorBandDef`) + """ + _schema = {'$ref': '#/definitions/CompositeMarkDef'} + + def __init__(self, *args, **kwds): + super(CompositeMarkDef, self).__init__(*args, **kwds) + + +class BoxPlotDef(CompositeMarkDef): + """BoxPlotDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`BoxPlot` + The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, + ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, + ``"rule"``, and ``"text"`` ) or a composite mark type ( ``"boxplot"``, + ``"errorband"``, ``"errorbar"`` ). + box : anyOf(boolean, :class:`MarkConfig`) + + clip : boolean + Whether a composite mark be clipped to the enclosing group’s width and height. + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + extent : anyOf(string, float) + The extent of the whiskers. Available options include: + + + * ``"min-max"`` : min and max are the lower and upper whiskers respectively. + * A number representing multiple of the interquartile range. This number will be + multiplied by the IQR to determine whisker boundary, which spans from the smallest + data to the largest data within the range *[Q1 - k * IQR, Q3 + k * IQR]* where + *Q1* and *Q3* are the first and third quartiles while *IQR* is the interquartile + range ( *Q3-Q1* ). + + **Default value:** ``1.5``. + median : anyOf(boolean, :class:`MarkConfig`) + + opacity : float + The opacity (value between [0,1]) of the mark. + orient : :class:`Orientation` + Orientation of the box plot. This is normally automatically determined based on + types of fields on x and y channels. However, an explicit ``orient`` be specified + when the orientation is ambiguous. + + **Default value:** ``"vertical"``. + outliers : anyOf(boolean, :class:`MarkConfig`) + + rule : anyOf(boolean, :class:`MarkConfig`) + + size : float + Size of the box and median tick of a box plot + ticks : anyOf(boolean, :class:`MarkConfig`) + + """ + _schema = {'$ref': '#/definitions/BoxPlotDef'} + + def __init__(self, type=Undefined, box=Undefined, clip=Undefined, color=Undefined, extent=Undefined, + median=Undefined, opacity=Undefined, orient=Undefined, outliers=Undefined, + rule=Undefined, size=Undefined, ticks=Undefined, **kwds): + super(BoxPlotDef, self).__init__(type=type, box=box, clip=clip, color=color, extent=extent, + median=median, opacity=opacity, orient=orient, + outliers=outliers, rule=rule, size=size, ticks=ticks, **kwds) + + +class CompositionConfig(VegaLiteSchema): + """CompositionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + spacing : float + The default spacing in pixels between composed sub-views. + + **Default value** : ``20`` + """ + _schema = {'$ref': '#/definitions/CompositionConfig'} + + def __init__(self, columns=Undefined, spacing=Undefined, **kwds): + super(CompositionConfig, self).__init__(columns=columns, spacing=spacing, **kwds) + + +class ConditionalAxisColor(VegaLiteSchema): + """ConditionalAxisColor schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisColor'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisColor, self).__init__(*args, **kwds) + + +class ConditionalAxisLabelAlign(VegaLiteSchema): + """ConditionalAxisLabelAlign schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisLabelAlign'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelAlign, self).__init__(*args, **kwds) + + +class ConditionalAxisLabelBaseline(VegaLiteSchema): + """ConditionalAxisLabelBaseline schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisLabelBaseline'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelBaseline, self).__init__(*args, **kwds) + + +class ConditionalAxisLabelFontStyle(VegaLiteSchema): + """ConditionalAxisLabelFontStyle schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisLabelFontStyle'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelFontStyle, self).__init__(*args, **kwds) + + +class ConditionalAxisLabelFontWeight(VegaLiteSchema): + """ConditionalAxisLabelFontWeight schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisLabelFontWeight'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelFontWeight, self).__init__(*args, **kwds) + + +class ConditionalAxisNumber(VegaLiteSchema): + """ConditionalAxisNumber schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisNumber'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisNumber, self).__init__(*args, **kwds) + + +class ConditionalAxisNumberArray(VegaLiteSchema): + """ConditionalAxisNumberArray schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisNumberArray'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisNumberArray, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertyAlignnull(VegaLiteSchema): + """ConditionalAxisPropertyAlignnull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(Align|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyAlignnull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertyColornull(VegaLiteSchema): + """ConditionalAxisPropertyColornull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(Color|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyColornull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertyFontStylenull(VegaLiteSchema): + """ConditionalAxisPropertyFontStylenull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(FontStyle|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyFontStylenull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertyFontWeightnull(VegaLiteSchema): + """ConditionalAxisPropertyFontWeightnull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(FontWeight|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyFontWeightnull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertyTextBaselinenull(VegaLiteSchema): + """ConditionalAxisPropertyTextBaselinenull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(TextBaseline|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyTextBaselinenull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertynumberArraynull(VegaLiteSchema): + """ConditionalAxisPropertynumberArraynull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(number[]|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertynumberArraynull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertynumbernull(VegaLiteSchema): + """ConditionalAxisPropertynumbernull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(number|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertynumbernull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertystringnull(VegaLiteSchema): + """ConditionalAxisPropertystringnull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(string|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertystringnull, self).__init__(*args, **kwds) + + +class ConditionalAxisString(VegaLiteSchema): + """ConditionalAxisString schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisString'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisString, self).__init__(*args, **kwds) + + +class ConditionalMarkPropFieldOrDatumDef(VegaLiteSchema): + """ConditionalMarkPropFieldOrDatumDef schema wrapper + + anyOf(:class:`ConditionalPredicateMarkPropFieldOrDatumDef`, + :class:`ConditionalParameterMarkPropFieldOrDatumDef`) + """ + _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldOrDatumDef'} + + def __init__(self, *args, **kwds): + super(ConditionalMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) + + +class ConditionalMarkPropFieldOrDatumDefTypeForShape(VegaLiteSchema): + """ConditionalMarkPropFieldOrDatumDefTypeForShape schema wrapper + + anyOf(:class:`ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape`, + :class:`ConditionalParameterMarkPropFieldOrDatumDefTypeForShape`) + """ + _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldOrDatumDef'} + + def __init__(self, *args, **kwds): + super(ConditionalMarkPropFieldOrDatumDefTypeForShape, self).__init__(*args, **kwds) + + +class ConditionalParameterMarkPropFieldOrDatumDef(ConditionalMarkPropFieldOrDatumDef): + """ConditionalParameterMarkPropFieldOrDatumDef schema wrapper + + anyOf(Mapping(required=[param]), Mapping(required=[param])) + """ + _schema = {'$ref': '#/definitions/ConditionalParameter'} + + def __init__(self, *args, **kwds): + super(ConditionalParameterMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) + + +class ConditionalParameterMarkPropFieldOrDatumDefTypeForShape(ConditionalMarkPropFieldOrDatumDefTypeForShape): + """ConditionalParameterMarkPropFieldOrDatumDefTypeForShape schema wrapper + + anyOf(Mapping(required=[param]), Mapping(required=[param])) + """ + _schema = {'$ref': '#/definitions/ConditionalParameter>'} + + def __init__(self, *args, **kwds): + super(ConditionalParameterMarkPropFieldOrDatumDefTypeForShape, self).__init__(*args, **kwds) + + +class ConditionalPredicateMarkPropFieldOrDatumDef(ConditionalMarkPropFieldOrDatumDef): + """ConditionalPredicateMarkPropFieldOrDatumDef schema wrapper + + anyOf(Mapping(required=[test]), Mapping(required=[test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) + + +class ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape(ConditionalMarkPropFieldOrDatumDefTypeForShape): + """ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape schema wrapper + + anyOf(Mapping(required=[test]), Mapping(required=[test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefAlignnullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefAlignnullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefAlignnullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefColornullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefColornullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefColornullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefFontStylenullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefFontStylenullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefFontStylenullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefFontWeightnullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefFontWeightnullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefFontWeightnullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefTextBaselinenullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefTextBaselinenullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefTextBaselinenullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefnumberArraynullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefnumberArraynullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefnumberArraynullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefnumbernullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefnumbernullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefnumbernullExprRef, self).__init__(*args, **kwds) + + +class ConditionalStringFieldDef(VegaLiteSchema): + """ConditionalStringFieldDef schema wrapper + + anyOf(:class:`ConditionalPredicateStringFieldDef`, + :class:`ConditionalParameterStringFieldDef`) + """ + _schema = {'$ref': '#/definitions/ConditionalStringFieldDef'} + + def __init__(self, *args, **kwds): + super(ConditionalStringFieldDef, self).__init__(*args, **kwds) + + +class ConditionalParameterStringFieldDef(ConditionalStringFieldDef): + """ConditionalParameterStringFieldDef schema wrapper + + Mapping(required=[param]) + + Attributes + ---------- + + param : :class:`ParameterName` + Filter using a parameter name. + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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. + empty : boolean + For selection parameters, the predicate of empty selections returns true by default. + Override this behavior, by setting this property ``empty: false``. + field : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/ConditionalParameter'} + + def __init__(self, param=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + empty=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(ConditionalParameterStringFieldDef, self).__init__(param=param, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, + empty=empty, field=field, + format=format, formatType=formatType, + timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): + """ConditionalPredicateStringFieldDef schema wrapper + + Mapping(required=[test]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/ConditionalPredicate'} + + def __init__(self, test=Undefined, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(ConditionalPredicateStringFieldDef, self).__init__(test=test, aggregate=aggregate, + bandPosition=bandPosition, bin=bin, + field=field, format=format, + formatType=formatType, + timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class ConditionalValueDefGradientstringnullExprRef(VegaLiteSchema): + """ConditionalValueDefGradientstringnullExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefGradientstringnullExprRef`, + :class:`ConditionalParameterValueDefGradientstringnullExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefGradientstringnullExprRef, self).__init__(*args, **kwds) + + +class ConditionalParameterValueDefGradientstringnullExprRef(ConditionalValueDefGradientstringnullExprRef): + """ConditionalParameterValueDefGradientstringnullExprRef schema wrapper + + Mapping(required=[param, value]) + + Attributes + ---------- + + param : :class:`ParameterName` + Filter using a parameter name. + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + empty : boolean + For selection parameters, the predicate of empty selections returns true by default. + Override this behavior, by setting this property ``empty: false``. + """ + _schema = {'$ref': '#/definitions/ConditionalParameter>'} + + def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): + super(ConditionalParameterValueDefGradientstringnullExprRef, self).__init__(param=param, + value=value, + empty=empty, **kwds) + + +class ConditionalPredicateValueDefGradientstringnullExprRef(ConditionalValueDefGradientstringnullExprRef): + """ConditionalPredicateValueDefGradientstringnullExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefGradientstringnullExprRef, self).__init__(test=test, + value=value, **kwds) + + +class ConditionalValueDefTextExprRef(VegaLiteSchema): + """ConditionalValueDefTextExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefTextExprRef`, + :class:`ConditionalParameterValueDefTextExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(Text|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefTextExprRef, self).__init__(*args, **kwds) + + +class ConditionalParameterValueDefTextExprRef(ConditionalValueDefTextExprRef): + """ConditionalParameterValueDefTextExprRef schema wrapper + + Mapping(required=[param, value]) + + Attributes + ---------- + + param : :class:`ParameterName` + Filter using a parameter name. + value : anyOf(:class:`Text`, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + empty : boolean + For selection parameters, the predicate of empty selections returns true by default. + Override this behavior, by setting this property ``empty: false``. + """ + _schema = {'$ref': '#/definitions/ConditionalParameter>'} + + def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): + super(ConditionalParameterValueDefTextExprRef, self).__init__(param=param, value=value, + empty=empty, **kwds) + + +class ConditionalPredicateValueDefTextExprRef(ConditionalValueDefTextExprRef): + """ConditionalPredicateValueDefTextExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(:class:`Text`, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefTextExprRef, self).__init__(test=test, value=value, **kwds) + + +class ConditionalValueDefnumber(VegaLiteSchema): + """ConditionalValueDefnumber schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefnumber`, + :class:`ConditionalParameterValueDefnumber`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefnumber, self).__init__(*args, **kwds) + + +class ConditionalParameterValueDefnumber(ConditionalValueDefnumber): + """ConditionalParameterValueDefnumber schema wrapper + + Mapping(required=[param, value]) + + Attributes + ---------- + + param : :class:`ParameterName` + Filter using a parameter name. + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + empty : boolean + For selection parameters, the predicate of empty selections returns true by default. + Override this behavior, by setting this property ``empty: false``. + """ + _schema = {'$ref': '#/definitions/ConditionalParameter>'} + + def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): + super(ConditionalParameterValueDefnumber, self).__init__(param=param, value=value, empty=empty, + **kwds) + + +class ConditionalPredicateValueDefnumber(ConditionalValueDefnumber): + """ConditionalPredicateValueDefnumber schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefnumber, self).__init__(test=test, value=value, **kwds) + + +class ConditionalValueDefnumberArrayExprRef(VegaLiteSchema): + """ConditionalValueDefnumberArrayExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefnumberArrayExprRef`, + :class:`ConditionalParameterValueDefnumberArrayExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(number[]|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefnumberArrayExprRef, self).__init__(*args, **kwds) + + +class ConditionalParameterValueDefnumberArrayExprRef(ConditionalValueDefnumberArrayExprRef): + """ConditionalParameterValueDefnumberArrayExprRef schema wrapper + + Mapping(required=[param, value]) + + Attributes + ---------- + + param : :class:`ParameterName` + Filter using a parameter name. + value : anyOf(List(float), :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + empty : boolean + For selection parameters, the predicate of empty selections returns true by default. + Override this behavior, by setting this property ``empty: false``. + """ + _schema = {'$ref': '#/definitions/ConditionalParameter>'} + + def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): + super(ConditionalParameterValueDefnumberArrayExprRef, self).__init__(param=param, value=value, + empty=empty, **kwds) + + +class ConditionalPredicateValueDefnumberArrayExprRef(ConditionalValueDefnumberArrayExprRef): + """ConditionalPredicateValueDefnumberArrayExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(List(float), :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefnumberArrayExprRef, self).__init__(test=test, value=value, + **kwds) + + +class ConditionalValueDefnumberExprRef(VegaLiteSchema): + """ConditionalValueDefnumberExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefnumberExprRef`, + :class:`ConditionalParameterValueDefnumberExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(number|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefnumberExprRef, self).__init__(*args, **kwds) + + +class ConditionalParameterValueDefnumberExprRef(ConditionalValueDefnumberExprRef): + """ConditionalParameterValueDefnumberExprRef schema wrapper + + Mapping(required=[param, value]) + + Attributes + ---------- + + param : :class:`ParameterName` + Filter using a parameter name. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + empty : boolean + For selection parameters, the predicate of empty selections returns true by default. + Override this behavior, by setting this property ``empty: false``. + """ + _schema = {'$ref': '#/definitions/ConditionalParameter>'} + + def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): + super(ConditionalParameterValueDefnumberExprRef, self).__init__(param=param, value=value, + empty=empty, **kwds) + + +class ConditionalPredicateValueDefnumberExprRef(ConditionalValueDefnumberExprRef): + """ConditionalPredicateValueDefnumberExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefnumberExprRef, self).__init__(test=test, value=value, **kwds) + + +class ConditionalValueDefstringExprRef(VegaLiteSchema): + """ConditionalValueDefstringExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefstringExprRef`, + :class:`ConditionalParameterValueDefstringExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(string|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefstringExprRef, self).__init__(*args, **kwds) + + +class ConditionalParameterValueDefstringExprRef(ConditionalValueDefstringExprRef): + """ConditionalParameterValueDefstringExprRef schema wrapper + + Mapping(required=[param, value]) + + Attributes + ---------- + + param : :class:`ParameterName` + Filter using a parameter name. + value : anyOf(string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + empty : boolean + For selection parameters, the predicate of empty selections returns true by default. + Override this behavior, by setting this property ``empty: false``. + """ + _schema = {'$ref': '#/definitions/ConditionalParameter>'} + + def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): + super(ConditionalParameterValueDefstringExprRef, self).__init__(param=param, value=value, + empty=empty, **kwds) + + +class ConditionalPredicateValueDefstringExprRef(ConditionalValueDefstringExprRef): + """ConditionalPredicateValueDefstringExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefstringExprRef, self).__init__(test=test, value=value, **kwds) + + +class ConditionalValueDefstringnullExprRef(VegaLiteSchema): + """ConditionalValueDefstringnullExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefstringnullExprRef`, + :class:`ConditionalParameterValueDefstringnullExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(string|null|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefstringnullExprRef, self).__init__(*args, **kwds) + + +class ConditionalParameterValueDefstringnullExprRef(ConditionalValueDefstringnullExprRef): + """ConditionalParameterValueDefstringnullExprRef schema wrapper + + Mapping(required=[param, value]) + + Attributes + ---------- + + param : :class:`ParameterName` + Filter using a parameter name. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + empty : boolean + For selection parameters, the predicate of empty selections returns true by default. + Override this behavior, by setting this property ``empty: false``. + """ + _schema = {'$ref': '#/definitions/ConditionalParameter>'} + + def __init__(self, param=Undefined, value=Undefined, empty=Undefined, **kwds): + super(ConditionalParameterValueDefstringnullExprRef, self).__init__(param=param, value=value, + empty=empty, **kwds) + + +class ConditionalPredicateValueDefstringnullExprRef(ConditionalValueDefstringnullExprRef): + """ConditionalPredicateValueDefstringnullExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefstringnullExprRef, self).__init__(test=test, value=value, + **kwds) + + +class Config(VegaLiteSchema): + """Config schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + arc : :class:`RectConfig` + Arc-specific Config + area : :class:`AreaConfig` + Area-Specific Config + aria : boolean + A boolean flag indicating if ARIA default attributes should be included for marks + and guides (SVG output only). If false, the ``"aria-hidden"`` attribute will be set + for all guides, removing them from the ARIA accessibility tree and Vega-Lite will + not generate default descriptions for marks. + + **Default value:** ``true``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + How the visualization size should be determined. If a string, should be one of + ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify + parameters for content sizing and automatic resizing. + + **Default value** : ``pad`` + axis : :class:`AxisConfig` + Axis configuration, which determines default properties for all ``x`` and ``y`` + `axes `__. For a full list of axis + configuration options, please see the `corresponding section of the axis + documentation `__. + axisBand : :class:`AxisConfig` + Config for axes with "band" scales. + axisBottom : :class:`AxisConfig` + Config for x-axis along the bottom edge of the chart. + axisDiscrete : :class:`AxisConfig` + Config for axes with "point" or "band" scales. + axisLeft : :class:`AxisConfig` + Config for y-axis along the left edge of the chart. + axisPoint : :class:`AxisConfig` + Config for axes with "point" scales. + axisQuantitative : :class:`AxisConfig` + Config for quantitative axes. + axisRight : :class:`AxisConfig` + Config for y-axis along the right edge of the chart. + axisTemporal : :class:`AxisConfig` + Config for temporal axes. + axisTop : :class:`AxisConfig` + Config for x-axis along the top edge of the chart. + axisX : :class:`AxisConfig` + X-axis specific config. + axisXBand : :class:`AxisConfig` + Config for x-axes with "band" scales. + axisXDiscrete : :class:`AxisConfig` + Config for x-axes with "point" or "band" scales. + axisXPoint : :class:`AxisConfig` + Config for x-axes with "point" scales. + axisXQuantitative : :class:`AxisConfig` + Config for x-quantitative axes. + axisXTemporal : :class:`AxisConfig` + Config for x-temporal axes. + axisY : :class:`AxisConfig` + Y-axis specific config. + axisYBand : :class:`AxisConfig` + Config for y-axes with "band" scales. + axisYDiscrete : :class:`AxisConfig` + Config for y-axes with "point" or "band" scales. + axisYPoint : :class:`AxisConfig` + Config for y-axes with "point" scales. + axisYQuantitative : :class:`AxisConfig` + Config for y-quantitative axes. + axisYTemporal : :class:`AxisConfig` + Config for y-temporal axes. + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bar : :class:`BarConfig` + Bar-Specific Config + boxplot : :class:`BoxPlotConfig` + Box Config + circle : :class:`MarkConfig` + Circle-Specific Config + concat : :class:`CompositionConfig` + Default configuration for all concatenation and repeat view composition operators ( + ``concat``, ``hconcat``, ``vconcat``, and ``repeat`` ) + countTitle : string + Default axis and legend title for count fields. + + **Default value:** ``'Count of Records``. + customFormatTypes : boolean + Allow the ``formatType`` property for text marks and guides to accept a custom + formatter function `registered as a Vega expression + `__. + errorband : :class:`ErrorBandConfig` + ErrorBand Config + errorbar : :class:`ErrorBarConfig` + ErrorBar Config + facet : :class:`CompositionConfig` + Default configuration for the ``facet`` view composition operator + fieldTitle : enum('verbal', 'functional', 'plain') + Defines how Vega-Lite generates title for fields. There are three possible styles: + + + * ``"verbal"`` (Default) - displays function in a verbal style (e.g., "Sum of + field", "Year-month of date", "field (binned)"). + * ``"function"`` - displays function using parentheses and capitalized texts (e.g., + "SUM(field)", "YEARMONTH(date)", "BIN(field)"). + * ``"plain"`` - displays only the field name without functions (e.g., "field", + "date", "field"). + font : string + Default font for all text marks, titles, and labels. + geoshape : :class:`MarkConfig` + Geoshape-Specific Config + header : :class:`HeaderConfig` + Header configuration, which determines default properties for all `headers + `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + headerColumn : :class:`HeaderConfig` + Header configuration, which determines default properties for column `headers + `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + headerFacet : :class:`HeaderConfig` + Header configuration, which determines default properties for non-row/column facet + `headers `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + headerRow : :class:`HeaderConfig` + Header configuration, which determines default properties for row `headers + `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + image : :class:`RectConfig` + Image-specific Config + legend : :class:`LegendConfig` + Legend configuration, which determines default properties for all `legends + `__. For a full list of legend + configuration options, please see the `corresponding section of in the legend + documentation `__. + line : :class:`LineConfig` + Line-Specific Config + lineBreak : anyOf(string, :class:`ExprRef`) + A delimiter, such as a newline character, upon which to break text strings into + multiple lines. This property provides a global default for text marks, which is + overridden by mark or style config settings, and by the lineBreak mark encoding + channel. If signal-valued, either string or regular expression (regexp) values are + valid. + locale : :class:`Locale` + Locale definitions for string parsing and formatting of number and date values. The + locale object should contain ``number`` and/or ``time`` properties with `locale + definitions `__. Locale definitions + provided in the config block may be overridden by the View constructor locale + option. + mark : :class:`MarkConfig` + Mark Config + numberFormat : string + D3 Number format for guide labels and text marks. For example ``"s"`` for SI units. + Use `D3's number format pattern `__. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + The default visualization padding, in pixels, from the edge of the visualization + canvas to the data rectangle. If a number, specifies padding for all sides. If an + object, the value should have the format ``{"left": 5, "top": 5, "right": 5, + "bottom": 5}`` to specify padding for each side of the visualization. + + **Default value** : ``5`` + params : List(anyOf(:class:`VariableParameter`, :class:`TopLevelSelectionParameter`)) + Dynamic variables or selections that parameterize a visualization. + point : :class:`MarkConfig` + Point-Specific Config + projection : :class:`ProjectionConfig` + Projection configuration, which determines default properties for all `projections + `__. For a full list of + projection configuration options, please see the `corresponding section of the + projection documentation + `__. + range : :class:`RangeConfig` + An object hash that defines default range arrays or schemes for using with scales. + For a full list of scale range configuration options, please see the `corresponding + section of the scale documentation + `__. + rect : :class:`RectConfig` + Rect-Specific Config + rule : :class:`MarkConfig` + Rule-Specific Config + scale : :class:`ScaleConfig` + Scale configuration determines default properties for all `scales + `__. For a full list of scale + configuration options, please see the `corresponding section of the scale + documentation `__. + selection : :class:`SelectionConfig` + An object hash for defining default properties for each type of selections. + square : :class:`MarkConfig` + Square-Specific Config + style : :class:`StyleConfigIndex` + An object hash that defines key-value mappings to determine default properties for + marks with a given `style + `__. The keys represent + styles names; the values have to be valid `mark configuration objects + `__. + text : :class:`MarkConfig` + Text-Specific Config + tick : :class:`TickConfig` + Tick-Specific Config + timeFormat : string + Default time format for raw time values (without time units) in text marks, legend + labels and header labels. + + **Default value:** ``"%b %d, %Y"`` **Note:** Axes automatically determine the format + for each label automatically so this config does not affect axes. + title : :class:`TitleConfig` + Title configuration, which determines default properties for all `titles + `__. For a full list of title + configuration options, please see the `corresponding section of the title + documentation `__. + trail : :class:`LineConfig` + Trail-Specific Config + view : :class:`ViewConfig` + Default properties for `single view plots + `__. + """ + _schema = {'$ref': '#/definitions/Config'} + + def __init__(self, arc=Undefined, area=Undefined, aria=Undefined, autosize=Undefined, + axis=Undefined, axisBand=Undefined, axisBottom=Undefined, axisDiscrete=Undefined, + axisLeft=Undefined, axisPoint=Undefined, axisQuantitative=Undefined, + axisRight=Undefined, axisTemporal=Undefined, axisTop=Undefined, axisX=Undefined, + axisXBand=Undefined, axisXDiscrete=Undefined, axisXPoint=Undefined, + axisXQuantitative=Undefined, axisXTemporal=Undefined, axisY=Undefined, + axisYBand=Undefined, axisYDiscrete=Undefined, axisYPoint=Undefined, + axisYQuantitative=Undefined, axisYTemporal=Undefined, background=Undefined, + bar=Undefined, boxplot=Undefined, circle=Undefined, concat=Undefined, + countTitle=Undefined, customFormatTypes=Undefined, errorband=Undefined, + errorbar=Undefined, facet=Undefined, fieldTitle=Undefined, font=Undefined, + geoshape=Undefined, header=Undefined, headerColumn=Undefined, headerFacet=Undefined, + headerRow=Undefined, image=Undefined, legend=Undefined, line=Undefined, + lineBreak=Undefined, locale=Undefined, mark=Undefined, numberFormat=Undefined, + padding=Undefined, params=Undefined, point=Undefined, projection=Undefined, + range=Undefined, rect=Undefined, rule=Undefined, scale=Undefined, selection=Undefined, + square=Undefined, style=Undefined, text=Undefined, tick=Undefined, + timeFormat=Undefined, title=Undefined, trail=Undefined, view=Undefined, **kwds): + super(Config, self).__init__(arc=arc, area=area, aria=aria, autosize=autosize, axis=axis, + axisBand=axisBand, axisBottom=axisBottom, + axisDiscrete=axisDiscrete, axisLeft=axisLeft, axisPoint=axisPoint, + axisQuantitative=axisQuantitative, axisRight=axisRight, + axisTemporal=axisTemporal, axisTop=axisTop, axisX=axisX, + axisXBand=axisXBand, axisXDiscrete=axisXDiscrete, + axisXPoint=axisXPoint, axisXQuantitative=axisXQuantitative, + axisXTemporal=axisXTemporal, axisY=axisY, axisYBand=axisYBand, + axisYDiscrete=axisYDiscrete, axisYPoint=axisYPoint, + axisYQuantitative=axisYQuantitative, axisYTemporal=axisYTemporal, + background=background, bar=bar, boxplot=boxplot, circle=circle, + concat=concat, countTitle=countTitle, + customFormatTypes=customFormatTypes, errorband=errorband, + errorbar=errorbar, facet=facet, fieldTitle=fieldTitle, font=font, + geoshape=geoshape, header=header, headerColumn=headerColumn, + headerFacet=headerFacet, headerRow=headerRow, image=image, + legend=legend, line=line, lineBreak=lineBreak, locale=locale, + mark=mark, numberFormat=numberFormat, padding=padding, + params=params, point=point, projection=projection, range=range, + rect=rect, rule=rule, scale=scale, selection=selection, + square=square, style=style, text=text, tick=tick, + timeFormat=timeFormat, title=title, trail=trail, view=view, **kwds) + + +class Cursor(VegaLiteSchema): + """Cursor schema wrapper + + enum('auto', 'default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', + 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', + 'not-allowed', 'e-resize', 'n-resize', 'ne-resize', 'nw-resize', 's-resize', 'se-resize', + 'sw-resize', 'w-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', + 'col-resize', 'row-resize', 'all-scroll', 'zoom-in', 'zoom-out', 'grab', 'grabbing') + """ + _schema = {'$ref': '#/definitions/Cursor'} + + def __init__(self, *args): + super(Cursor, self).__init__(*args) + + +class Cyclical(ColorScheme): + """Cyclical schema wrapper + + enum('rainbow', 'sinebow') + """ + _schema = {'$ref': '#/definitions/Cyclical'} + + def __init__(self, *args): + super(Cyclical, self).__init__(*args) + + +class Data(VegaLiteSchema): + """Data schema wrapper + + anyOf(:class:`DataSource`, :class:`Generator`) + """ + _schema = {'$ref': '#/definitions/Data'} + + def __init__(self, *args, **kwds): + super(Data, self).__init__(*args, **kwds) + + +class DataFormat(VegaLiteSchema): + """DataFormat schema wrapper + + anyOf(:class:`CsvDataFormat`, :class:`DsvDataFormat`, :class:`JsonDataFormat`, + :class:`TopoDataFormat`) + """ + _schema = {'$ref': '#/definitions/DataFormat'} + + def __init__(self, *args, **kwds): + super(DataFormat, self).__init__(*args, **kwds) + + +class CsvDataFormat(DataFormat): + """CsvDataFormat schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + parse : anyOf(:class:`Parse`, None) + If set to ``null``, disable type inference based on the spec and only use type + inference based on the data. Alternatively, a parsing directive object can be + provided for explicit data types. Each property of the object corresponds to a field + name, and the value to the desired data type (one of ``"number"``, ``"boolean"``, + ``"date"``, or null (do not parse the field)). For example, ``"parse": + {"modified_on": "date"}`` parses the ``modified_on`` field in each input record a + Date value. + + For ``"date"``, we parse data based using JavaScript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + type : enum('csv', 'tsv') + Type of input data: ``"json"``, ``"csv"``, ``"tsv"``, ``"dsv"``. + + **Default value:** The default format type is determined by the extension of the + file URL. If no extension is detected, ``"json"`` will be used by default. + """ + _schema = {'$ref': '#/definitions/CsvDataFormat'} + + def __init__(self, parse=Undefined, type=Undefined, **kwds): + super(CsvDataFormat, self).__init__(parse=parse, type=type, **kwds) + + +class DataSource(Data): + """DataSource schema wrapper + + anyOf(:class:`UrlData`, :class:`InlineData`, :class:`NamedData`) + """ + _schema = {'$ref': '#/definitions/DataSource'} + + def __init__(self, *args, **kwds): + super(DataSource, self).__init__(*args, **kwds) + + +class Datasets(VegaLiteSchema): + """Datasets schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Datasets'} + + def __init__(self, **kwds): + super(Datasets, self).__init__(**kwds) + + +class Day(VegaLiteSchema): + """Day schema wrapper + + float + """ + _schema = {'$ref': '#/definitions/Day'} + + def __init__(self, *args): + super(Day, self).__init__(*args) + + +class Dict(VegaLiteSchema): + """Dict schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Dict'} + + def __init__(self, **kwds): + super(Dict, self).__init__(**kwds) + + +class DictInlineDataset(VegaLiteSchema): + """DictInlineDataset schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Dict'} + + def __init__(self, **kwds): + super(DictInlineDataset, self).__init__(**kwds) + + +class DictSelectionInit(VegaLiteSchema): + """DictSelectionInit schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Dict'} + + def __init__(self, **kwds): + super(DictSelectionInit, self).__init__(**kwds) + + +class DictSelectionInitInterval(VegaLiteSchema): + """DictSelectionInitInterval schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Dict'} + + def __init__(self, **kwds): + super(DictSelectionInitInterval, self).__init__(**kwds) + + +class Diverging(ColorScheme): + """Diverging schema wrapper + + enum('blueorange', 'blueorange-3', 'blueorange-4', 'blueorange-5', 'blueorange-6', + 'blueorange-7', 'blueorange-8', 'blueorange-9', 'blueorange-10', 'blueorange-11', + 'brownbluegreen', 'brownbluegreen-3', 'brownbluegreen-4', 'brownbluegreen-5', + 'brownbluegreen-6', 'brownbluegreen-7', 'brownbluegreen-8', 'brownbluegreen-9', + 'brownbluegreen-10', 'brownbluegreen-11', 'purplegreen', 'purplegreen-3', 'purplegreen-4', + 'purplegreen-5', 'purplegreen-6', 'purplegreen-7', 'purplegreen-8', 'purplegreen-9', + 'purplegreen-10', 'purplegreen-11', 'pinkyellowgreen', 'pinkyellowgreen-3', + 'pinkyellowgreen-4', 'pinkyellowgreen-5', 'pinkyellowgreen-6', 'pinkyellowgreen-7', + 'pinkyellowgreen-8', 'pinkyellowgreen-9', 'pinkyellowgreen-10', 'pinkyellowgreen-11', + 'purpleorange', 'purpleorange-3', 'purpleorange-4', 'purpleorange-5', 'purpleorange-6', + 'purpleorange-7', 'purpleorange-8', 'purpleorange-9', 'purpleorange-10', 'purpleorange-11', + 'redblue', 'redblue-3', 'redblue-4', 'redblue-5', 'redblue-6', 'redblue-7', 'redblue-8', + 'redblue-9', 'redblue-10', 'redblue-11', 'redgrey', 'redgrey-3', 'redgrey-4', 'redgrey-5', + 'redgrey-6', 'redgrey-7', 'redgrey-8', 'redgrey-9', 'redgrey-10', 'redgrey-11', + 'redyellowblue', 'redyellowblue-3', 'redyellowblue-4', 'redyellowblue-5', 'redyellowblue-6', + 'redyellowblue-7', 'redyellowblue-8', 'redyellowblue-9', 'redyellowblue-10', + 'redyellowblue-11', 'redyellowgreen', 'redyellowgreen-3', 'redyellowgreen-4', + 'redyellowgreen-5', 'redyellowgreen-6', 'redyellowgreen-7', 'redyellowgreen-8', + 'redyellowgreen-9', 'redyellowgreen-10', 'redyellowgreen-11', 'spectral', 'spectral-3', + 'spectral-4', 'spectral-5', 'spectral-6', 'spectral-7', 'spectral-8', 'spectral-9', + 'spectral-10', 'spectral-11') + """ + _schema = {'$ref': '#/definitions/Diverging'} + + def __init__(self, *args): + super(Diverging, self).__init__(*args) + + +class DomainUnionWith(VegaLiteSchema): + """DomainUnionWith schema wrapper + + Mapping(required=[unionWith]) + + Attributes + ---------- + + unionWith : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`)) + Customized domain values to be union with the field's values or explicitly defined + domain. Should be an array of valid scale domain values. + """ + _schema = {'$ref': '#/definitions/DomainUnionWith'} + + def __init__(self, unionWith=Undefined, **kwds): + super(DomainUnionWith, self).__init__(unionWith=unionWith, **kwds) + + +class DsvDataFormat(DataFormat): + """DsvDataFormat schema wrapper + + Mapping(required=[delimiter]) + + Attributes + ---------- + + delimiter : string + The delimiter between records. The delimiter must be a single character (i.e., a + single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are + not. + parse : anyOf(:class:`Parse`, None) + If set to ``null``, disable type inference based on the spec and only use type + inference based on the data. Alternatively, a parsing directive object can be + provided for explicit data types. Each property of the object corresponds to a field + name, and the value to the desired data type (one of ``"number"``, ``"boolean"``, + ``"date"``, or null (do not parse the field)). For example, ``"parse": + {"modified_on": "date"}`` parses the ``modified_on`` field in each input record a + Date value. + + For ``"date"``, we parse data based using JavaScript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + type : string + Type of input data: ``"json"``, ``"csv"``, ``"tsv"``, ``"dsv"``. + + **Default value:** The default format type is determined by the extension of the + file URL. If no extension is detected, ``"json"`` will be used by default. + """ + _schema = {'$ref': '#/definitions/DsvDataFormat'} + + def __init__(self, delimiter=Undefined, parse=Undefined, type=Undefined, **kwds): + super(DsvDataFormat, self).__init__(delimiter=delimiter, parse=parse, type=type, **kwds) + + +class Element(VegaLiteSchema): + """Element schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/Element'} + + def __init__(self, *args): + super(Element, self).__init__(*args) + + +class Encoding(VegaLiteSchema): + """Encoding schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + angle : :class:`NumericMarkPropDef` + Rotation angle of point and text marks. + color : :class:`ColorDef` + Color of the marks – either fill or stroke color based on the ``filled`` property + of mark definition. By default, ``color`` represents fill color for ``"area"``, + ``"bar"``, ``"tick"``, ``"text"``, ``"trail"``, ``"circle"``, and ``"square"`` / + stroke color for ``"line"`` and ``"point"``. + + **Default value:** If undefined, the default color depends on `mark config + `__ 's ``color`` + property. + + *Note:* 1) For fine-grained control over both fill and stroke colors of the marks, + please use the ``fill`` and ``stroke`` channels. The ``fill`` or ``stroke`` + encodings have higher precedence than ``color``, thus may override the ``color`` + encoding if conflicting encodings are specified. 2) See the scale documentation for + more information about customizing `color scheme + `__. + description : anyOf(:class:`StringFieldDefWithCondition`, + :class:`StringValueDefWithCondition`) + A text description of this mark for ARIA accessibility (SVG output only). For SVG + output the ``"aria-label"`` attribute will be set to this description. + detail : anyOf(:class:`FieldDefWithoutScale`, List(:class:`FieldDefWithoutScale`)) + Additional levels of detail for grouping data in aggregate views and in line, trail, + and area marks without mapping data to a specific visual channel. + fill : :class:`ColorDef` + Fill color of the marks. **Default value:** If undefined, the default color depends + on `mark config `__ + 's ``color`` property. + + *Note:* The ``fill`` encoding has higher precedence than ``color``, thus may + override the ``color`` encoding if conflicting encodings are specified. + fillOpacity : :class:`NumericMarkPropDef` + Fill opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's + ``fillOpacity`` property. + href : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + A URL to load upon mouse click. + key : :class:`FieldDefWithoutScale` + A data field to use as a unique key for data binding. When a visualization’s data is + updated, the key value will be used to match data elements to existing mark + instances. Use a key channel to enable object constancy for transitions over dynamic + data. + latitude : :class:`LatLongDef` + Latitude position of geographically projected marks. + latitude2 : :class:`Position2Def` + Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + longitude : :class:`LatLongDef` + Longitude position of geographically projected marks. + longitude2 : :class:`Position2Def` + Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + opacity : :class:`NumericMarkPropDef` + Opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's ``opacity`` + property. + order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`OrderValueDef`) + Order of the marks. + + + * For stacked marks, this ``order`` channel encodes `stack order + `__. + * For line and trail marks, this ``order`` channel encodes order of data points in + the lines. This can be useful for creating `a connected scatterplot + `__. Setting + ``order`` to ``{"value": null}`` makes the line marks use the original order in + the data sources. + * Otherwise, this ``order`` channel encodes layer order of the marks. + + **Note** : In aggregate plots, ``order`` field should be ``aggregate`` d to avoid + creating additional aggregation grouping. + radius : :class:`PolarDef` + The outer radius in pixels of arc marks. + radius2 : :class:`Position2Def` + The inner radius in pixels of arc marks. + shape : :class:`ShapeDef` + Shape of the mark. + + + #. + For ``point`` marks the supported values include: - plotting shapes: ``"circle"``, + ``"square"``, ``"cross"``, ``"diamond"``, ``"triangle-up"``, ``"triangle-down"``, + ``"triangle-right"``, or ``"triangle-left"``. - the line symbol ``"stroke"`` - + centered directional shapes ``"arrow"``, ``"wedge"``, or ``"triangle"`` - a custom + `SVG path string + `__ (For correct + sizing, custom shape paths should be defined within a square bounding box with + coordinates ranging from -1 to 1 along both the x and y dimensions.) + + #. + For ``geoshape`` marks it should be a field definition of the geojson data + + **Default value:** If undefined, the default shape depends on `mark config + `__ 's ``shape`` + property. ( ``"circle"`` if unset.) + size : :class:`NumericMarkPropDef` + Size of the mark. + + + * For ``"point"``, ``"square"`` and ``"circle"``, – the symbol size, or pixel area + of the mark. + * For ``"bar"`` and ``"tick"`` – the bar and tick's size. + * For ``"text"`` – the text's font size. + * Size is unsupported for ``"line"``, ``"area"``, and ``"rect"``. (Use ``"trail"`` + instead of line with varying size) + stroke : :class:`ColorDef` + Stroke color of the marks. **Default value:** If undefined, the default color + depends on `mark config + `__ 's ``color`` + property. + + *Note:* The ``stroke`` encoding has higher precedence than ``color``, thus may + override the ``color`` encoding if conflicting encodings are specified. + strokeDash : :class:`NumericArrayMarkPropDef` + Stroke dash of the marks. + + **Default value:** ``[1,0]`` (No dash). + strokeOpacity : :class:`NumericMarkPropDef` + Stroke opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's + ``strokeOpacity`` property. + strokeWidth : :class:`NumericMarkPropDef` + Stroke width of the marks. + + **Default value:** If undefined, the default stroke width depends on `mark config + `__ 's + ``strokeWidth`` property. + text : :class:`TextDef` + Text of the ``text`` mark. + theta : :class:`PolarDef` + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : :class:`Position2Def` + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + tooltip : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`, + List(:class:`StringFieldDef`), None) + The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides + `the tooltip property in the mark definition + `__. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + url : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + The URL of an image mark. + x : :class:`PositionDef` + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : :class:`Position2Def` + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + xError : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. + xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Secondary error value of x coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + xOffset : :class:`OffsetDef` + Offset of x-position of the marks + y : :class:`PositionDef` + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : :class:`Position2Def` + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + yError : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. + yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Secondary error value of y coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + yOffset : :class:`OffsetDef` + Offset of y-position of the marks + """ + _schema = {'$ref': '#/definitions/Encoding'} + + def __init__(self, angle=Undefined, color=Undefined, description=Undefined, detail=Undefined, + fill=Undefined, fillOpacity=Undefined, href=Undefined, key=Undefined, + latitude=Undefined, latitude2=Undefined, longitude=Undefined, longitude2=Undefined, + opacity=Undefined, order=Undefined, radius=Undefined, radius2=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeDash=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, text=Undefined, theta=Undefined, + theta2=Undefined, tooltip=Undefined, url=Undefined, x=Undefined, x2=Undefined, + xError=Undefined, xError2=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, + yError=Undefined, yError2=Undefined, yOffset=Undefined, **kwds): + super(Encoding, self).__init__(angle=angle, color=color, description=description, detail=detail, + fill=fill, fillOpacity=fillOpacity, href=href, key=key, + latitude=latitude, latitude2=latitude2, longitude=longitude, + longitude2=longitude2, opacity=opacity, order=order, + radius=radius, radius2=radius2, shape=shape, size=size, + stroke=stroke, strokeDash=strokeDash, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, text=text, + theta=theta, theta2=theta2, tooltip=tooltip, url=url, x=x, x2=x2, + xError=xError, xError2=xError2, xOffset=xOffset, y=y, y2=y2, + yError=yError, yError2=yError2, yOffset=yOffset, **kwds) + + +class ErrorBand(CompositeMark): + """ErrorBand schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/ErrorBand'} + + def __init__(self, *args): + super(ErrorBand, self).__init__(*args) + + +class ErrorBandConfig(VegaLiteSchema): + """ErrorBandConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : anyOf(boolean, :class:`MarkConfig`) + + borders : anyOf(boolean, :class:`MarkConfig`) + + extent : :class:`ErrorBarExtent` + The extent of the band. Available options include: + + + * ``"ci"`` : Extend the band to the 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, + extending from the mean. + * ``"iqr"`` : Extend the band to the q1 and q3. + + **Default value:** ``"stderr"``. + interpolate : :class:`Interpolate` + The line interpolation method for the error band. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes at the midpoint of + each pair of adjacent x-values. + * ``"step-before"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes before the x-value. + * ``"step-after"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes after the x-value. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + tension : float + The tension parameter for the interpolation type of the error band. + """ + _schema = {'$ref': '#/definitions/ErrorBandConfig'} + + def __init__(self, band=Undefined, borders=Undefined, extent=Undefined, interpolate=Undefined, + tension=Undefined, **kwds): + super(ErrorBandConfig, self).__init__(band=band, borders=borders, extent=extent, + interpolate=interpolate, tension=tension, **kwds) + + +class ErrorBandDef(CompositeMarkDef): + """ErrorBandDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`ErrorBand` + The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, + ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, + ``"rule"``, and ``"text"`` ) or a composite mark type ( ``"boxplot"``, + ``"errorband"``, ``"errorbar"`` ). + band : anyOf(boolean, :class:`MarkConfig`) + + borders : anyOf(boolean, :class:`MarkConfig`) + + clip : boolean + Whether a composite mark be clipped to the enclosing group’s width and height. + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + extent : :class:`ErrorBarExtent` + The extent of the band. Available options include: + + + * ``"ci"`` : Extend the band to the 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, + extending from the mean. + * ``"iqr"`` : Extend the band to the q1 and q3. + + **Default value:** ``"stderr"``. + interpolate : :class:`Interpolate` + The line interpolation method for the error band. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes at the midpoint of + each pair of adjacent x-values. + * ``"step-before"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes before the x-value. + * ``"step-after"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes after the x-value. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + opacity : float + The opacity (value between [0,1]) of the mark. + orient : :class:`Orientation` + Orientation of the error band. This is normally automatically determined, but can be + specified when the orientation is ambiguous and cannot be automatically determined. + tension : float + The tension parameter for the interpolation type of the error band. + """ + _schema = {'$ref': '#/definitions/ErrorBandDef'} + + def __init__(self, type=Undefined, band=Undefined, borders=Undefined, clip=Undefined, + color=Undefined, extent=Undefined, interpolate=Undefined, opacity=Undefined, + orient=Undefined, tension=Undefined, **kwds): + super(ErrorBandDef, self).__init__(type=type, band=band, borders=borders, clip=clip, + color=color, extent=extent, interpolate=interpolate, + opacity=opacity, orient=orient, tension=tension, **kwds) + + +class ErrorBar(CompositeMark): + """ErrorBar schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/ErrorBar'} + + def __init__(self, *args): + super(ErrorBar, self).__init__(*args) + + +class ErrorBarConfig(VegaLiteSchema): + """ErrorBarConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + extent : :class:`ErrorBarExtent` + The extent of the rule. Available options include: + + + * ``"ci"`` : Extend the rule to the 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, + extending from the mean. + * ``"iqr"`` : Extend the rule to the q1 and q3. + + **Default value:** ``"stderr"``. + rule : anyOf(boolean, :class:`MarkConfig`) + + size : float + Size of the ticks of an error bar + thickness : float + Thickness of the ticks and the bar of an error bar + ticks : anyOf(boolean, :class:`MarkConfig`) + + """ + _schema = {'$ref': '#/definitions/ErrorBarConfig'} + + def __init__(self, extent=Undefined, rule=Undefined, size=Undefined, thickness=Undefined, + ticks=Undefined, **kwds): + super(ErrorBarConfig, self).__init__(extent=extent, rule=rule, size=size, thickness=thickness, + ticks=ticks, **kwds) + + +class ErrorBarDef(CompositeMarkDef): + """ErrorBarDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`ErrorBar` + The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, + ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, + ``"rule"``, and ``"text"`` ) or a composite mark type ( ``"boxplot"``, + ``"errorband"``, ``"errorbar"`` ). + clip : boolean + Whether a composite mark be clipped to the enclosing group’s width and height. + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + extent : :class:`ErrorBarExtent` + The extent of the rule. Available options include: + + + * ``"ci"`` : Extend the rule to the 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, + extending from the mean. + * ``"iqr"`` : Extend the rule to the q1 and q3. + + **Default value:** ``"stderr"``. + opacity : float + The opacity (value between [0,1]) of the mark. + orient : :class:`Orientation` + Orientation of the error bar. This is normally automatically determined, but can be + specified when the orientation is ambiguous and cannot be automatically determined. + rule : anyOf(boolean, :class:`MarkConfig`) + + size : float + Size of the ticks of an error bar + thickness : float + Thickness of the ticks and the bar of an error bar + ticks : anyOf(boolean, :class:`MarkConfig`) + + """ + _schema = {'$ref': '#/definitions/ErrorBarDef'} + + def __init__(self, type=Undefined, clip=Undefined, color=Undefined, extent=Undefined, + opacity=Undefined, orient=Undefined, rule=Undefined, size=Undefined, + thickness=Undefined, ticks=Undefined, **kwds): + super(ErrorBarDef, self).__init__(type=type, clip=clip, color=color, extent=extent, + opacity=opacity, orient=orient, rule=rule, size=size, + thickness=thickness, ticks=ticks, **kwds) + + +class ErrorBarExtent(VegaLiteSchema): + """ErrorBarExtent schema wrapper + + enum('ci', 'iqr', 'stderr', 'stdev') + """ + _schema = {'$ref': '#/definitions/ErrorBarExtent'} + + def __init__(self, *args): + super(ErrorBarExtent, self).__init__(*args) + + +class Expr(VegaLiteSchema): + """Expr schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/Expr'} + + def __init__(self, *args): + super(Expr, self).__init__(*args) + + +class ExprRef(VegaLiteSchema): + """ExprRef schema wrapper + + Mapping(required=[expr]) + + Attributes + ---------- + + expr : string + Vega expression (which can refer to Vega-Lite parameters). + """ + _schema = {'$ref': '#/definitions/ExprRef'} + + def __init__(self, expr=Undefined, **kwds): + super(ExprRef, self).__init__(expr=expr, **kwds) + + +class FacetEncodingFieldDef(VegaLiteSchema): + """FacetEncodingFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + 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 : anyOf(boolean, :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. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + field : :class:`Field` + **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``. + header : anyOf(:class:`Header`, None) + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, 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 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`` is not supported for ``row`` and ``column``. + spacing : anyOf(float, :class:`RowColnumber`) + The spacing in pixels between sub-views of the composition operator. An object of + the form ``{"row": number, "column": number}`` can be used to set different spacing + values for rows and columns. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/FacetEncodingFieldDef'} + + def __init__(self, aggregate=Undefined, align=Undefined, bandPosition=Undefined, bin=Undefined, + bounds=Undefined, center=Undefined, columns=Undefined, field=Undefined, + header=Undefined, sort=Undefined, spacing=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(FacetEncodingFieldDef, self).__init__(aggregate=aggregate, align=align, + bandPosition=bandPosition, bin=bin, bounds=bounds, + center=center, columns=columns, field=field, + header=header, sort=sort, spacing=spacing, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class FacetFieldDef(VegaLiteSchema): + """FacetFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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 : :class:`Field` + **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``. + header : anyOf(:class:`Header`, None) + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, 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 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`` is not supported for ``row`` and ``column``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/FacetFieldDef'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, + header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, + **kwds): + super(FacetFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, + field=field, header=header, sort=sort, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class FacetMapping(VegaLiteSchema): + """FacetMapping schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : :class:`FacetFieldDef` + A field definition for the horizontal facet of trellis plots. + row : :class:`FacetFieldDef` + A field definition for the vertical facet of trellis plots. + """ + _schema = {'$ref': '#/definitions/FacetMapping'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(FacetMapping, self).__init__(column=column, row=row, **kwds) + + +class FacetedEncoding(VegaLiteSchema): + """FacetedEncoding schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + angle : :class:`NumericMarkPropDef` + Rotation angle of point and text marks. + color : :class:`ColorDef` + Color of the marks – either fill or stroke color based on the ``filled`` property + of mark definition. By default, ``color`` represents fill color for ``"area"``, + ``"bar"``, ``"tick"``, ``"text"``, ``"trail"``, ``"circle"``, and ``"square"`` / + stroke color for ``"line"`` and ``"point"``. + + **Default value:** If undefined, the default color depends on `mark config + `__ 's ``color`` + property. + + *Note:* 1) For fine-grained control over both fill and stroke colors of the marks, + please use the ``fill`` and ``stroke`` channels. The ``fill`` or ``stroke`` + encodings have higher precedence than ``color``, thus may override the ``color`` + encoding if conflicting encodings are specified. 2) See the scale documentation for + more information about customizing `color scheme + `__. + column : :class:`RowColumnEncodingFieldDef` + A field definition for the horizontal facet of trellis plots. + description : anyOf(:class:`StringFieldDefWithCondition`, + :class:`StringValueDefWithCondition`) + A text description of this mark for ARIA accessibility (SVG output only). For SVG + output the ``"aria-label"`` attribute will be set to this description. + detail : anyOf(:class:`FieldDefWithoutScale`, List(:class:`FieldDefWithoutScale`)) + Additional levels of detail for grouping data in aggregate views and in line, trail, + and area marks without mapping data to a specific visual channel. + facet : :class:`FacetEncodingFieldDef` + A field definition for the (flexible) facet of trellis plots. + + If either ``row`` or ``column`` is specified, this channel will be ignored. + fill : :class:`ColorDef` + Fill color of the marks. **Default value:** If undefined, the default color depends + on `mark config `__ + 's ``color`` property. + + *Note:* The ``fill`` encoding has higher precedence than ``color``, thus may + override the ``color`` encoding if conflicting encodings are specified. + fillOpacity : :class:`NumericMarkPropDef` + Fill opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's + ``fillOpacity`` property. + href : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + A URL to load upon mouse click. + key : :class:`FieldDefWithoutScale` + A data field to use as a unique key for data binding. When a visualization’s data is + updated, the key value will be used to match data elements to existing mark + instances. Use a key channel to enable object constancy for transitions over dynamic + data. + latitude : :class:`LatLongDef` + Latitude position of geographically projected marks. + latitude2 : :class:`Position2Def` + Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + longitude : :class:`LatLongDef` + Longitude position of geographically projected marks. + longitude2 : :class:`Position2Def` + Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + opacity : :class:`NumericMarkPropDef` + Opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's ``opacity`` + property. + order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`OrderValueDef`) + Order of the marks. + + + * For stacked marks, this ``order`` channel encodes `stack order + `__. + * For line and trail marks, this ``order`` channel encodes order of data points in + the lines. This can be useful for creating `a connected scatterplot + `__. Setting + ``order`` to ``{"value": null}`` makes the line marks use the original order in + the data sources. + * Otherwise, this ``order`` channel encodes layer order of the marks. + + **Note** : In aggregate plots, ``order`` field should be ``aggregate`` d to avoid + creating additional aggregation grouping. + radius : :class:`PolarDef` + The outer radius in pixels of arc marks. + radius2 : :class:`Position2Def` + The inner radius in pixels of arc marks. + row : :class:`RowColumnEncodingFieldDef` + A field definition for the vertical facet of trellis plots. + shape : :class:`ShapeDef` + Shape of the mark. + + + #. + For ``point`` marks the supported values include: - plotting shapes: ``"circle"``, + ``"square"``, ``"cross"``, ``"diamond"``, ``"triangle-up"``, ``"triangle-down"``, + ``"triangle-right"``, or ``"triangle-left"``. - the line symbol ``"stroke"`` - + centered directional shapes ``"arrow"``, ``"wedge"``, or ``"triangle"`` - a custom + `SVG path string + `__ (For correct + sizing, custom shape paths should be defined within a square bounding box with + coordinates ranging from -1 to 1 along both the x and y dimensions.) + + #. + For ``geoshape`` marks it should be a field definition of the geojson data + + **Default value:** If undefined, the default shape depends on `mark config + `__ 's ``shape`` + property. ( ``"circle"`` if unset.) + size : :class:`NumericMarkPropDef` + Size of the mark. + + + * For ``"point"``, ``"square"`` and ``"circle"``, – the symbol size, or pixel area + of the mark. + * For ``"bar"`` and ``"tick"`` – the bar and tick's size. + * For ``"text"`` – the text's font size. + * Size is unsupported for ``"line"``, ``"area"``, and ``"rect"``. (Use ``"trail"`` + instead of line with varying size) + stroke : :class:`ColorDef` + Stroke color of the marks. **Default value:** If undefined, the default color + depends on `mark config + `__ 's ``color`` + property. + + *Note:* The ``stroke`` encoding has higher precedence than ``color``, thus may + override the ``color`` encoding if conflicting encodings are specified. + strokeDash : :class:`NumericArrayMarkPropDef` + Stroke dash of the marks. + + **Default value:** ``[1,0]`` (No dash). + strokeOpacity : :class:`NumericMarkPropDef` + Stroke opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's + ``strokeOpacity`` property. + strokeWidth : :class:`NumericMarkPropDef` + Stroke width of the marks. + + **Default value:** If undefined, the default stroke width depends on `mark config + `__ 's + ``strokeWidth`` property. + text : :class:`TextDef` + Text of the ``text`` mark. + theta : :class:`PolarDef` + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : :class:`Position2Def` + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + tooltip : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`, + List(:class:`StringFieldDef`), None) + The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides + `the tooltip property in the mark definition + `__. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + url : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + The URL of an image mark. + x : :class:`PositionDef` + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : :class:`Position2Def` + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + xError : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. + xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Secondary error value of x coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + xOffset : :class:`OffsetDef` + Offset of x-position of the marks + y : :class:`PositionDef` + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : :class:`Position2Def` + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + yError : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. + yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Secondary error value of y coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + yOffset : :class:`OffsetDef` + Offset of y-position of the marks + """ + _schema = {'$ref': '#/definitions/FacetedEncoding'} + + def __init__(self, angle=Undefined, color=Undefined, column=Undefined, description=Undefined, + detail=Undefined, facet=Undefined, fill=Undefined, fillOpacity=Undefined, + href=Undefined, key=Undefined, latitude=Undefined, latitude2=Undefined, + longitude=Undefined, longitude2=Undefined, opacity=Undefined, order=Undefined, + radius=Undefined, radius2=Undefined, row=Undefined, shape=Undefined, size=Undefined, + stroke=Undefined, strokeDash=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + text=Undefined, theta=Undefined, theta2=Undefined, tooltip=Undefined, url=Undefined, + x=Undefined, x2=Undefined, xError=Undefined, xError2=Undefined, xOffset=Undefined, + y=Undefined, y2=Undefined, yError=Undefined, yError2=Undefined, yOffset=Undefined, + **kwds): + super(FacetedEncoding, self).__init__(angle=angle, color=color, column=column, + description=description, detail=detail, facet=facet, + fill=fill, fillOpacity=fillOpacity, href=href, key=key, + latitude=latitude, latitude2=latitude2, + longitude=longitude, longitude2=longitude2, + opacity=opacity, order=order, radius=radius, + radius2=radius2, row=row, shape=shape, size=size, + stroke=stroke, strokeDash=strokeDash, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + text=text, theta=theta, theta2=theta2, tooltip=tooltip, + url=url, x=x, x2=x2, xError=xError, xError2=xError2, + xOffset=xOffset, y=y, y2=y2, yError=yError, + yError2=yError2, yOffset=yOffset, **kwds) + + +class Field(VegaLiteSchema): + """Field schema wrapper + + anyOf(:class:`FieldName`, :class:`RepeatRef`) + """ + _schema = {'$ref': '#/definitions/Field'} + + def __init__(self, *args, **kwds): + super(Field, self).__init__(*args, **kwds) + + +class FieldDefWithoutScale(VegaLiteSchema): + """FieldDefWithoutScale schema wrapper + + Mapping(required=[]) + Definition object for a data field, its type and transformation of an encoding channel. + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/FieldDefWithoutScale'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(FieldDefWithoutScale, self).__init__(aggregate=aggregate, bandPosition=bandPosition, + bin=bin, field=field, timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class FieldName(Field): + """FieldName schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/FieldName'} + + def __init__(self, *args): + super(FieldName, self).__init__(*args) + + +class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): + """FieldOrDatumDefWithConditionStringFieldDefstring schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/FieldOrDatumDefWithCondition'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionStringFieldDefstring, self).__init__(aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, type=type, + **kwds) + + +class FieldRange(VegaLiteSchema): + """FieldRange schema wrapper + + Mapping(required=[field]) + + Attributes + ---------- + + field : string + + """ + _schema = {'$ref': '#/definitions/FieldRange'} + + def __init__(self, field=Undefined, **kwds): + super(FieldRange, self).__init__(field=field, **kwds) + + +class Fit(VegaLiteSchema): + """Fit schema wrapper + + anyOf(:class:`GeoJsonFeature`, :class:`GeoJsonFeatureCollection`, + List(:class:`GeoJsonFeature`)) + """ + _schema = {'$ref': '#/definitions/Fit'} + + def __init__(self, *args, **kwds): + super(Fit, self).__init__(*args, **kwds) + + +class FontStyle(VegaLiteSchema): + """FontStyle schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/FontStyle'} + + def __init__(self, *args): + super(FontStyle, self).__init__(*args) + + +class FontWeight(VegaLiteSchema): + """FontWeight schema wrapper + + enum('normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900) + """ + _schema = {'$ref': '#/definitions/FontWeight'} + + def __init__(self, *args): + super(FontWeight, self).__init__(*args) + + +class Generator(Data): + """Generator schema wrapper + + anyOf(:class:`SequenceGenerator`, :class:`SphereGenerator`, :class:`GraticuleGenerator`) + """ + _schema = {'$ref': '#/definitions/Generator'} + + def __init__(self, *args, **kwds): + super(Generator, self).__init__(*args, **kwds) + + +class GenericUnitSpecEncodingAnyMark(VegaLiteSchema): + """GenericUnitSpecEncodingAnyMark schema wrapper + + Mapping(required=[mark]) + Base interface for a unit (single-view) specification. + + Attributes + ---------- + + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and + ``"text"`` ) or a `mark definition object + `__. + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + encoding : :class:`Encoding` + A key-value mapping between encoding channels and definition of fields. + name : string + Name of the visualization for later reference. + params : List(anyOf(:class:`VariableParameter`, :class:`SelectionParameter`)) + An array of parameters that may either be simple variables, or more complex + selections that map user input to data queries. + projection : :class:`Projection` + An object defining properties of geographic projection, which will be applied to + ``shape`` path for ``"geoshape"`` marks and to ``latitude`` and ``"longitude"`` + channels for other marks. + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/GenericUnitSpec'} + + def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + name=Undefined, params=Undefined, projection=Undefined, title=Undefined, + transform=Undefined, **kwds): + super(GenericUnitSpecEncodingAnyMark, self).__init__(mark=mark, data=data, + description=description, encoding=encoding, + name=name, params=params, + projection=projection, title=title, + transform=transform, **kwds) + + +class GeoJsonFeature(Fit): + """GeoJsonFeature schema wrapper + + Any + """ + _schema = {'$ref': '#/definitions/GeoJsonFeature'} + + def __init__(self, *args, **kwds): + super(GeoJsonFeature, self).__init__(*args, **kwds) + + +class GeoJsonFeatureCollection(Fit): + """GeoJsonFeatureCollection schema wrapper + + Any + """ + _schema = {'$ref': '#/definitions/GeoJsonFeatureCollection'} + + def __init__(self, *args, **kwds): + super(GeoJsonFeatureCollection, self).__init__(*args, **kwds) + + +class Gradient(VegaLiteSchema): + """Gradient schema wrapper + + anyOf(:class:`LinearGradient`, :class:`RadialGradient`) + """ + _schema = {'$ref': '#/definitions/Gradient'} + + def __init__(self, *args, **kwds): + super(Gradient, self).__init__(*args, **kwds) + + +class GradientStop(VegaLiteSchema): + """GradientStop schema wrapper + + Mapping(required=[offset, color]) + + Attributes + ---------- + + color : :class:`Color` + The color value at this point in the gradient. + offset : float + The offset fraction for the color stop, indicating its position within the gradient. + """ + _schema = {'$ref': '#/definitions/GradientStop'} + + def __init__(self, color=Undefined, offset=Undefined, **kwds): + super(GradientStop, self).__init__(color=color, offset=offset, **kwds) + + +class GraticuleGenerator(Generator): + """GraticuleGenerator schema wrapper + + Mapping(required=[graticule]) + + Attributes + ---------- + + graticule : anyOf(boolean, :class:`GraticuleParams`) + Generate graticule GeoJSON data for geographic reference lines. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/GraticuleGenerator'} + + def __init__(self, graticule=Undefined, name=Undefined, **kwds): + super(GraticuleGenerator, self).__init__(graticule=graticule, name=name, **kwds) + + +class GraticuleParams(VegaLiteSchema): + """GraticuleParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + extent : :class:`Vector2Vector2number` + Sets both the major and minor extents to the same values. + extentMajor : :class:`Vector2Vector2number` + The major extent of the graticule as a two-element array of coordinates. + extentMinor : :class:`Vector2Vector2number` + The minor extent of the graticule as a two-element array of coordinates. + precision : float + The precision of the graticule in degrees. + + **Default value:** ``2.5`` + step : :class:`Vector2number` + Sets both the major and minor step angles to the same values. + stepMajor : :class:`Vector2number` + The major step angles of the graticule. + + **Default value:** ``[90, 360]`` + stepMinor : :class:`Vector2number` + The minor step angles of the graticule. + + **Default value:** ``[10, 10]`` + """ + _schema = {'$ref': '#/definitions/GraticuleParams'} + + def __init__(self, extent=Undefined, extentMajor=Undefined, extentMinor=Undefined, + precision=Undefined, step=Undefined, stepMajor=Undefined, stepMinor=Undefined, **kwds): + super(GraticuleParams, self).__init__(extent=extent, extentMajor=extentMajor, + extentMinor=extentMinor, precision=precision, step=step, + stepMajor=stepMajor, stepMinor=stepMinor, **kwds) + + +class Header(VegaLiteSchema): + """Header schema wrapper + + Mapping(required=[]) + Headers of row / column channels for faceted plots. + + Attributes + ---------- + + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`) + Horizontal text alignment of header labels. One of ``"left"``, ``"center"``, or + ``"right"``. + labelAnchor : :class:`TitleAnchor` + The anchor position for placing the labels. One of ``"start"``, ``"middle"``, or + ``"end"``. For example, with a label orientation of top these anchor positions map + to a left-, center-, or right-aligned label. + labelAngle : float + The rotation angle of the header labels. + + **Default value:** ``0`` for column header, ``-90`` for row header. + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + The vertical text baseline for the header labels. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The + ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and + ``"bottom"``, but are calculated relative to the ``titleLineHeight`` rather than + ``titleFontSize`` alone. + labelColor : anyOf(:class:`Color`, :class:`ExprRef`) + The color of the header label, can be in hex color code or regular color name. + labelExpr : string + `Vega expression `__ for customizing + labels. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the header's backing ``datum`` object. + labelFont : anyOf(string, :class:`ExprRef`) + The font of the header label. + labelFontSize : anyOf(float, :class:`ExprRef`) + The font size of the header label, in pixels. + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + The font style of the header label. + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + The font weight of the header label. + labelLimit : anyOf(float, :class:`ExprRef`) + The maximum length of the header label in pixels. The text value will be + automatically truncated if the rendered size exceeds the limit. + + **Default value:** ``0``, indicating no limit + labelLineHeight : anyOf(float, :class:`ExprRef`) + Line height in pixels for multi-line header labels or title text with ``"line-top"`` + or ``"line-bottom"`` baseline. + labelOrient : :class:`Orient` + The orientation of the header label. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + labelPadding : anyOf(float, :class:`ExprRef`) + The padding, in pixel, between facet header's label and the plot. + + **Default value:** ``10`` + labels : boolean + A boolean flag indicating if labels should be included as part of the header. + + **Default value:** ``true``. + orient : :class:`Orient` + Shortcut for setting both labelOrient and titleOrient. + title : anyOf(:class:`Text`, 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. + titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + Horizontal text alignment (to the anchor) of header titles. + titleAnchor : :class:`TitleAnchor` + The anchor position for placing the title. One of ``"start"``, ``"middle"``, or + ``"end"``. For example, with an orientation of top these anchor positions map to a + left-, center-, or right-aligned title. + titleAngle : float + The rotation angle of the header title. + + **Default value:** ``0``. + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + The vertical text baseline for the header title. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The + ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and + ``"bottom"``, but are calculated relative to the ``titleLineHeight`` rather than + ``titleFontSize`` alone. + + **Default value:** ``"middle"`` + titleColor : anyOf(:class:`Color`, :class:`ExprRef`) + Color of the header title, can be in hex color code or regular color name. + titleFont : anyOf(string, :class:`ExprRef`) + Font of the header title. (e.g., ``"Helvetica Neue"`` ). + titleFontSize : anyOf(float, :class:`ExprRef`) + Font size of the header title. + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + The font style of the header title. + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + Font weight of the header title. This can be either a string (e.g ``"bold"``, + ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where + ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). + titleLimit : anyOf(float, :class:`ExprRef`) + The maximum length of the header title in pixels. The text value will be + automatically truncated if the rendered size exceeds the limit. + + **Default value:** ``0``, indicating no limit + titleLineHeight : anyOf(float, :class:`ExprRef`) + Line height in pixels for multi-line header title text or title text with + ``"line-top"`` or ``"line-bottom"`` baseline. + titleOrient : :class:`Orient` + The orientation of the header title. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + titlePadding : anyOf(float, :class:`ExprRef`) + The padding, in pixel, between facet header's title and the label. + + **Default value:** ``10`` + """ + _schema = {'$ref': '#/definitions/Header'} + + def __init__(self, format=Undefined, formatType=Undefined, labelAlign=Undefined, + labelAnchor=Undefined, labelAngle=Undefined, labelBaseline=Undefined, + labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, + labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, + labelLimit=Undefined, labelLineHeight=Undefined, labelOrient=Undefined, + labelPadding=Undefined, labels=Undefined, orient=Undefined, title=Undefined, + titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, + titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, + titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, + titleLimit=Undefined, titleLineHeight=Undefined, titleOrient=Undefined, + titlePadding=Undefined, **kwds): + super(Header, self).__init__(format=format, formatType=formatType, labelAlign=labelAlign, + labelAnchor=labelAnchor, labelAngle=labelAngle, + labelBaseline=labelBaseline, labelColor=labelColor, + labelExpr=labelExpr, labelFont=labelFont, + labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, labelLimit=labelLimit, + labelLineHeight=labelLineHeight, labelOrient=labelOrient, + labelPadding=labelPadding, labels=labels, orient=orient, + title=title, titleAlign=titleAlign, titleAnchor=titleAnchor, + titleAngle=titleAngle, titleBaseline=titleBaseline, + titleColor=titleColor, titleFont=titleFont, + titleFontSize=titleFontSize, titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, titleLimit=titleLimit, + titleLineHeight=titleLineHeight, titleOrient=titleOrient, + titlePadding=titlePadding, **kwds) + + +class HeaderConfig(VegaLiteSchema): + """HeaderConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`) + Horizontal text alignment of header labels. One of ``"left"``, ``"center"``, or + ``"right"``. + labelAnchor : :class:`TitleAnchor` + The anchor position for placing the labels. One of ``"start"``, ``"middle"``, or + ``"end"``. For example, with a label orientation of top these anchor positions map + to a left-, center-, or right-aligned label. + labelAngle : float + The rotation angle of the header labels. + + **Default value:** ``0`` for column header, ``-90`` for row header. + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + The vertical text baseline for the header labels. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The + ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and + ``"bottom"``, but are calculated relative to the ``titleLineHeight`` rather than + ``titleFontSize`` alone. + labelColor : anyOf(:class:`Color`, :class:`ExprRef`) + The color of the header label, can be in hex color code or regular color name. + labelExpr : string + `Vega expression `__ for customizing + labels. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the header's backing ``datum`` object. + labelFont : anyOf(string, :class:`ExprRef`) + The font of the header label. + labelFontSize : anyOf(float, :class:`ExprRef`) + The font size of the header label, in pixels. + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + The font style of the header label. + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + The font weight of the header label. + labelLimit : anyOf(float, :class:`ExprRef`) + The maximum length of the header label in pixels. The text value will be + automatically truncated if the rendered size exceeds the limit. + + **Default value:** ``0``, indicating no limit + labelLineHeight : anyOf(float, :class:`ExprRef`) + Line height in pixels for multi-line header labels or title text with ``"line-top"`` + or ``"line-bottom"`` baseline. + labelOrient : :class:`Orient` + The orientation of the header label. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + labelPadding : anyOf(float, :class:`ExprRef`) + The padding, in pixel, between facet header's label and the plot. + + **Default value:** ``10`` + labels : boolean + A boolean flag indicating if labels should be included as part of the header. + + **Default value:** ``true``. + orient : :class:`Orient` + Shortcut for setting both labelOrient and titleOrient. + title : None + Set to null to disable title for the axis, legend, or header. + titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + Horizontal text alignment (to the anchor) of header titles. + titleAnchor : :class:`TitleAnchor` + The anchor position for placing the title. One of ``"start"``, ``"middle"``, or + ``"end"``. For example, with an orientation of top these anchor positions map to a + left-, center-, or right-aligned title. + titleAngle : float + The rotation angle of the header title. + + **Default value:** ``0``. + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + The vertical text baseline for the header title. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or ``"line-bottom"``. The + ``"line-top"`` and ``"line-bottom"`` values operate similarly to ``"top"`` and + ``"bottom"``, but are calculated relative to the ``titleLineHeight`` rather than + ``titleFontSize`` alone. + + **Default value:** ``"middle"`` + titleColor : anyOf(:class:`Color`, :class:`ExprRef`) + Color of the header title, can be in hex color code or regular color name. + titleFont : anyOf(string, :class:`ExprRef`) + Font of the header title. (e.g., ``"Helvetica Neue"`` ). + titleFontSize : anyOf(float, :class:`ExprRef`) + Font size of the header title. + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + The font style of the header title. + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + Font weight of the header title. This can be either a string (e.g ``"bold"``, + ``"normal"`` ) or a number ( ``100``, ``200``, ``300``, ..., ``900`` where + ``"normal"`` = ``400`` and ``"bold"`` = ``700`` ). + titleLimit : anyOf(float, :class:`ExprRef`) + The maximum length of the header title in pixels. The text value will be + automatically truncated if the rendered size exceeds the limit. + + **Default value:** ``0``, indicating no limit + titleLineHeight : anyOf(float, :class:`ExprRef`) + Line height in pixels for multi-line header title text or title text with + ``"line-top"`` or ``"line-bottom"`` baseline. + titleOrient : :class:`Orient` + The orientation of the header title. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + titlePadding : anyOf(float, :class:`ExprRef`) + The padding, in pixel, between facet header's title and the label. + + **Default value:** ``10`` + """ + _schema = {'$ref': '#/definitions/HeaderConfig'} + + def __init__(self, format=Undefined, formatType=Undefined, labelAlign=Undefined, + labelAnchor=Undefined, labelAngle=Undefined, labelBaseline=Undefined, + labelColor=Undefined, labelExpr=Undefined, labelFont=Undefined, + labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, + labelLimit=Undefined, labelLineHeight=Undefined, labelOrient=Undefined, + labelPadding=Undefined, labels=Undefined, orient=Undefined, title=Undefined, + titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, + titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, + titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, + titleLimit=Undefined, titleLineHeight=Undefined, titleOrient=Undefined, + titlePadding=Undefined, **kwds): + super(HeaderConfig, self).__init__(format=format, formatType=formatType, labelAlign=labelAlign, + labelAnchor=labelAnchor, labelAngle=labelAngle, + labelBaseline=labelBaseline, labelColor=labelColor, + labelExpr=labelExpr, labelFont=labelFont, + labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, labelLimit=labelLimit, + labelLineHeight=labelLineHeight, labelOrient=labelOrient, + labelPadding=labelPadding, labels=labels, orient=orient, + title=title, titleAlign=titleAlign, titleAnchor=titleAnchor, + titleAngle=titleAngle, titleBaseline=titleBaseline, + titleColor=titleColor, titleFont=titleFont, + titleFontSize=titleFontSize, titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, titleLimit=titleLimit, + titleLineHeight=titleLineHeight, titleOrient=titleOrient, + titlePadding=titlePadding, **kwds) + + +class HexColor(Color): + """HexColor schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/HexColor'} + + def __init__(self, *args): + super(HexColor, self).__init__(*args) + + +class ImputeMethod(VegaLiteSchema): + """ImputeMethod schema wrapper + + enum('value', 'median', 'max', 'min', 'mean') + """ + _schema = {'$ref': '#/definitions/ImputeMethod'} + + def __init__(self, *args): + super(ImputeMethod, self).__init__(*args) + + +class ImputeParams(VegaLiteSchema): + """ImputeParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + frame : List(anyOf(None, float)) + A frame specification as a two-element array used to control the window over which + the specified method is applied. The array entries should either be a number + indicating the offset from the current data object, or null to indicate unbounded + rows preceding or following the current data object. For example, the value ``[-5, + 5]`` indicates that the window should include five objects preceding and five + objects following the current object. + + **Default value:** : ``[null, null]`` indicating that the window includes all + objects. + keyvals : anyOf(List(Any), :class:`ImputeSequence`) + Defines the key values that should be considered for imputation. An array of key + values or an object defining a `number sequence + `__. + + If provided, this will be used in addition to the key values observed within the + input data. If not provided, the values will be derived from all unique values of + the ``key`` field. For ``impute`` in ``encoding``, the key field is the x-field if + the y-field is imputed, or vice versa. + + If there is no impute grouping, this property *must* be specified. + method : :class:`ImputeMethod` + The imputation method to use for the field value of imputed data objects. One of + ``"value"``, ``"mean"``, ``"median"``, ``"max"`` or ``"min"``. + + **Default value:** ``"value"`` + value : Any + The field value to use when the imputation ``method`` is ``"value"``. + """ + _schema = {'$ref': '#/definitions/ImputeParams'} + + def __init__(self, frame=Undefined, keyvals=Undefined, method=Undefined, value=Undefined, **kwds): + super(ImputeParams, self).__init__(frame=frame, keyvals=keyvals, method=method, value=value, + **kwds) + + +class ImputeSequence(VegaLiteSchema): + """ImputeSequence schema wrapper + + Mapping(required=[stop]) + + Attributes + ---------- + + stop : float + The ending value(exclusive) of the sequence. + start : float + The starting value of the sequence. **Default value:** ``0`` + step : float + The step value between sequence entries. **Default value:** ``1`` or ``-1`` if + ``stop < start`` + """ + _schema = {'$ref': '#/definitions/ImputeSequence'} + + def __init__(self, stop=Undefined, start=Undefined, step=Undefined, **kwds): + super(ImputeSequence, self).__init__(stop=stop, start=start, step=step, **kwds) + + +class InlineData(DataSource): + """InlineData schema wrapper + + Mapping(required=[values]) + + Attributes + ---------- + + values : :class:`InlineDataset` + The full data set, included inline. This can be an array of objects or primitive + values, an object, or a string. Arrays of primitive values are ingested as objects + with a ``data`` property. Strings are parsed according to the specified format type. + format : :class:`DataFormat` + An object that specifies the format for parsing the data. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/InlineData'} + + def __init__(self, values=Undefined, format=Undefined, name=Undefined, **kwds): + super(InlineData, self).__init__(values=values, format=format, name=name, **kwds) + + +class InlineDataset(VegaLiteSchema): + """InlineDataset schema wrapper + + anyOf(List(float), List(string), List(boolean), List(Mapping(required=[])), string, + Mapping(required=[])) + """ + _schema = {'$ref': '#/definitions/InlineDataset'} + + def __init__(self, *args, **kwds): + super(InlineDataset, self).__init__(*args, **kwds) + + +class Interpolate(VegaLiteSchema): + """Interpolate schema wrapper + + enum('basis', 'basis-open', 'basis-closed', 'bundle', 'cardinal', 'cardinal-open', + 'cardinal-closed', 'catmull-rom', 'linear', 'linear-closed', 'monotone', 'natural', 'step', + 'step-before', 'step-after') + """ + _schema = {'$ref': '#/definitions/Interpolate'} + + def __init__(self, *args): + super(Interpolate, self).__init__(*args) + + +class IntervalSelectionConfig(VegaLiteSchema): + """IntervalSelectionConfig schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : string + Determines the default event processing and data query for the selection. Vega-Lite + currently supports two selection types: + + + * ``"point"`` -- to select multiple discrete data values; the first value is + selected on ``click`` and additional values toggled on shift-click. + * ``"interval"`` -- to select a continuous range of data values on ``drag``. + clear : anyOf(:class:`Stream`, string, boolean) + Clears the selection, emptying it of all values. This property can be a `Event + Stream `__ or ``false`` to disable + clear. + + **Default value:** ``dblclick``. + + **See also:** `clear examples + `__ in the + documentation. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. + + **See also:** The `projection with encodings and fields section + `__ in the + documentation. + mark : :class:`BrushConfig` + An interval selection also adds a rectangle mark to depict the extents of the + interval. The ``mark`` property can be used to customize the appearance of the mark. + + **See also:** `mark examples + `__ in the documentation. + on : anyOf(:class:`Stream`, string) + A `Vega event stream `__ (object or + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end + `__. + + **See also:** `on examples + `__ in the documentation. + resolve : :class:`SelectionResolution` + With layered and multi-view displays, a strategy that determines how selections' + data queries are resolved when applied in a filter transform, conditional encoding + rule, or scale domain. + + One of: + + + * ``"global"`` -- only one brush exists for the entire SPLOM. When the user begins + to drag, any previous brushes are cleared, and a new one is constructed. + * ``"union"`` -- each cell contains its own brush, and points are highlighted if + they lie within *any* of these individual brushes. + * ``"intersect"`` -- each cell contains its own brush, and points are highlighted + only if they fall within *all* of these individual brushes. + + **Default value:** ``global``. + + **See also:** `resolve examples + `__ in the + documentation. + translate : anyOf(string, boolean) + When truthy, allows a user to interactively move an interval selection + back-and-forth. Can be ``true``, ``false`` (to disable panning), or a `Vega event + stream definition `__ which must + include a start and end event to trigger continuous panning. Discrete panning (e.g., + pressing the left/right arrow keys) will be supported in future versions. + + **Default value:** ``true``, which corresponds to ``[mousedown, window:mouseup] > + window:mousemove!``. This default allows users to clicks and drags within an + interval selection to reposition it. + + **See also:** `translate examples + `__ in the + documentation. + zoom : anyOf(string, boolean) + When truthy, allows a user to interactively resize an interval selection. Can be + ``true``, ``false`` (to disable zooming), or a `Vega event stream definition + `__. Currently, only ``wheel`` + events are supported, but custom event streams can still be used to specify filters, + debouncing, and throttling. Future versions will expand the set of events that can + trigger this transformation. + + **Default value:** ``true``, which corresponds to ``wheel!``. This default allows + users to use the mouse wheel to resize an interval selection. + + **See also:** `zoom examples + `__ in the documentation. + """ + _schema = {'$ref': '#/definitions/IntervalSelectionConfig'} + + def __init__(self, type=Undefined, clear=Undefined, encodings=Undefined, mark=Undefined, + on=Undefined, resolve=Undefined, translate=Undefined, zoom=Undefined, **kwds): + super(IntervalSelectionConfig, self).__init__(type=type, clear=clear, encodings=encodings, + mark=mark, on=on, resolve=resolve, + translate=translate, zoom=zoom, **kwds) + + +class IntervalSelectionConfigWithoutType(VegaLiteSchema): + """IntervalSelectionConfigWithoutType schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + clear : anyOf(:class:`Stream`, string, boolean) + Clears the selection, emptying it of all values. This property can be a `Event + Stream `__ or ``false`` to disable + clear. + + **Default value:** ``dblclick``. + + **See also:** `clear examples + `__ in the + documentation. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. + + **See also:** The `projection with encodings and fields section + `__ in the + documentation. + mark : :class:`BrushConfig` + An interval selection also adds a rectangle mark to depict the extents of the + interval. The ``mark`` property can be used to customize the appearance of the mark. + + **See also:** `mark examples + `__ in the documentation. + on : anyOf(:class:`Stream`, string) + A `Vega event stream `__ (object or + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end + `__. + + **See also:** `on examples + `__ in the documentation. + resolve : :class:`SelectionResolution` + With layered and multi-view displays, a strategy that determines how selections' + data queries are resolved when applied in a filter transform, conditional encoding + rule, or scale domain. + + One of: + + + * ``"global"`` -- only one brush exists for the entire SPLOM. When the user begins + to drag, any previous brushes are cleared, and a new one is constructed. + * ``"union"`` -- each cell contains its own brush, and points are highlighted if + they lie within *any* of these individual brushes. + * ``"intersect"`` -- each cell contains its own brush, and points are highlighted + only if they fall within *all* of these individual brushes. + + **Default value:** ``global``. + + **See also:** `resolve examples + `__ in the + documentation. + translate : anyOf(string, boolean) + When truthy, allows a user to interactively move an interval selection + back-and-forth. Can be ``true``, ``false`` (to disable panning), or a `Vega event + stream definition `__ which must + include a start and end event to trigger continuous panning. Discrete panning (e.g., + pressing the left/right arrow keys) will be supported in future versions. + + **Default value:** ``true``, which corresponds to ``[mousedown, window:mouseup] > + window:mousemove!``. This default allows users to clicks and drags within an + interval selection to reposition it. + + **See also:** `translate examples + `__ in the + documentation. + zoom : anyOf(string, boolean) + When truthy, allows a user to interactively resize an interval selection. Can be + ``true``, ``false`` (to disable zooming), or a `Vega event stream definition + `__. Currently, only ``wheel`` + events are supported, but custom event streams can still be used to specify filters, + debouncing, and throttling. Future versions will expand the set of events that can + trigger this transformation. + + **Default value:** ``true``, which corresponds to ``wheel!``. This default allows + users to use the mouse wheel to resize an interval selection. + + **See also:** `zoom examples + `__ in the documentation. + """ + _schema = {'$ref': '#/definitions/IntervalSelectionConfigWithoutType'} + + def __init__(self, clear=Undefined, encodings=Undefined, mark=Undefined, on=Undefined, + resolve=Undefined, translate=Undefined, zoom=Undefined, **kwds): + super(IntervalSelectionConfigWithoutType, self).__init__(clear=clear, encodings=encodings, + mark=mark, on=on, resolve=resolve, + translate=translate, zoom=zoom, **kwds) + + +class JoinAggregateFieldDef(VegaLiteSchema): + """JoinAggregateFieldDef schema wrapper + + Mapping(required=[op, as]) + + Attributes + ---------- + + op : :class:`AggregateOp` + The aggregation operation to apply (e.g., ``"sum"``, ``"average"`` or ``"count"`` ). + See the list of all supported operations `here + `__. + field : :class:`FieldName` + The data field for which to compute the aggregate function. This can be omitted for + functions that do not operate over a field such as ``"count"``. + as : :class:`FieldName` + The output name for the join aggregate operation. + """ + _schema = {'$ref': '#/definitions/JoinAggregateFieldDef'} + + def __init__(self, op=Undefined, field=Undefined, **kwds): + super(JoinAggregateFieldDef, self).__init__(op=op, field=field, **kwds) + + +class JsonDataFormat(DataFormat): + """JsonDataFormat schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + parse : anyOf(:class:`Parse`, None) + If set to ``null``, disable type inference based on the spec and only use type + inference based on the data. Alternatively, a parsing directive object can be + provided for explicit data types. Each property of the object corresponds to a field + name, and the value to the desired data type (one of ``"number"``, ``"boolean"``, + ``"date"``, or null (do not parse the field)). For example, ``"parse": + {"modified_on": "date"}`` parses the ``modified_on`` field in each input record a + Date value. + + For ``"date"``, we parse data based using JavaScript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + property : string + The JSON property containing the desired data. This parameter can be used when the + loaded JSON file may have surrounding structure or meta-data. For example + ``"property": "values.features"`` is equivalent to retrieving + ``json.values.features`` from the loaded JSON object. + type : string + Type of input data: ``"json"``, ``"csv"``, ``"tsv"``, ``"dsv"``. + + **Default value:** The default format type is determined by the extension of the + file URL. If no extension is detected, ``"json"`` will be used by default. + """ + _schema = {'$ref': '#/definitions/JsonDataFormat'} + + def __init__(self, parse=Undefined, property=Undefined, type=Undefined, **kwds): + super(JsonDataFormat, self).__init__(parse=parse, property=property, type=type, **kwds) + + +class LabelOverlap(VegaLiteSchema): + """LabelOverlap schema wrapper + + anyOf(boolean, string, string) + """ + _schema = {'$ref': '#/definitions/LabelOverlap'} + + def __init__(self, *args, **kwds): + super(LabelOverlap, self).__init__(*args, **kwds) + + +class LatLongDef(VegaLiteSchema): + """LatLongDef schema wrapper + + anyOf(:class:`LatLongFieldDef`, :class:`DatumDef`) + """ + _schema = {'$ref': '#/definitions/LatLongDef'} + + def __init__(self, *args, **kwds): + super(LatLongDef, self).__init__(*args, **kwds) + + +class LatLongFieldDef(LatLongDef): + """LatLongFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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 : string + 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/LatLongFieldDef'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(LatLongFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, + field=field, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class LayerRepeatMapping(VegaLiteSchema): + """LayerRepeatMapping schema wrapper + + Mapping(required=[layer]) + + Attributes + ---------- + + layer : List(string) + An array of fields to be repeated as layers. + column : List(string) + An array of fields to be repeated horizontally. + row : List(string) + An array of fields to be repeated vertically. + """ + _schema = {'$ref': '#/definitions/LayerRepeatMapping'} + + def __init__(self, layer=Undefined, column=Undefined, row=Undefined, **kwds): + super(LayerRepeatMapping, self).__init__(layer=layer, column=column, row=row, **kwds) + + +class LayoutAlign(VegaLiteSchema): + """LayoutAlign schema wrapper + + enum('all', 'each', 'none') + """ + _schema = {'$ref': '#/definitions/LayoutAlign'} + + def __init__(self, *args): + super(LayoutAlign, self).__init__(*args) + + +class Legend(VegaLiteSchema): + """Legend schema wrapper + + Mapping(required=[]) + Properties of a legend or boolean flag for determining whether to show it. + + Attributes + ---------- + + aria : anyOf(boolean, :class:`ExprRef`) + + clipHeight : anyOf(float, :class:`ExprRef`) + + columnPadding : anyOf(float, :class:`ExprRef`) + + columns : anyOf(float, :class:`ExprRef`) + + cornerRadius : anyOf(float, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + direction : :class:`Orientation` + The direction of the legend, one of ``"vertical"`` or ``"horizontal"``. + + **Default value:** + + + * For top-/bottom- ``orient`` ed legends, ``"horizontal"`` + * For left-/right- ``orient`` ed legends, ``"vertical"`` + * For top/bottom-left/right- ``orient`` ed legends, ``"horizontal"`` for gradient + legends and ``"vertical"`` for symbol legends. + fillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + gradientLength : anyOf(float, :class:`ExprRef`) + + gradientOpacity : anyOf(float, :class:`ExprRef`) + + gradientStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + gradientStrokeWidth : anyOf(float, :class:`ExprRef`) + + gradientThickness : anyOf(float, :class:`ExprRef`) + + gridAlign : anyOf(:class:`LayoutAlign`, :class:`ExprRef`) + + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`) + + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + labelExpr : string + `Vega expression `__ for customizing + labels. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the legend's backing ``datum`` object. + labelFont : anyOf(string, :class:`ExprRef`) + + labelFontSize : anyOf(float, :class:`ExprRef`) + + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + labelLimit : anyOf(float, :class:`ExprRef`) + + labelOffset : anyOf(float, :class:`ExprRef`) + + labelOpacity : anyOf(float, :class:`ExprRef`) + + labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + + labelPadding : anyOf(float, :class:`ExprRef`) + + labelSeparation : anyOf(float, :class:`ExprRef`) + + legendX : anyOf(float, :class:`ExprRef`) + + legendY : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + + orient : :class:`LegendOrient` + The orientation of the legend, which determines how the legend is positioned within + the scene. One of ``"left"``, ``"right"``, ``"top"``, ``"bottom"``, ``"top-left"``, + ``"top-right"``, ``"bottom-left"``, ``"bottom-right"``, ``"none"``. + + **Default value:** ``"right"`` + padding : anyOf(float, :class:`ExprRef`) + + rowPadding : anyOf(float, :class:`ExprRef`) + + strokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolDash : anyOf(List(float), :class:`ExprRef`) + + symbolDashOffset : anyOf(float, :class:`ExprRef`) + + symbolFillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolLimit : anyOf(float, :class:`ExprRef`) + + symbolOffset : anyOf(float, :class:`ExprRef`) + + symbolOpacity : anyOf(float, :class:`ExprRef`) + + symbolSize : anyOf(float, :class:`ExprRef`) + + symbolStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolStrokeWidth : anyOf(float, :class:`ExprRef`) + + symbolType : anyOf(:class:`SymbolShape`, :class:`ExprRef`) + + tickCount : anyOf(:class:`TickCount`, :class:`ExprRef`) + + tickMinStep : anyOf(float, :class:`ExprRef`) + The minimum desired step between legend ticks, in terms of scale domain values. For + example, a value of ``1`` indicates that ticks should not be less than 1 unit apart. + If ``tickMinStep`` is specified, the ``tickCount`` value will be adjusted, if + necessary, to enforce the minimum step value. + + **Default value** : ``undefined`` + title : anyOf(:class:`Text`, 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. + titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + + titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + titleFont : anyOf(string, :class:`ExprRef`) + + titleFontSize : anyOf(float, :class:`ExprRef`) + + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + titleLimit : anyOf(float, :class:`ExprRef`) + + titleLineHeight : anyOf(float, :class:`ExprRef`) + + titleOpacity : anyOf(float, :class:`ExprRef`) + + titleOrient : anyOf(:class:`Orient`, :class:`ExprRef`) + + titlePadding : anyOf(float, :class:`ExprRef`) + + type : enum('symbol', 'gradient') + The type of the legend. Use ``"symbol"`` to create a discrete legend and + ``"gradient"`` for a continuous color gradient. + + **Default value:** ``"gradient"`` for non-binned quantitative fields and temporal + fields; ``"symbol"`` otherwise. + values : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`), + :class:`ExprRef`) + Explicitly set the visible legend values. + zindex : float + A non-negative integer indicating the z-index of the legend. If zindex is 0, legend + should be drawn behind all chart elements. To put them in front, use zindex = 1. + """ + _schema = {'$ref': '#/definitions/Legend'} + + def __init__(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, + cornerRadius=Undefined, description=Undefined, direction=Undefined, + fillColor=Undefined, format=Undefined, formatType=Undefined, gradientLength=Undefined, + gradientOpacity=Undefined, gradientStrokeColor=Undefined, + gradientStrokeWidth=Undefined, gradientThickness=Undefined, gridAlign=Undefined, + labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, + labelExpr=Undefined, labelFont=Undefined, labelFontSize=Undefined, + labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, + labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, + labelPadding=Undefined, labelSeparation=Undefined, legendX=Undefined, + legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, + rowPadding=Undefined, strokeColor=Undefined, symbolDash=Undefined, + symbolDashOffset=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, + symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, + symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, + tickCount=Undefined, tickMinStep=Undefined, title=Undefined, titleAlign=Undefined, + titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, + titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, + titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, + titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, type=Undefined, + values=Undefined, zindex=Undefined, **kwds): + super(Legend, self).__init__(aria=aria, clipHeight=clipHeight, columnPadding=columnPadding, + columns=columns, cornerRadius=cornerRadius, + description=description, direction=direction, fillColor=fillColor, + format=format, formatType=formatType, + gradientLength=gradientLength, gradientOpacity=gradientOpacity, + gradientStrokeColor=gradientStrokeColor, + gradientStrokeWidth=gradientStrokeWidth, + gradientThickness=gradientThickness, gridAlign=gridAlign, + labelAlign=labelAlign, labelBaseline=labelBaseline, + labelColor=labelColor, labelExpr=labelExpr, labelFont=labelFont, + labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, labelLimit=labelLimit, + labelOffset=labelOffset, labelOpacity=labelOpacity, + labelOverlap=labelOverlap, labelPadding=labelPadding, + labelSeparation=labelSeparation, legendX=legendX, legendY=legendY, + offset=offset, orient=orient, padding=padding, + rowPadding=rowPadding, strokeColor=strokeColor, + symbolDash=symbolDash, symbolDashOffset=symbolDashOffset, + symbolFillColor=symbolFillColor, symbolLimit=symbolLimit, + symbolOffset=symbolOffset, symbolOpacity=symbolOpacity, + symbolSize=symbolSize, symbolStrokeColor=symbolStrokeColor, + symbolStrokeWidth=symbolStrokeWidth, symbolType=symbolType, + tickCount=tickCount, tickMinStep=tickMinStep, title=title, + titleAlign=titleAlign, titleAnchor=titleAnchor, + titleBaseline=titleBaseline, titleColor=titleColor, + titleFont=titleFont, titleFontSize=titleFontSize, + titleFontStyle=titleFontStyle, titleFontWeight=titleFontWeight, + titleLimit=titleLimit, titleLineHeight=titleLineHeight, + titleOpacity=titleOpacity, titleOrient=titleOrient, + titlePadding=titlePadding, type=type, values=values, zindex=zindex, + **kwds) + + +class LegendBinding(VegaLiteSchema): + """LegendBinding schema wrapper + + anyOf(string, :class:`LegendStreamBinding`) + """ + _schema = {'$ref': '#/definitions/LegendBinding'} + + def __init__(self, *args, **kwds): + super(LegendBinding, self).__init__(*args, **kwds) + + +class LegendConfig(VegaLiteSchema): + """LegendConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aria : anyOf(boolean, :class:`ExprRef`) + + clipHeight : anyOf(float, :class:`ExprRef`) + + columnPadding : anyOf(float, :class:`ExprRef`) + + columns : anyOf(float, :class:`ExprRef`) + + cornerRadius : anyOf(float, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + direction : :class:`Orientation` + The direction of the legend, one of ``"vertical"`` or ``"horizontal"``. + + **Default value:** + + + * For top-/bottom- ``orient`` ed legends, ``"horizontal"`` + * For left-/right- ``orient`` ed legends, ``"vertical"`` + * For top/bottom-left/right- ``orient`` ed legends, ``"horizontal"`` for gradient + legends and ``"vertical"`` for symbol legends. + disable : boolean + Disable legend by default + fillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + gradientDirection : anyOf(:class:`Orientation`, :class:`ExprRef`) + + gradientHorizontalMaxLength : float + Max legend length for a horizontal gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``200`` + gradientHorizontalMinLength : float + Min legend length for a horizontal gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``100`` + gradientLabelLimit : anyOf(float, :class:`ExprRef`) + + gradientLabelOffset : anyOf(float, :class:`ExprRef`) + + gradientLength : anyOf(float, :class:`ExprRef`) + + gradientOpacity : anyOf(float, :class:`ExprRef`) + + gradientStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + gradientStrokeWidth : anyOf(float, :class:`ExprRef`) + + gradientThickness : anyOf(float, :class:`ExprRef`) + + gradientVerticalMaxLength : float + Max legend length for a vertical gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``200`` + gradientVerticalMinLength : float + Min legend length for a vertical gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``100`` + gridAlign : anyOf(:class:`LayoutAlign`, :class:`ExprRef`) + + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`) + + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + labelFont : anyOf(string, :class:`ExprRef`) + + labelFontSize : anyOf(float, :class:`ExprRef`) + + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + labelLimit : anyOf(float, :class:`ExprRef`) + + labelOffset : anyOf(float, :class:`ExprRef`) + + labelOpacity : anyOf(float, :class:`ExprRef`) + + labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + 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). + + **Default value:** ``"greedy"`` for ``log scales otherwise`` true`. + labelPadding : anyOf(float, :class:`ExprRef`) + + labelSeparation : anyOf(float, :class:`ExprRef`) + + layout : :class:`ExprRef` + + legendX : anyOf(float, :class:`ExprRef`) + + legendY : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + + orient : :class:`LegendOrient` + The orientation of the legend, which determines how the legend is positioned within + the scene. One of ``"left"``, ``"right"``, ``"top"``, ``"bottom"``, ``"top-left"``, + ``"top-right"``, ``"bottom-left"``, ``"bottom-right"``, ``"none"``. + + **Default value:** ``"right"`` + padding : anyOf(float, :class:`ExprRef`) + + rowPadding : anyOf(float, :class:`ExprRef`) + + strokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + symbolBaseFillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolBaseStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolDash : anyOf(List(float), :class:`ExprRef`) + + symbolDashOffset : anyOf(float, :class:`ExprRef`) + + symbolDirection : anyOf(:class:`Orientation`, :class:`ExprRef`) + + symbolFillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolLimit : anyOf(float, :class:`ExprRef`) + + symbolOffset : anyOf(float, :class:`ExprRef`) + + symbolOpacity : anyOf(float, :class:`ExprRef`) + + symbolSize : anyOf(float, :class:`ExprRef`) + + symbolStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolStrokeWidth : anyOf(float, :class:`ExprRef`) + + symbolType : anyOf(:class:`SymbolShape`, :class:`ExprRef`) + + tickCount : anyOf(:class:`TickCount`, :class:`ExprRef`) + + title : None + Set to null to disable title for the axis, legend, or header. + titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + + titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + titleFont : anyOf(string, :class:`ExprRef`) + + titleFontSize : anyOf(float, :class:`ExprRef`) + + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + titleLimit : anyOf(float, :class:`ExprRef`) + + titleLineHeight : anyOf(float, :class:`ExprRef`) + + titleOpacity : anyOf(float, :class:`ExprRef`) + + titleOrient : anyOf(:class:`Orient`, :class:`ExprRef`) + + titlePadding : anyOf(float, :class:`ExprRef`) + + unselectedOpacity : float + The opacity of unselected legend entries. + + **Default value:** 0.35. + zindex : anyOf(float, :class:`ExprRef`) + + """ + _schema = {'$ref': '#/definitions/LegendConfig'} + + def __init__(self, aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, + cornerRadius=Undefined, description=Undefined, direction=Undefined, disable=Undefined, + fillColor=Undefined, gradientDirection=Undefined, + gradientHorizontalMaxLength=Undefined, gradientHorizontalMinLength=Undefined, + gradientLabelLimit=Undefined, gradientLabelOffset=Undefined, gradientLength=Undefined, + gradientOpacity=Undefined, gradientStrokeColor=Undefined, + gradientStrokeWidth=Undefined, gradientThickness=Undefined, + gradientVerticalMaxLength=Undefined, gradientVerticalMinLength=Undefined, + gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, + labelColor=Undefined, labelFont=Undefined, labelFontSize=Undefined, + labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, + labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, + labelPadding=Undefined, labelSeparation=Undefined, layout=Undefined, legendX=Undefined, + legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, + rowPadding=Undefined, strokeColor=Undefined, strokeDash=Undefined, + strokeWidth=Undefined, symbolBaseFillColor=Undefined, symbolBaseStrokeColor=Undefined, + symbolDash=Undefined, symbolDashOffset=Undefined, symbolDirection=Undefined, + symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, + symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, + symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, + title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, + titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, + titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, + titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, + titlePadding=Undefined, unselectedOpacity=Undefined, zindex=Undefined, **kwds): + super(LegendConfig, self).__init__(aria=aria, clipHeight=clipHeight, + columnPadding=columnPadding, columns=columns, + cornerRadius=cornerRadius, description=description, + direction=direction, disable=disable, fillColor=fillColor, + gradientDirection=gradientDirection, + gradientHorizontalMaxLength=gradientHorizontalMaxLength, + gradientHorizontalMinLength=gradientHorizontalMinLength, + gradientLabelLimit=gradientLabelLimit, + gradientLabelOffset=gradientLabelOffset, + gradientLength=gradientLength, + gradientOpacity=gradientOpacity, + gradientStrokeColor=gradientStrokeColor, + gradientStrokeWidth=gradientStrokeWidth, + gradientThickness=gradientThickness, + gradientVerticalMaxLength=gradientVerticalMaxLength, + gradientVerticalMinLength=gradientVerticalMinLength, + gridAlign=gridAlign, labelAlign=labelAlign, + labelBaseline=labelBaseline, labelColor=labelColor, + labelFont=labelFont, labelFontSize=labelFontSize, + labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, labelLimit=labelLimit, + labelOffset=labelOffset, labelOpacity=labelOpacity, + labelOverlap=labelOverlap, labelPadding=labelPadding, + labelSeparation=labelSeparation, layout=layout, + legendX=legendX, legendY=legendY, offset=offset, + orient=orient, padding=padding, rowPadding=rowPadding, + strokeColor=strokeColor, strokeDash=strokeDash, + strokeWidth=strokeWidth, + symbolBaseFillColor=symbolBaseFillColor, + symbolBaseStrokeColor=symbolBaseStrokeColor, + symbolDash=symbolDash, symbolDashOffset=symbolDashOffset, + symbolDirection=symbolDirection, + symbolFillColor=symbolFillColor, symbolLimit=symbolLimit, + symbolOffset=symbolOffset, symbolOpacity=symbolOpacity, + symbolSize=symbolSize, symbolStrokeColor=symbolStrokeColor, + symbolStrokeWidth=symbolStrokeWidth, symbolType=symbolType, + tickCount=tickCount, title=title, titleAlign=titleAlign, + titleAnchor=titleAnchor, titleBaseline=titleBaseline, + titleColor=titleColor, titleFont=titleFont, + titleFontSize=titleFontSize, titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, titleLimit=titleLimit, + titleLineHeight=titleLineHeight, titleOpacity=titleOpacity, + titleOrient=titleOrient, titlePadding=titlePadding, + unselectedOpacity=unselectedOpacity, zindex=zindex, **kwds) + + +class LegendOrient(VegaLiteSchema): + """LegendOrient schema wrapper + + enum('none', 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', + 'bottom-right') + """ + _schema = {'$ref': '#/definitions/LegendOrient'} + + def __init__(self, *args): + super(LegendOrient, self).__init__(*args) + + +class LegendResolveMap(VegaLiteSchema): + """LegendResolveMap schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + angle : :class:`ResolveMode` + + color : :class:`ResolveMode` + + fill : :class:`ResolveMode` + + fillOpacity : :class:`ResolveMode` + + opacity : :class:`ResolveMode` + + shape : :class:`ResolveMode` + + size : :class:`ResolveMode` + + stroke : :class:`ResolveMode` + + strokeDash : :class:`ResolveMode` + + strokeOpacity : :class:`ResolveMode` + + strokeWidth : :class:`ResolveMode` + + """ + _schema = {'$ref': '#/definitions/LegendResolveMap'} + + def __init__(self, angle=Undefined, color=Undefined, fill=Undefined, fillOpacity=Undefined, + opacity=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, + strokeDash=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, **kwds): + super(LegendResolveMap, self).__init__(angle=angle, color=color, fill=fill, + fillOpacity=fillOpacity, opacity=opacity, shape=shape, + size=size, stroke=stroke, strokeDash=strokeDash, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + **kwds) + + +class LegendStreamBinding(LegendBinding): + """LegendStreamBinding schema wrapper + + Mapping(required=[legend]) + + Attributes + ---------- + + legend : anyOf(string, :class:`Stream`) + + """ + _schema = {'$ref': '#/definitions/LegendStreamBinding'} + + def __init__(self, legend=Undefined, **kwds): + super(LegendStreamBinding, self).__init__(legend=legend, **kwds) + + +class LineConfig(AnyMarkConfig): + """LineConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). + One of ``"left"``, ``"right"``, ``"center"``. + + **Note:** Expression reference is *not* supported for range marks. + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an + expression reference that provides one of the valid values. The ``"line-top"`` and + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default fill color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove fill. + + **Default value:** (None) + fillOpacity : anyOf(float, :class:`ExprRef`) + + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + + **Default value:** ``0`` + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). + + + * If set to ``"filter"`` (default), all data items with null values will be skipped + (for line, trail, and area marks) or filtered (for other marks). + * If ``null``, all data items are included. In this case, invalid values will be + interpreted as zeroes. + limit : anyOf(float, :class:`ExprRef`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). + + **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, + ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. + order : anyOf(None, boolean) + For line and trail marks, this ``order`` property can be set to ``null`` or + ``false`` to make the lines use the original order in the data sources. + orient : :class:`Orientation` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + the line if ``config.sortLineBy`` is not specified. For stacked charts, this is + always determined by the orientation of the stack; therefore explicitly specified + value will be ignored. + outerRadius : anyOf(float, :class:`ExprRef`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + + **Default value:** ``0`` + padAngle : anyOf(float, :class:`ExprRef`) + + point : anyOf(boolean, :class:`OverlayMarkDef`, string) + A flag for overlaying points on top of line or area marks, or an object defining the + properties of the overlayed points. + + + If this property is ``"transparent"``, transparent points will be used (for + enhancing tooltips and selections). + + If this property is an empty object ( ``{}`` ) or ``true``, filled points with + default properties will be used. + + If this property is ``false``, no points would be automatically added to line or + area marks. + + **Default value:** ``false``. + radius : anyOf(float, :class:`ExprRef`) + For arc mark, the primary (outer) radius in pixels. + + For text marks, polar coordinate radial offset, in pixels, of the text from the + origin determined by the ``x`` and ``y`` properties. + + **Default value:** ``min(plot_width, plot_height)/2`` + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + + **Default value:** ``0`` + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. Note that this value sets the area of the symbol; the side lengths will + increase with the square root of this value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** + + + * ``30`` for point, circle, square marks; width/height's ``step`` + * ``2`` for bar marks with discrete dimensions; + * ``5`` for bar marks with continuous dimensions; + * ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default stroke color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove stroke. + + **Default value:** (None) + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : anyOf(float, :class:`ExprRef`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + 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 + will be positioned in the middle of the time unit band step. + timeUnitBandSize : float + Default relative band size for a time unit. If set to ``1``, the bandwidth of the + marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the + marks will be half of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : anyOf(float, string, :class:`ExprRef`) + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + y : anyOf(float, string, :class:`ExprRef`) + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : anyOf(float, string, :class:`ExprRef`) + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + """ + _schema = {'$ref': '#/definitions/LineConfig'} + + def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, blend=Undefined, + color=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, + cornerRadiusBottomRight=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, + dx=Undefined, dy=Undefined, ellipsis=Undefined, endAngle=Undefined, fill=Undefined, + fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, + fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, + innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, limit=Undefined, + lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, + orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=Undefined, + radius=Undefined, radius2=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, + startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, + **kwds): + super(LineConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, + baseline=baseline, blend=blend, color=color, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, + description=description, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, endAngle=endAngle, fill=fill, + fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, + interpolate=interpolate, invalid=invalid, limit=limit, + lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, + order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + shape=shape, size=size, smooth=smooth, startAngle=startAngle, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, theta2=theta2, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, + width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class LinearGradient(Gradient): + """LinearGradient schema wrapper + + Mapping(required=[gradient, stops]) + + Attributes + ---------- + + gradient : string + The type of gradient. Use ``"linear"`` for a linear gradient. + stops : List(:class:`GradientStop`) + An array of gradient stops defining the gradient color sequence. + id : string + + x1 : float + The starting x-coordinate, in normalized [0, 1] coordinates, of the linear gradient. + + **Default value:** ``0`` + x2 : float + The ending x-coordinate, in normalized [0, 1] coordinates, of the linear gradient. + + **Default value:** ``1`` + y1 : float + The starting y-coordinate, in normalized [0, 1] coordinates, of the linear gradient. + + **Default value:** ``0`` + y2 : float + The ending y-coordinate, in normalized [0, 1] coordinates, of the linear gradient. + + **Default value:** ``0`` + """ + _schema = {'$ref': '#/definitions/LinearGradient'} + + def __init__(self, gradient=Undefined, stops=Undefined, id=Undefined, x1=Undefined, x2=Undefined, + y1=Undefined, y2=Undefined, **kwds): + super(LinearGradient, self).__init__(gradient=gradient, stops=stops, id=id, x1=x1, x2=x2, y1=y1, + y2=y2, **kwds) + + +class Locale(VegaLiteSchema): + """Locale schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + number : :class:`NumberLocale` + Locale definition for formatting numbers. + time : :class:`TimeLocale` + Locale definition for formatting dates and times. + """ + _schema = {'$ref': '#/definitions/Locale'} + + def __init__(self, number=Undefined, time=Undefined, **kwds): + super(Locale, self).__init__(number=number, time=time, **kwds) + + +class LookupData(VegaLiteSchema): + """LookupData schema wrapper + + Mapping(required=[data, key]) + + Attributes + ---------- + + data : :class:`Data` + Secondary data source to lookup in. + key : :class:`FieldName` + Key in data to lookup. + fields : List(:class:`FieldName`) + Fields in foreign data or selection to lookup. If not specified, the entire object + is queried. + """ + _schema = {'$ref': '#/definitions/LookupData'} + + def __init__(self, data=Undefined, key=Undefined, fields=Undefined, **kwds): + super(LookupData, self).__init__(data=data, key=key, fields=fields, **kwds) + + +class LookupSelection(VegaLiteSchema): + """LookupSelection schema wrapper + + Mapping(required=[key, param]) + + Attributes + ---------- + + key : :class:`FieldName` + Key in data to lookup. + param : :class:`ParameterName` + Selection parameter name to look up. + fields : List(:class:`FieldName`) + Fields in foreign data or selection to lookup. If not specified, the entire object + is queried. + """ + _schema = {'$ref': '#/definitions/LookupSelection'} + + def __init__(self, key=Undefined, param=Undefined, fields=Undefined, **kwds): + super(LookupSelection, self).__init__(key=key, param=param, fields=fields, **kwds) + + +class Mark(AnyMark): + """Mark schema wrapper + + enum('arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', + 'trail', 'circle', 'square', 'geoshape') + All types of primitive marks. + """ + _schema = {'$ref': '#/definitions/Mark'} + + def __init__(self, *args): + super(Mark, self).__init__(*args) + + +class MarkConfig(AnyMarkConfig): + """MarkConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). + One of ``"left"``, ``"right"``, ``"center"``. + + **Note:** Expression reference is *not* supported for range marks. + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an + expression reference that provides one of the valid values. The ``"line-top"`` and + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default fill color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove fill. + + **Default value:** (None) + fillOpacity : anyOf(float, :class:`ExprRef`) + + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + + **Default value:** ``0`` + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). + + + * If set to ``"filter"`` (default), all data items with null values will be skipped + (for line, trail, and area marks) or filtered (for other marks). + * If ``null``, all data items are included. In this case, invalid values will be + interpreted as zeroes. + limit : anyOf(float, :class:`ExprRef`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). + + **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, + ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. + order : anyOf(None, boolean) + For line and trail marks, this ``order`` property can be set to ``null`` or + ``false`` to make the lines use the original order in the data sources. + orient : :class:`Orientation` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + the line if ``config.sortLineBy`` is not specified. For stacked charts, this is + always determined by the orientation of the stack; therefore explicitly specified + value will be ignored. + outerRadius : anyOf(float, :class:`ExprRef`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + + **Default value:** ``0`` + padAngle : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + For arc mark, the primary (outer) radius in pixels. + + For text marks, polar coordinate radial offset, in pixels, of the text from the + origin determined by the ``x`` and ``y`` properties. + + **Default value:** ``min(plot_width, plot_height)/2`` + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + + **Default value:** ``0`` + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. Note that this value sets the area of the symbol; the side lengths will + increase with the square root of this value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** + + + * ``30`` for point, circle, square marks; width/height's ``step`` + * ``2`` for bar marks with discrete dimensions; + * ``5`` for bar marks with continuous dimensions; + * ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default stroke color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove stroke. + + **Default value:** (None) + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : anyOf(float, :class:`ExprRef`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + 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 + will be positioned in the middle of the time unit band step. + timeUnitBandSize : float + Default relative band size for a time unit. If set to ``1``, the bandwidth of the + marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the + marks will be half of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : anyOf(float, string, :class:`ExprRef`) + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + y : anyOf(float, string, :class:`ExprRef`) + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : anyOf(float, string, :class:`ExprRef`) + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + """ + _schema = {'$ref': '#/definitions/MarkConfig'} + + def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, blend=Undefined, + color=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, + cornerRadiusBottomRight=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, + dx=Undefined, dy=Undefined, ellipsis=Undefined, endAngle=Undefined, fill=Undefined, + fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, + fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, + innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, limit=Undefined, + lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, + orient=Undefined, outerRadius=Undefined, padAngle=Undefined, radius=Undefined, + radius2=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, + startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, + **kwds): + super(MarkConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, + baseline=baseline, blend=blend, color=color, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, + description=description, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, endAngle=endAngle, fill=fill, + fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, + interpolate=interpolate, invalid=invalid, limit=limit, + lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, + order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, radius=radius, radius2=radius2, shape=shape, + size=size, smooth=smooth, startAngle=startAngle, stroke=stroke, + strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, theta2=theta2, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, + width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class MarkDef(AnyMark): + """MarkDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`Mark` + The mark type. This could a primitive mark type (one of ``"bar"``, ``"circle"``, + ``"square"``, ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"geoshape"``, + ``"rule"``, and ``"text"`` ) or a composite mark type ( ``"boxplot"``, + ``"errorband"``, ``"errorbar"`` ). + align : anyOf(:class:`Align`, :class:`ExprRef`) + The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). + One of ``"left"``, ``"right"``, ``"center"``. + + **Note:** Expression reference is *not* supported for range marks. + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + bandSize : float + The width of the ticks. + + **Default value:** 3/4 of step (width step for horizontal ticks and height step for + vertical ticks). + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an + expression reference that provides one of the valid values. The ``"line-top"`` and + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + binSpacing : float + Offset between bars for binned field. The ideal value for this is either 0 + (preferred by statisticians) or 1 (Vega-Lite default, D3 example style). + + **Default value:** ``1`` + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + clip : boolean + Whether a mark be clipped to the enclosing group’s width and height. + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + continuousBandSize : float + The default size of the bars on continuous scales. + + **Default value:** ``5`` + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusEnd : anyOf(float, :class:`ExprRef`) + For vertical bars, top-left and top-right corner radius. + + For horizontal bars, top-right and bottom-right corner radius. + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + discreteBandSize : anyOf(float, :class:`RelativeBandSize`) + The default size of the bars with discrete dimensions. If unspecified, the default + size is ``step-2``, which provides 2 pixel offset between bars. + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default fill color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove fill. + + **Default value:** (None) + fillOpacity : anyOf(float, :class:`ExprRef`) + + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`, :class:`RelativeBandSize`) + Height of the marks. One of: + + + A number representing a fixed pixel height. + + A relative band size definition. For example, ``{band: 0.5}`` represents half of + the band + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + + **Default value:** ``0`` + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). + + + * If set to ``"filter"`` (default), all data items with null values will be skipped + (for line, trail, and area marks) or filtered (for other marks). + * If ``null``, all data items are included. In this case, invalid values will be + interpreted as zeroes. + limit : anyOf(float, :class:`ExprRef`) + + line : anyOf(boolean, :class:`OverlayMarkDef`) + A flag for overlaying line on top of area marks, or an object defining the + properties of the overlayed lines. + + + If this value is an empty object ( ``{}`` ) or ``true``, lines with default + properties will be used. + + If this value is ``false``, no lines would be automatically added to area marks. + + **Default value:** ``false``. + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). + + **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, + ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. + order : anyOf(None, boolean) + For line and trail marks, this ``order`` property can be set to ``null`` or + ``false`` to make the lines use the original order in the data sources. + orient : :class:`Orientation` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + the line if ``config.sortLineBy`` is not specified. For stacked charts, this is + always determined by the orientation of the stack; therefore explicitly specified + value will be ignored. + outerRadius : anyOf(float, :class:`ExprRef`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + + **Default value:** ``0`` + padAngle : anyOf(float, :class:`ExprRef`) + + point : anyOf(boolean, :class:`OverlayMarkDef`, string) + A flag for overlaying points on top of line or area marks, or an object defining the + properties of the overlayed points. + + + If this property is ``"transparent"``, transparent points will be used (for + enhancing tooltips and selections). + + If this property is an empty object ( ``{}`` ) or ``true``, filled points with + default properties will be used. + + If this property is ``false``, no points would be automatically added to line or + area marks. + + **Default value:** ``false``. + radius : anyOf(float, :class:`ExprRef`) + For arc mark, the primary (outer) radius in pixels. + + For text marks, polar coordinate radial offset, in pixels, of the text from the + origin determined by the ``x`` and ``y`` properties. + + **Default value:** ``min(plot_width, plot_height)/2`` + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + + **Default value:** ``0`` + radius2Offset : anyOf(float, :class:`ExprRef`) + Offset for radius2. + radiusOffset : anyOf(float, :class:`ExprRef`) + Offset for radius. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. Note that this value sets the area of the symbol; the side lengths will + increase with the square root of this value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** + + + * ``30`` for point, circle, square marks; width/height's ``step`` + * ``2`` for bar marks with discrete dimensions; + * ``5`` for bar marks with continuous dimensions; + * ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default stroke color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove stroke. + + **Default value:** (None) + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + style : anyOf(string, List(string)) + A string or array of strings indicating the name of custom styles to apply to the + mark. A style is a named collection of mark property defaults defined within the + `style configuration + `__. If style is an + array, later styles will override earlier styles. Any `mark properties + `__ explicitly + defined within the ``encoding`` will override a style default. + + **Default value:** The mark's name. For example, a bar mark will have style + ``"bar"`` by default. **Note:** Any specified style will augment the default style. + For example, a bar mark with ``"style": "foo"`` will receive from + ``config.style.bar`` and ``config.style.foo`` (the specified style ``"foo"`` has + higher precedence). + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : anyOf(float, :class:`ExprRef`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + theta2Offset : anyOf(float, :class:`ExprRef`) + Offset for theta2. + thetaOffset : anyOf(float, :class:`ExprRef`) + Offset for theta. + thickness : float + Thickness of the tick mark. + + **Default value:** ``1`` + 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 + will be positioned in the middle of the time unit band step. + timeUnitBandSize : float + Default relative band size for a time unit. If set to ``1``, the bandwidth of the + marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the + marks will be half of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`, :class:`RelativeBandSize`) + Width of the marks. One of: + + + A number representing a fixed pixel width. + + A relative band size definition. For example, ``{band: 0.5}`` represents half of + the band. + x : anyOf(float, string, :class:`ExprRef`) + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : anyOf(float, string, :class:`ExprRef`) + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2Offset : anyOf(float, :class:`ExprRef`) + Offset for x2-position. + xOffset : anyOf(float, :class:`ExprRef`) + Offset for x-position. + y : anyOf(float, string, :class:`ExprRef`) + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : anyOf(float, string, :class:`ExprRef`) + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2Offset : anyOf(float, :class:`ExprRef`) + Offset for y2-position. + yOffset : anyOf(float, :class:`ExprRef`) + Offset for y-position. + """ + _schema = {'$ref': '#/definitions/MarkDef'} + + def __init__(self, type=Undefined, align=Undefined, angle=Undefined, aria=Undefined, + ariaRole=Undefined, ariaRoleDescription=Undefined, aspect=Undefined, + bandSize=Undefined, baseline=Undefined, binSpacing=Undefined, blend=Undefined, + clip=Undefined, color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, + discreteBandSize=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, + fill=Undefined, fillOpacity=Undefined, filled=Undefined, font=Undefined, + fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, height=Undefined, + href=Undefined, innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, + limit=Undefined, line=Undefined, lineBreak=Undefined, lineHeight=Undefined, + opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, + padAngle=Undefined, point=Undefined, radius=Undefined, radius2=Undefined, + radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, size=Undefined, + smooth=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + theta2Offset=Undefined, thetaOffset=Undefined, thickness=Undefined, + timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, + xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, + **kwds): + super(MarkDef, self).__init__(type=type, align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, + bandSize=bandSize, baseline=baseline, binSpacing=binSpacing, + blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, + description=description, dir=dir, + discreteBandSize=discreteBandSize, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, + filled=filled, font=font, fontSize=fontSize, fontStyle=fontStyle, + fontWeight=fontWeight, height=height, href=href, + innerRadius=innerRadius, interpolate=interpolate, invalid=invalid, + limit=limit, line=line, lineBreak=lineBreak, + lineHeight=lineHeight, opacity=opacity, order=order, + orient=orient, outerRadius=outerRadius, padAngle=padAngle, + point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, + shape=shape, size=size, smooth=smooth, stroke=stroke, + strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, + tension=tension, text=text, theta=theta, theta2=theta2, + theta2Offset=theta2Offset, thetaOffset=thetaOffset, + thickness=thickness, timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, + width=width, x=x, x2=x2, x2Offset=x2Offset, xOffset=xOffset, y=y, + y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + + +class MarkPropDefGradientstringnull(VegaLiteSchema): + """MarkPropDefGradientstringnull schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, + :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`) + """ + _schema = {'$ref': '#/definitions/MarkPropDef<(Gradient|string|null)>'} + + def __init__(self, *args, **kwds): + super(MarkPropDefGradientstringnull, self).__init__(*args, **kwds) + + +class FieldOrDatumDefWithConditionDatumDefGradientstringnull(ColorDef, MarkPropDefGradientstringnull): + """FieldOrDatumDefWithConditionDatumDefGradientstringnull schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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/FieldOrDatumDefWithCondition'} + + def __init__(self, bandPosition=Undefined, condition=Undefined, datum=Undefined, title=Undefined, + type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefGradientstringnull, self).__init__(bandPosition=bandPosition, + condition=condition, + datum=datum, + title=title, + type=type, **kwds) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, MarkPropDefGradientstringnull): + """FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/FieldOrDatumDefWithCondition'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull, self).__init__(aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds) + + +class MarkPropDefnumber(VegaLiteSchema): + """MarkPropDefnumber schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`) + """ + _schema = {'$ref': '#/definitions/MarkPropDef'} + + def __init__(self, *args, **kwds): + super(MarkPropDefnumber, self).__init__(*args, **kwds) + + +class MarkPropDefnumberArray(VegaLiteSchema): + """MarkPropDefnumberArray schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, + :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`) + """ + _schema = {'$ref': '#/definitions/MarkPropDef'} + + def __init__(self, *args, **kwds): + super(MarkPropDefnumberArray, self).__init__(*args, **kwds) + + +class MarkPropDefstringnullTypeForShape(VegaLiteSchema): + """MarkPropDefstringnullTypeForShape schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, + :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`) + """ + _schema = {'$ref': '#/definitions/MarkPropDef<(string|null),TypeForShape>'} + + def __init__(self, *args, **kwds): + super(MarkPropDefstringnullTypeForShape, self).__init__(*args, **kwds) + + +class MarkType(VegaLiteSchema): + """MarkType schema wrapper + + enum('arc', 'area', 'image', 'group', 'line', 'path', 'rect', 'rule', 'shape', 'symbol', + 'text', 'trail') + """ + _schema = {'$ref': '#/definitions/MarkType'} + + def __init__(self, *args): + super(MarkType, self).__init__(*args) + + +class Month(VegaLiteSchema): + """Month schema wrapper + + float + """ + _schema = {'$ref': '#/definitions/Month'} + + def __init__(self, *args): + super(Month, self).__init__(*args) + + +class NamedData(DataSource): + """NamedData schema wrapper + + Mapping(required=[name]) + + Attributes + ---------- + + name : string + Provide a placeholder name and bind data at runtime. + format : :class:`DataFormat` + An object that specifies the format for parsing the data. + """ + _schema = {'$ref': '#/definitions/NamedData'} + + def __init__(self, name=Undefined, format=Undefined, **kwds): + super(NamedData, self).__init__(name=name, format=format, **kwds) + + +class NonArgAggregateOp(Aggregate): + """NonArgAggregateOp schema wrapper + + enum('average', 'count', 'distinct', 'max', 'mean', 'median', 'min', 'missing', 'product', + 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', 'variance', + 'variancep') + """ + _schema = {'$ref': '#/definitions/NonArgAggregateOp'} + + def __init__(self, *args): + super(NonArgAggregateOp, self).__init__(*args) + + +class NonNormalizedSpec(VegaLiteSchema): + """NonNormalizedSpec schema wrapper + + anyOf(:class:`FacetedUnitSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetSpec`, + :class:`ConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`, + :class:`HConcatSpecGenericSpec`) + Any specification in Vega-Lite. + """ + _schema = {'$ref': '#/definitions/NonNormalizedSpec'} + + def __init__(self, *args, **kwds): + super(NonNormalizedSpec, self).__init__(*args, **kwds) + + +class NumberLocale(VegaLiteSchema): + """NumberLocale schema wrapper + + Mapping(required=[decimal, thousands, grouping, currency]) + Locale definition for formatting numbers. + + Attributes + ---------- + + currency : :class:`Vector2string` + The currency prefix and suffix (e.g., ["$", ""]). + decimal : string + The decimal point (e.g., "."). + grouping : List(float) + The array of group sizes (e.g., [3]), cycled as needed. + thousands : string + The group separator (e.g., ","). + minus : string + The minus sign (defaults to hyphen-minus, "-"). + nan : string + The not-a-number value (defaults to "NaN"). + numerals : :class:`Vector10string` + An array of ten strings to replace the numerals 0-9. + percent : string + The percent sign (defaults to "%"). + """ + _schema = {'$ref': '#/definitions/NumberLocale'} + + def __init__(self, currency=Undefined, decimal=Undefined, grouping=Undefined, thousands=Undefined, + minus=Undefined, nan=Undefined, numerals=Undefined, percent=Undefined, **kwds): + super(NumberLocale, self).__init__(currency=currency, decimal=decimal, grouping=grouping, + thousands=thousands, minus=minus, nan=nan, numerals=numerals, + percent=percent, **kwds) + + +class NumericArrayMarkPropDef(VegaLiteSchema): + """NumericArrayMarkPropDef schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, + :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`) + """ + _schema = {'$ref': '#/definitions/NumericArrayMarkPropDef'} + + def __init__(self, *args, **kwds): + super(NumericArrayMarkPropDef, self).__init__(*args, **kwds) + + +class FieldOrDatumDefWithConditionDatumDefnumberArray(MarkPropDefnumberArray, NumericArrayMarkPropDef): + """FieldOrDatumDefWithConditionDatumDefnumberArray schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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/FieldOrDatumDefWithCondition'} + + def __init__(self, bandPosition=Undefined, condition=Undefined, datum=Undefined, title=Undefined, + type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefnumberArray, self).__init__(bandPosition=bandPosition, + condition=condition, + datum=datum, title=title, + type=type, **kwds) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberArray, NumericArrayMarkPropDef): + """FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/FieldOrDatumDefWithCondition'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray, self).__init__(aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, **kwds) + + +class NumericMarkPropDef(VegaLiteSchema): + """NumericMarkPropDef schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`) + """ + _schema = {'$ref': '#/definitions/NumericMarkPropDef'} + + def __init__(self, *args, **kwds): + super(NumericMarkPropDef, self).__init__(*args, **kwds) + + +class FieldOrDatumDefWithConditionDatumDefnumber(MarkPropDefnumber, NumericMarkPropDef): + """FieldOrDatumDefWithConditionDatumDefnumber schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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/FieldOrDatumDefWithCondition'} + + def __init__(self, bandPosition=Undefined, condition=Undefined, datum=Undefined, title=Undefined, + type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefnumber, self).__init__(bandPosition=bandPosition, + condition=condition, + datum=datum, title=title, + type=type, **kwds) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, NumericMarkPropDef): + """FieldOrDatumDefWithConditionMarkPropFieldDefnumber schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/FieldOrDatumDefWithCondition'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionMarkPropFieldDefnumber, self).__init__(aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, sort=sort, + timeUnit=timeUnit, + title=title, type=type, + **kwds) + + +class OffsetDef(VegaLiteSchema): + """OffsetDef schema wrapper + + anyOf(:class:`ScaleFieldDef`, :class:`ScaleDatumDef`, :class:`ValueDefnumber`) + """ + _schema = {'$ref': '#/definitions/OffsetDef'} + + def __init__(self, *args, **kwds): + super(OffsetDef, self).__init__(*args, **kwds) + + +class OrderFieldDef(VegaLiteSchema): + """OrderFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + sort : :class:`SortOrder` + The sort order. One of ``"ascending"`` (default) or ``"descending"``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/OrderFieldDef'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(OrderFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, + field=field, sort=sort, timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class OrderValueDef(VegaLiteSchema): + """OrderValueDef schema wrapper + + Mapping(required=[value]) + + Attributes + ---------- + + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + condition : anyOf(:class:`ConditionalValueDefnumber`, + List(:class:`ConditionalValueDefnumber`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + """ + _schema = {'$ref': '#/definitions/OrderValueDef'} + + def __init__(self, value=Undefined, condition=Undefined, **kwds): + super(OrderValueDef, self).__init__(value=value, condition=condition, **kwds) + + +class Orient(VegaLiteSchema): + """Orient schema wrapper + + enum('left', 'right', 'top', 'bottom') + """ + _schema = {'$ref': '#/definitions/Orient'} + + def __init__(self, *args): + super(Orient, self).__init__(*args) + + +class Orientation(VegaLiteSchema): + """Orientation schema wrapper + + enum('horizontal', 'vertical') + """ + _schema = {'$ref': '#/definitions/Orientation'} + + def __init__(self, *args): + super(Orientation, self).__init__(*args) + + +class OverlayMarkDef(VegaLiteSchema): + """OverlayMarkDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). + One of ``"left"``, ``"right"``, ``"center"``. + + **Note:** Expression reference is *not* supported for range marks. + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an + expression reference that provides one of the valid values. The ``"line-top"`` and + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + clip : boolean + Whether a mark be clipped to the enclosing group’s width and height. + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default fill color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove fill. + + **Default value:** (None) + fillOpacity : anyOf(float, :class:`ExprRef`) + + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + + **Default value:** ``0`` + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). + + + * If set to ``"filter"`` (default), all data items with null values will be skipped + (for line, trail, and area marks) or filtered (for other marks). + * If ``null``, all data items are included. In this case, invalid values will be + interpreted as zeroes. + limit : anyOf(float, :class:`ExprRef`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). + + **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, + ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. + order : anyOf(None, boolean) + For line and trail marks, this ``order`` property can be set to ``null`` or + ``false`` to make the lines use the original order in the data sources. + orient : :class:`Orientation` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + the line if ``config.sortLineBy`` is not specified. For stacked charts, this is + always determined by the orientation of the stack; therefore explicitly specified + value will be ignored. + outerRadius : anyOf(float, :class:`ExprRef`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + + **Default value:** ``0`` + padAngle : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + For arc mark, the primary (outer) radius in pixels. + + For text marks, polar coordinate radial offset, in pixels, of the text from the + origin determined by the ``x`` and ``y`` properties. + + **Default value:** ``min(plot_width, plot_height)/2`` + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + + **Default value:** ``0`` + radius2Offset : anyOf(float, :class:`ExprRef`) + Offset for radius2. + radiusOffset : anyOf(float, :class:`ExprRef`) + Offset for radius. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. Note that this value sets the area of the symbol; the side lengths will + increase with the square root of this value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** + + + * ``30`` for point, circle, square marks; width/height's ``step`` + * ``2`` for bar marks with discrete dimensions; + * ``5`` for bar marks with continuous dimensions; + * ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default stroke color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove stroke. + + **Default value:** (None) + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + style : anyOf(string, List(string)) + A string or array of strings indicating the name of custom styles to apply to the + mark. A style is a named collection of mark property defaults defined within the + `style configuration + `__. If style is an + array, later styles will override earlier styles. Any `mark properties + `__ explicitly + defined within the ``encoding`` will override a style default. + + **Default value:** The mark's name. For example, a bar mark will have style + ``"bar"`` by default. **Note:** Any specified style will augment the default style. + For example, a bar mark with ``"style": "foo"`` will receive from + ``config.style.bar`` and ``config.style.foo`` (the specified style ``"foo"`` has + higher precedence). + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : anyOf(float, :class:`ExprRef`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + theta2Offset : anyOf(float, :class:`ExprRef`) + Offset for theta2. + thetaOffset : anyOf(float, :class:`ExprRef`) + Offset for theta. + 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 + will be positioned in the middle of the time unit band step. + timeUnitBandSize : float + Default relative band size for a time unit. If set to ``1``, the bandwidth of the + marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the + marks will be half of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : anyOf(float, string, :class:`ExprRef`) + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2Offset : anyOf(float, :class:`ExprRef`) + Offset for x2-position. + xOffset : anyOf(float, :class:`ExprRef`) + Offset for x-position. + y : anyOf(float, string, :class:`ExprRef`) + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : anyOf(float, string, :class:`ExprRef`) + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2Offset : anyOf(float, :class:`ExprRef`) + Offset for y2-position. + yOffset : anyOf(float, :class:`ExprRef`) + Offset for y-position. + """ + _schema = {'$ref': '#/definitions/OverlayMarkDef'} + + def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, blend=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, + description=Undefined, dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, + endAngle=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, lineBreak=Undefined, lineHeight=Undefined, + opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, + padAngle=Undefined, radius=Undefined, radius2=Undefined, radius2Offset=Undefined, + radiusOffset=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, + startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + theta2Offset=Undefined, thetaOffset=Undefined, timeUnitBandPosition=Undefined, + timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, + x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, + y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): + super(OverlayMarkDef, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, + baseline=baseline, blend=blend, clip=clip, color=color, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, + description=description, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, endAngle=endAngle, fill=fill, + fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, + fontWeight=fontWeight, height=height, href=href, + innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, lineBreak=lineBreak, + lineHeight=lineHeight, opacity=opacity, order=order, + orient=orient, outerRadius=outerRadius, padAngle=padAngle, + radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, + shape=shape, size=size, smooth=smooth, + startAngle=startAngle, stroke=stroke, strokeCap=strokeCap, + strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, + strokeOffset=strokeOffset, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, + theta2Offset=theta2Offset, thetaOffset=thetaOffset, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, + url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, + yOffset=yOffset, **kwds) + + +class Padding(VegaLiteSchema): + """Padding schema wrapper + + anyOf(float, Mapping(required=[])) + """ + _schema = {'$ref': '#/definitions/Padding'} + + def __init__(self, *args, **kwds): + super(Padding, self).__init__(*args, **kwds) + + +class ParameterExtent(BinExtent): + """ParameterExtent schema wrapper + + anyOf(Mapping(required=[param]), Mapping(required=[param])) + """ + _schema = {'$ref': '#/definitions/ParameterExtent'} + + def __init__(self, *args, **kwds): + super(ParameterExtent, self).__init__(*args, **kwds) + + +class ParameterName(VegaLiteSchema): + """ParameterName schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/ParameterName'} + + def __init__(self, *args): + super(ParameterName, self).__init__(*args) + + +class Parse(VegaLiteSchema): + """Parse schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Parse'} + + def __init__(self, **kwds): + super(Parse, self).__init__(**kwds) + + +class ParseValue(VegaLiteSchema): + """ParseValue schema wrapper + + anyOf(None, string, string, string, string, string) + """ + _schema = {'$ref': '#/definitions/ParseValue'} + + def __init__(self, *args, **kwds): + super(ParseValue, self).__init__(*args, **kwds) + + +class PointSelectionConfig(VegaLiteSchema): + """PointSelectionConfig schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : string + Determines the default event processing and data query for the selection. Vega-Lite + currently supports two selection types: + + + * ``"point"`` -- to select multiple discrete data values; the first value is + selected on ``click`` and additional values toggled on shift-click. + * ``"interval"`` -- to select a continuous range of data values on ``drag``. + clear : anyOf(:class:`Stream`, string, boolean) + Clears the selection, emptying it of all values. This property can be a `Event + Stream `__ or ``false`` to disable + clear. + + **Default value:** ``dblclick``. + + **See also:** `clear examples + `__ in the + documentation. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. + + **See also:** The `projection with encodings and fields section + `__ in the + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to fall within the + selection. + + **See also:** The `projection with encodings and fields section + `__ in the + documentation. + nearest : boolean + When true, an invisible voronoi diagram is computed to accelerate discrete + selection. The data value *nearest* the mouse cursor is added to the selection. + + **Default value:** ``false``, which means that data values must be interacted with + directly (e.g., clicked on) to be added to the selection. + + **See also:** `nearest examples + `__ documentation. + on : anyOf(:class:`Stream`, string) + A `Vega event stream `__ (object or + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end + `__. + + **See also:** `on examples + `__ in the documentation. + resolve : :class:`SelectionResolution` + With layered and multi-view displays, a strategy that determines how selections' + data queries are resolved when applied in a filter transform, conditional encoding + rule, or scale domain. + + One of: + + + * ``"global"`` -- only one brush exists for the entire SPLOM. When the user begins + to drag, any previous brushes are cleared, and a new one is constructed. + * ``"union"`` -- each cell contains its own brush, and points are highlighted if + they lie within *any* of these individual brushes. + * ``"intersect"`` -- each cell contains its own brush, and points are highlighted + only if they fall within *all* of these individual brushes. + + **Default value:** ``global``. + + **See also:** `resolve examples + `__ in the + documentation. + toggle : anyOf(string, boolean) + Controls whether data values should be toggled (inserted or removed from a point + selection) or only ever inserted into multi selections. + + One of: + + + * ``true`` -- the default behavior, which corresponds to ``"event.shiftKey"``. As a + result, data values are toggled when the user interacts with the shift-key + pressed. + * ``false`` -- disables toggling behaviour; as the user interacts, data values are + only inserted into the multi selection and never removed. + * A `Vega expression `__ which is + re-evaluated as the user interacts. If the expression evaluates to ``true``, the + data value is toggled into or out of the multi selection. If the expression + evaluates to ``false``, the multi selection is first clear, and the data value is + then inserted. For example, setting the value to the Vega expression ``"true"`` + will toggle data values without the user pressing the shift-key. + + **Default value:** ``true`` + + **See also:** `toggle examples + `__ in the + documentation. + """ + _schema = {'$ref': '#/definitions/PointSelectionConfig'} + + def __init__(self, type=Undefined, clear=Undefined, encodings=Undefined, fields=Undefined, + nearest=Undefined, on=Undefined, resolve=Undefined, toggle=Undefined, **kwds): + super(PointSelectionConfig, self).__init__(type=type, clear=clear, encodings=encodings, + fields=fields, nearest=nearest, on=on, + resolve=resolve, toggle=toggle, **kwds) + + +class PointSelectionConfigWithoutType(VegaLiteSchema): + """PointSelectionConfigWithoutType schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + clear : anyOf(:class:`Stream`, string, boolean) + Clears the selection, emptying it of all values. This property can be a `Event + Stream `__ or ``false`` to disable + clear. + + **Default value:** ``dblclick``. + + **See also:** `clear examples + `__ in the + documentation. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. + + **See also:** The `projection with encodings and fields section + `__ in the + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to fall within the + selection. + + **See also:** The `projection with encodings and fields section + `__ in the + documentation. + nearest : boolean + When true, an invisible voronoi diagram is computed to accelerate discrete + selection. The data value *nearest* the mouse cursor is added to the selection. + + **Default value:** ``false``, which means that data values must be interacted with + directly (e.g., clicked on) to be added to the selection. + + **See also:** `nearest examples + `__ documentation. + on : anyOf(:class:`Stream`, string) + A `Vega event stream `__ (object or + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end + `__. + + **See also:** `on examples + `__ in the documentation. + resolve : :class:`SelectionResolution` + With layered and multi-view displays, a strategy that determines how selections' + data queries are resolved when applied in a filter transform, conditional encoding + rule, or scale domain. + + One of: + + + * ``"global"`` -- only one brush exists for the entire SPLOM. When the user begins + to drag, any previous brushes are cleared, and a new one is constructed. + * ``"union"`` -- each cell contains its own brush, and points are highlighted if + they lie within *any* of these individual brushes. + * ``"intersect"`` -- each cell contains its own brush, and points are highlighted + only if they fall within *all* of these individual brushes. + + **Default value:** ``global``. + + **See also:** `resolve examples + `__ in the + documentation. + toggle : anyOf(string, boolean) + Controls whether data values should be toggled (inserted or removed from a point + selection) or only ever inserted into multi selections. + + One of: + + + * ``true`` -- the default behavior, which corresponds to ``"event.shiftKey"``. As a + result, data values are toggled when the user interacts with the shift-key + pressed. + * ``false`` -- disables toggling behaviour; as the user interacts, data values are + only inserted into the multi selection and never removed. + * A `Vega expression `__ which is + re-evaluated as the user interacts. If the expression evaluates to ``true``, the + data value is toggled into or out of the multi selection. If the expression + evaluates to ``false``, the multi selection is first clear, and the data value is + then inserted. For example, setting the value to the Vega expression ``"true"`` + will toggle data values without the user pressing the shift-key. + + **Default value:** ``true`` + + **See also:** `toggle examples + `__ in the + documentation. + """ + _schema = {'$ref': '#/definitions/PointSelectionConfigWithoutType'} + + def __init__(self, clear=Undefined, encodings=Undefined, fields=Undefined, nearest=Undefined, + on=Undefined, resolve=Undefined, toggle=Undefined, **kwds): + super(PointSelectionConfigWithoutType, self).__init__(clear=clear, encodings=encodings, + fields=fields, nearest=nearest, on=on, + resolve=resolve, toggle=toggle, **kwds) + + +class PolarDef(VegaLiteSchema): + """PolarDef schema wrapper + + anyOf(:class:`PositionFieldDefBase`, :class:`PositionDatumDefBase`, + :class:`PositionValueDef`) + """ + _schema = {'$ref': '#/definitions/PolarDef'} + + def __init__(self, *args, **kwds): + super(PolarDef, self).__init__(*args, **kwds) + + +class Position2Def(VegaLiteSchema): + """Position2Def schema wrapper + + anyOf(:class:`SecondaryFieldDef`, :class:`DatumDef`, :class:`PositionValueDef`) + """ + _schema = {'$ref': '#/definitions/Position2Def'} + + def __init__(self, *args, **kwds): + super(Position2Def, self).__init__(*args, **kwds) + + +class DatumDef(LatLongDef, Position2Def): + """DatumDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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/DatumDef'} + + def __init__(self, bandPosition=Undefined, datum=Undefined, title=Undefined, type=Undefined, **kwds): + super(DatumDef, self).__init__(bandPosition=bandPosition, datum=datum, title=title, type=type, + **kwds) + + +class PositionDatumDefBase(PolarDef): + """PositionDatumDefBase schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + scale : anyOf(: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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + title : anyOf(:class:`Text`, 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:`Type` + 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/PositionDatumDefBase'} + + def __init__(self, bandPosition=Undefined, datum=Undefined, scale=Undefined, stack=Undefined, + title=Undefined, type=Undefined, **kwds): + super(PositionDatumDefBase, self).__init__(bandPosition=bandPosition, datum=datum, scale=scale, + stack=stack, title=title, type=type, **kwds) + + +class PositionDef(VegaLiteSchema): + """PositionDef schema wrapper + + anyOf(:class:`PositionFieldDef`, :class:`PositionDatumDef`, :class:`PositionValueDef`) + """ + _schema = {'$ref': '#/definitions/PositionDef'} + + def __init__(self, *args, **kwds): + super(PositionDef, self).__init__(*args, **kwds) + + +class PositionDatumDef(PositionDef): + """PositionDatumDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + impute : anyOf(:class:`ImputeParams`, None) + An object defining the properties of the Impute Operation to be applied. The field + value of the other positional channel is taken as ``key`` of the ``Impute`` + Operation. The field of the ``color`` channel if specified is used as ``groupby`` of + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + scale : anyOf(: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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + title : anyOf(:class:`Text`, 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:`Type` + 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/PositionDatumDef'} + + def __init__(self, axis=Undefined, bandPosition=Undefined, datum=Undefined, impute=Undefined, + scale=Undefined, stack=Undefined, title=Undefined, type=Undefined, **kwds): + super(PositionDatumDef, self).__init__(axis=axis, bandPosition=bandPosition, datum=datum, + impute=impute, scale=scale, stack=stack, title=title, + type=type, **kwds) + + +class PositionFieldDef(PositionDef): + """PositionFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + impute : anyOf(:class:`ImputeParams`, None) + An object defining the properties of the Impute Operation to be applied. The field + value of the other positional channel is taken as ``key`` of the ``Impute`` + Operation. The field of the ``color`` channel if specified is used as ``groupby`` of + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/PositionFieldDef'} + + def __init__(self, aggregate=Undefined, axis=Undefined, bandPosition=Undefined, bin=Undefined, + field=Undefined, impute=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(PositionFieldDef, self).__init__(aggregate=aggregate, axis=axis, + bandPosition=bandPosition, bin=bin, field=field, + impute=impute, scale=scale, sort=sort, stack=stack, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class PositionFieldDefBase(PolarDef): + """PositionFieldDefBase schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + scale : anyOf(: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 : :class:`Sort` + 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. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. ``stack`` is only applicable + for ``x``, ``y``, ``theta``, and ``radius`` channels with continuous domains. For + example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + chart. + + ``stack`` can be one of the following values: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/PositionFieldDefBase'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, + scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, title=Undefined, + type=Undefined, **kwds): + super(PositionFieldDefBase, self).__init__(aggregate=aggregate, bandPosition=bandPosition, + bin=bin, field=field, scale=scale, sort=sort, + stack=stack, timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class PositionValueDef(PolarDef, Position2Def, PositionDef): + """PositionValueDef schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/PositionValueDef'} + + def __init__(self, value=Undefined, **kwds): + super(PositionValueDef, self).__init__(value=value, **kwds) + + +class PredicateComposition(VegaLiteSchema): + """PredicateComposition schema wrapper + + anyOf(:class:`LogicalNotPredicate`, :class:`LogicalAndPredicate`, + :class:`LogicalOrPredicate`, :class:`Predicate`) + """ + _schema = {'$ref': '#/definitions/PredicateComposition'} + + def __init__(self, *args, **kwds): + super(PredicateComposition, self).__init__(*args, **kwds) + + +class LogicalAndPredicate(PredicateComposition): + """LogicalAndPredicate schema wrapper + + Mapping(required=[and]) + + Attributes + ---------- + + and : List(:class:`PredicateComposition`) + + """ + _schema = {'$ref': '#/definitions/LogicalAnd'} + + def __init__(self, **kwds): + super(LogicalAndPredicate, self).__init__(**kwds) + + +class LogicalNotPredicate(PredicateComposition): + """LogicalNotPredicate schema wrapper + + Mapping(required=[not]) + + Attributes + ---------- + + not : :class:`PredicateComposition` + + """ + _schema = {'$ref': '#/definitions/LogicalNot'} + + def __init__(self, **kwds): + super(LogicalNotPredicate, self).__init__(**kwds) + + +class LogicalOrPredicate(PredicateComposition): + """LogicalOrPredicate schema wrapper + + Mapping(required=[or]) + + Attributes + ---------- + + or : List(:class:`PredicateComposition`) + + """ + _schema = {'$ref': '#/definitions/LogicalOr'} + + def __init__(self, **kwds): + super(LogicalOrPredicate, self).__init__(**kwds) + + +class Predicate(PredicateComposition): + """Predicate schema wrapper + + anyOf(:class:`FieldEqualPredicate`, :class:`FieldRangePredicate`, + :class:`FieldOneOfPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTPredicate`, + :class:`FieldLTEPredicate`, :class:`FieldGTEPredicate`, :class:`FieldValidPredicate`, + :class:`ParameterPredicate`, string) + """ + _schema = {'$ref': '#/definitions/Predicate'} + + def __init__(self, *args, **kwds): + super(Predicate, self).__init__(*args, **kwds) + + +class FieldEqualPredicate(Predicate): + """FieldEqualPredicate schema wrapper + + Mapping(required=[equal, field]) + + Attributes + ---------- + + equal : anyOf(string, float, boolean, :class:`DateTime`, :class:`ExprRef`) + The value that the field should be equal to. + field : :class:`FieldName` + Field to be tested. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit for the field to be tested. + """ + _schema = {'$ref': '#/definitions/FieldEqualPredicate'} + + def __init__(self, equal=Undefined, field=Undefined, timeUnit=Undefined, **kwds): + super(FieldEqualPredicate, self).__init__(equal=equal, field=field, timeUnit=timeUnit, **kwds) + + +class FieldGTEPredicate(Predicate): + """FieldGTEPredicate schema wrapper + + Mapping(required=[field, gte]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + gte : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + The value that the field should be greater than or equals to. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit for the field to be tested. + """ + _schema = {'$ref': '#/definitions/FieldGTEPredicate'} + + def __init__(self, field=Undefined, gte=Undefined, timeUnit=Undefined, **kwds): + super(FieldGTEPredicate, self).__init__(field=field, gte=gte, timeUnit=timeUnit, **kwds) + + +class FieldGTPredicate(Predicate): + """FieldGTPredicate schema wrapper + + Mapping(required=[field, gt]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + gt : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + The value that the field should be greater than. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit for the field to be tested. + """ + _schema = {'$ref': '#/definitions/FieldGTPredicate'} + + def __init__(self, field=Undefined, gt=Undefined, timeUnit=Undefined, **kwds): + super(FieldGTPredicate, self).__init__(field=field, gt=gt, timeUnit=timeUnit, **kwds) + + +class FieldLTEPredicate(Predicate): + """FieldLTEPredicate schema wrapper + + Mapping(required=[field, lte]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + lte : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + The value that the field should be less than or equals to. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit for the field to be tested. + """ + _schema = {'$ref': '#/definitions/FieldLTEPredicate'} + + def __init__(self, field=Undefined, lte=Undefined, timeUnit=Undefined, **kwds): + super(FieldLTEPredicate, self).__init__(field=field, lte=lte, timeUnit=timeUnit, **kwds) + + +class FieldLTPredicate(Predicate): + """FieldLTPredicate schema wrapper + + Mapping(required=[field, lt]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + lt : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + The value that the field should be less than. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit for the field to be tested. + """ + _schema = {'$ref': '#/definitions/FieldLTPredicate'} + + def __init__(self, field=Undefined, lt=Undefined, timeUnit=Undefined, **kwds): + super(FieldLTPredicate, self).__init__(field=field, lt=lt, timeUnit=timeUnit, **kwds) + + +class FieldOneOfPredicate(Predicate): + """FieldOneOfPredicate schema wrapper + + Mapping(required=[field, oneOf]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + oneOf : anyOf(List(string), List(float), List(boolean), List(:class:`DateTime`)) + A set of values that the ``field`` 's value should be a member of, for a data item + included in the filtered data. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit for the field to be tested. + """ + _schema = {'$ref': '#/definitions/FieldOneOfPredicate'} + + def __init__(self, field=Undefined, oneOf=Undefined, timeUnit=Undefined, **kwds): + super(FieldOneOfPredicate, self).__init__(field=field, oneOf=oneOf, timeUnit=timeUnit, **kwds) + + +class FieldRangePredicate(Predicate): + """FieldRangePredicate schema wrapper + + Mapping(required=[field, range]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + range : anyOf(List(anyOf(float, :class:`DateTime`, None, :class:`ExprRef`)), + :class:`ExprRef`) + An array of inclusive minimum and maximum values for a field value of a data item to + be included in the filtered data. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit for the field to be tested. + """ + _schema = {'$ref': '#/definitions/FieldRangePredicate'} + + def __init__(self, field=Undefined, range=Undefined, timeUnit=Undefined, **kwds): + super(FieldRangePredicate, self).__init__(field=field, range=range, timeUnit=timeUnit, **kwds) + + +class FieldValidPredicate(Predicate): + """FieldValidPredicate schema wrapper + + Mapping(required=[field, valid]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + valid : boolean + If set to true the field's value has to be valid, meaning both not ``null`` and not + `NaN + `__. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit for the field to be tested. + """ + _schema = {'$ref': '#/definitions/FieldValidPredicate'} + + def __init__(self, field=Undefined, valid=Undefined, timeUnit=Undefined, **kwds): + super(FieldValidPredicate, self).__init__(field=field, valid=valid, timeUnit=timeUnit, **kwds) + + +class ParameterPredicate(Predicate): + """ParameterPredicate schema wrapper + + Mapping(required=[param]) + + Attributes + ---------- + + param : :class:`ParameterName` + Filter using a parameter name. + empty : boolean + For selection parameters, the predicate of empty selections returns true by default. + Override this behavior, by setting this property ``empty: false``. + """ + _schema = {'$ref': '#/definitions/ParameterPredicate'} + + def __init__(self, param=Undefined, empty=Undefined, **kwds): + super(ParameterPredicate, self).__init__(param=param, empty=empty, **kwds) + + +class Projection(VegaLiteSchema): + """Projection schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + center : anyOf(:class:`Vector2number`, :class:`ExprRef`) + + clipAngle : anyOf(float, :class:`ExprRef`) + + clipExtent : anyOf(:class:`Vector2Vector2number`, :class:`ExprRef`) + + coefficient : anyOf(float, :class:`ExprRef`) + + distance : anyOf(float, :class:`ExprRef`) + + extent : anyOf(:class:`Vector2Vector2number`, :class:`ExprRef`) + + fit : anyOf(List(:class:`GeoJsonFeature`), List(:class:`Fit`), :class:`ExprRef`) + + fraction : anyOf(float, :class:`ExprRef`) + + lobes : anyOf(float, :class:`ExprRef`) + + parallel : anyOf(float, :class:`ExprRef`) + + parallels : anyOf(List(float), :class:`ExprRef`) + + pointRadius : anyOf(float, :class:`ExprRef`) + + precision : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + + ratio : anyOf(float, :class:`ExprRef`) + + reflectX : anyOf(boolean, :class:`ExprRef`) + + reflectY : anyOf(boolean, :class:`ExprRef`) + + rotate : anyOf(anyOf(:class:`Vector2number`, :class:`Vector3number`), :class:`ExprRef`) + + scale : anyOf(float, :class:`ExprRef`) + The projection’s scale (zoom) factor, overriding automatic fitting. The default + scale is projection-specific. The scale factor corresponds linearly to the distance + between projected points; however, scale factor values are not equivalent across + projections. + size : anyOf(:class:`Vector2number`, :class:`ExprRef`) + + spacing : anyOf(float, :class:`ExprRef`) + + tilt : anyOf(float, :class:`ExprRef`) + + translate : anyOf(:class:`Vector2number`, :class:`ExprRef`) + The projection’s translation offset as a two-element array ``[tx, ty]``. + type : anyOf(:class:`ProjectionType`, :class:`ExprRef`) + The cartographic projection to use. This value is case-insensitive, for example + ``"albers"`` and ``"Albers"`` indicate the same projection type. You can find all + valid projection types `in the documentation + `__. + + **Default value:** ``equalEarth`` + """ + _schema = {'$ref': '#/definitions/Projection'} + + def __init__(self, center=Undefined, clipAngle=Undefined, clipExtent=Undefined, + coefficient=Undefined, distance=Undefined, extent=Undefined, fit=Undefined, + fraction=Undefined, lobes=Undefined, parallel=Undefined, parallels=Undefined, + pointRadius=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, + reflectX=Undefined, reflectY=Undefined, rotate=Undefined, scale=Undefined, + size=Undefined, spacing=Undefined, tilt=Undefined, translate=Undefined, type=Undefined, + **kwds): + super(Projection, self).__init__(center=center, clipAngle=clipAngle, clipExtent=clipExtent, + coefficient=coefficient, distance=distance, extent=extent, + fit=fit, fraction=fraction, lobes=lobes, parallel=parallel, + parallels=parallels, pointRadius=pointRadius, + precision=precision, radius=radius, ratio=ratio, + reflectX=reflectX, reflectY=reflectY, rotate=rotate, + scale=scale, size=size, spacing=spacing, tilt=tilt, + translate=translate, type=type, **kwds) + + +class ProjectionConfig(VegaLiteSchema): + """ProjectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + center : anyOf(:class:`Vector2number`, :class:`ExprRef`) + + clipAngle : anyOf(float, :class:`ExprRef`) + + clipExtent : anyOf(:class:`Vector2Vector2number`, :class:`ExprRef`) + + coefficient : anyOf(float, :class:`ExprRef`) + + distance : anyOf(float, :class:`ExprRef`) + + extent : anyOf(:class:`Vector2Vector2number`, :class:`ExprRef`) + + fit : anyOf(List(:class:`GeoJsonFeature`), List(:class:`Fit`), :class:`ExprRef`) + + fraction : anyOf(float, :class:`ExprRef`) + + lobes : anyOf(float, :class:`ExprRef`) + + parallel : anyOf(float, :class:`ExprRef`) + + parallels : anyOf(List(float), :class:`ExprRef`) + + pointRadius : anyOf(float, :class:`ExprRef`) + + precision : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + + ratio : anyOf(float, :class:`ExprRef`) + + reflectX : anyOf(boolean, :class:`ExprRef`) + + reflectY : anyOf(boolean, :class:`ExprRef`) + + rotate : anyOf(anyOf(:class:`Vector2number`, :class:`Vector3number`), :class:`ExprRef`) + + scale : anyOf(float, :class:`ExprRef`) + The projection’s scale (zoom) factor, overriding automatic fitting. The default + scale is projection-specific. The scale factor corresponds linearly to the distance + between projected points; however, scale factor values are not equivalent across + projections. + size : anyOf(:class:`Vector2number`, :class:`ExprRef`) + + spacing : anyOf(float, :class:`ExprRef`) + + tilt : anyOf(float, :class:`ExprRef`) + + translate : anyOf(:class:`Vector2number`, :class:`ExprRef`) + The projection’s translation offset as a two-element array ``[tx, ty]``. + type : anyOf(:class:`ProjectionType`, :class:`ExprRef`) + The cartographic projection to use. This value is case-insensitive, for example + ``"albers"`` and ``"Albers"`` indicate the same projection type. You can find all + valid projection types `in the documentation + `__. + + **Default value:** ``equalEarth`` + """ + _schema = {'$ref': '#/definitions/ProjectionConfig'} + + def __init__(self, center=Undefined, clipAngle=Undefined, clipExtent=Undefined, + coefficient=Undefined, distance=Undefined, extent=Undefined, fit=Undefined, + fraction=Undefined, lobes=Undefined, parallel=Undefined, parallels=Undefined, + pointRadius=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, + reflectX=Undefined, reflectY=Undefined, rotate=Undefined, scale=Undefined, + size=Undefined, spacing=Undefined, tilt=Undefined, translate=Undefined, type=Undefined, + **kwds): + super(ProjectionConfig, self).__init__(center=center, clipAngle=clipAngle, + clipExtent=clipExtent, coefficient=coefficient, + distance=distance, extent=extent, fit=fit, + fraction=fraction, lobes=lobes, parallel=parallel, + parallels=parallels, pointRadius=pointRadius, + precision=precision, radius=radius, ratio=ratio, + reflectX=reflectX, reflectY=reflectY, rotate=rotate, + scale=scale, size=size, spacing=spacing, tilt=tilt, + translate=translate, type=type, **kwds) + + +class ProjectionType(VegaLiteSchema): + """ProjectionType schema wrapper + + enum('albers', 'albersUsa', 'azimuthalEqualArea', 'azimuthalEquidistant', 'conicConformal', + 'conicEqualArea', 'conicEquidistant', 'equalEarth', 'equirectangular', 'gnomonic', + 'identity', 'mercator', 'naturalEarth1', 'orthographic', 'stereographic', + 'transverseMercator') + """ + _schema = {'$ref': '#/definitions/ProjectionType'} + + def __init__(self, *args): + super(ProjectionType, self).__init__(*args) + + +class RadialGradient(Gradient): + """RadialGradient schema wrapper + + Mapping(required=[gradient, stops]) + + Attributes + ---------- + + gradient : string + The type of gradient. Use ``"radial"`` for a radial gradient. + stops : List(:class:`GradientStop`) + An array of gradient stops defining the gradient color sequence. + id : string + + r1 : float + The radius length, in normalized [0, 1] coordinates, of the inner circle for the + gradient. + + **Default value:** ``0`` + r2 : float + The radius length, in normalized [0, 1] coordinates, of the outer circle for the + gradient. + + **Default value:** ``0.5`` + x1 : float + The x-coordinate, in normalized [0, 1] coordinates, for the center of the inner + circle for the gradient. + + **Default value:** ``0.5`` + x2 : float + The x-coordinate, in normalized [0, 1] coordinates, for the center of the outer + circle for the gradient. + + **Default value:** ``0.5`` + y1 : float + The y-coordinate, in normalized [0, 1] coordinates, for the center of the inner + circle for the gradient. + + **Default value:** ``0.5`` + y2 : float + The y-coordinate, in normalized [0, 1] coordinates, for the center of the outer + circle for the gradient. + + **Default value:** ``0.5`` + """ + _schema = {'$ref': '#/definitions/RadialGradient'} + + def __init__(self, gradient=Undefined, stops=Undefined, id=Undefined, r1=Undefined, r2=Undefined, + x1=Undefined, x2=Undefined, y1=Undefined, y2=Undefined, **kwds): + super(RadialGradient, self).__init__(gradient=gradient, stops=stops, id=id, r1=r1, r2=r2, x1=x1, + x2=x2, y1=y1, y2=y2, **kwds) + + +class RangeConfig(VegaLiteSchema): + """RangeConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + category : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + Default `color scheme `__ for categorical + data. + diverging : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + Default `color scheme `__ for diverging + quantitative ramps. + heatmap : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + Default `color scheme `__ for + quantitative heatmaps. + ordinal : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + Default `color scheme `__ for + rank-ordered data. + ramp : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + Default `color scheme `__ for sequential + quantitative ramps. + symbol : List(:class:`SymbolShape`) + Array of `symbol `__ names or paths + for the default shape palette. + """ + _schema = {'$ref': '#/definitions/RangeConfig'} + + def __init__(self, category=Undefined, diverging=Undefined, heatmap=Undefined, ordinal=Undefined, + ramp=Undefined, symbol=Undefined, **kwds): + super(RangeConfig, self).__init__(category=category, diverging=diverging, heatmap=heatmap, + ordinal=ordinal, ramp=ramp, symbol=symbol, **kwds) + + +class RangeRawArray(VegaLiteSchema): + """RangeRawArray schema wrapper + + List(float) + """ + _schema = {'$ref': '#/definitions/RangeRawArray'} + + def __init__(self, *args): + super(RangeRawArray, self).__init__(*args) + + +class RangeScheme(VegaLiteSchema): + """RangeScheme schema wrapper + + anyOf(:class:`RangeEnum`, :class:`RangeRaw`, Mapping(required=[scheme])) + """ + _schema = {'$ref': '#/definitions/RangeScheme'} + + def __init__(self, *args, **kwds): + super(RangeScheme, self).__init__(*args, **kwds) + + +class RangeEnum(RangeScheme): + """RangeEnum schema wrapper + + enum('width', 'height', 'symbol', 'category', 'ordinal', 'ramp', 'diverging', 'heatmap') + """ + _schema = {'$ref': '#/definitions/RangeEnum'} + + def __init__(self, *args): + super(RangeEnum, self).__init__(*args) + + +class RangeRaw(RangeScheme): + """RangeRaw schema wrapper + + List(anyOf(None, boolean, string, float, :class:`RangeRawArray`)) + """ + _schema = {'$ref': '#/definitions/RangeRaw'} + + def __init__(self, *args): + super(RangeRaw, self).__init__(*args) + + +class RectConfig(AnyMarkConfig): + """RectConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). + One of ``"left"``, ``"right"``, ``"center"``. + + **Note:** Expression reference is *not* supported for range marks. + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an + expression reference that provides one of the valid values. The ``"line-top"`` and + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + binSpacing : float + Offset between bars for binned field. The ideal value for this is either 0 + (preferred by statisticians) or 1 (Vega-Lite default, D3 example style). + + **Default value:** ``1`` + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + continuousBandSize : float + The default size of the bars on continuous scales. + + **Default value:** ``5`` + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + discreteBandSize : anyOf(float, :class:`RelativeBandSize`) + The default size of the bars with discrete dimensions. If unspecified, the default + size is ``step-2``, which provides 2 pixel offset between bars. + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default fill color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove fill. + + **Default value:** (None) + fillOpacity : anyOf(float, :class:`ExprRef`) + + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + + **Default value:** ``0`` + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). + + + * If set to ``"filter"`` (default), all data items with null values will be skipped + (for line, trail, and area marks) or filtered (for other marks). + * If ``null``, all data items are included. In this case, invalid values will be + interpreted as zeroes. + limit : anyOf(float, :class:`ExprRef`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). + + **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, + ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. + order : anyOf(None, boolean) + For line and trail marks, this ``order`` property can be set to ``null`` or + ``false`` to make the lines use the original order in the data sources. + orient : :class:`Orientation` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + the line if ``config.sortLineBy`` is not specified. For stacked charts, this is + always determined by the orientation of the stack; therefore explicitly specified + value will be ignored. + outerRadius : anyOf(float, :class:`ExprRef`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + + **Default value:** ``0`` + padAngle : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + For arc mark, the primary (outer) radius in pixels. + + For text marks, polar coordinate radial offset, in pixels, of the text from the + origin determined by the ``x`` and ``y`` properties. + + **Default value:** ``min(plot_width, plot_height)/2`` + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + + **Default value:** ``0`` + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. Note that this value sets the area of the symbol; the side lengths will + increase with the square root of this value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** + + + * ``30`` for point, circle, square marks; width/height's ``step`` + * ``2`` for bar marks with discrete dimensions; + * ``5`` for bar marks with continuous dimensions; + * ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default stroke color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove stroke. + + **Default value:** (None) + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : anyOf(float, :class:`ExprRef`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + 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 + will be positioned in the middle of the time unit band step. + timeUnitBandSize : float + Default relative band size for a time unit. If set to ``1``, the bandwidth of the + marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the + marks will be half of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : anyOf(float, string, :class:`ExprRef`) + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + y : anyOf(float, string, :class:`ExprRef`) + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : anyOf(float, string, :class:`ExprRef`) + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + """ + _schema = {'$ref': '#/definitions/RectConfig'} + + def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, + binSpacing=Undefined, blend=Undefined, color=Undefined, continuousBandSize=Undefined, + cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, + cornerRadiusBottomRight=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, + discreteBandSize=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, + endAngle=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, lineBreak=Undefined, lineHeight=Undefined, + opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, + padAngle=Undefined, radius=Undefined, radius2=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, startAngle=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, timeUnitBandPosition=Undefined, + timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, + x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, **kwds): + super(RectConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, + baseline=baseline, binSpacing=binSpacing, blend=blend, + color=color, continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, + description=description, dir=dir, + discreteBandSize=discreteBandSize, dx=dx, dy=dy, + ellipsis=ellipsis, endAngle=endAngle, fill=fill, + fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, + interpolate=interpolate, invalid=invalid, limit=limit, + lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, + order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, radius=radius, radius2=radius2, shape=shape, + size=size, smooth=smooth, startAngle=startAngle, stroke=stroke, + strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, theta2=theta2, + timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, + width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class RelativeBandSize(VegaLiteSchema): + """RelativeBandSize schema wrapper + + Mapping(required=[band]) + + Attributes + ---------- + + band : float + The relative band size. For example ``0.5`` means half of the band scale's band + width. + """ + _schema = {'$ref': '#/definitions/RelativeBandSize'} + + def __init__(self, band=Undefined, **kwds): + super(RelativeBandSize, self).__init__(band=band, **kwds) + + +class RepeatMapping(VegaLiteSchema): + """RepeatMapping schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : List(string) + An array of fields to be repeated horizontally. + row : List(string) + An array of fields to be repeated vertically. + """ + _schema = {'$ref': '#/definitions/RepeatMapping'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RepeatMapping, self).__init__(column=column, row=row, **kwds) + + +class RepeatRef(Field): + """RepeatRef schema wrapper + + Mapping(required=[repeat]) + Reference to a repeated value. + + Attributes + ---------- + + repeat : enum('row', 'column', 'repeat', 'layer') + + """ + _schema = {'$ref': '#/definitions/RepeatRef'} + + def __init__(self, repeat=Undefined, **kwds): + super(RepeatRef, self).__init__(repeat=repeat, **kwds) + + +class Resolve(VegaLiteSchema): + """Resolve schema wrapper + + Mapping(required=[]) + Defines how scales, axes, and legends from different specs should be combined. Resolve is a + mapping from ``scale``, ``axis``, and ``legend`` to a mapping from channels to resolutions. + Scales and guides can be resolved to be ``"independent"`` or ``"shared"``. + + Attributes + ---------- + + axis : :class:`AxisResolveMap` + + legend : :class:`LegendResolveMap` + + scale : :class:`ScaleResolveMap` + + """ + _schema = {'$ref': '#/definitions/Resolve'} + + def __init__(self, axis=Undefined, legend=Undefined, scale=Undefined, **kwds): + super(Resolve, self).__init__(axis=axis, legend=legend, scale=scale, **kwds) + + +class ResolveMode(VegaLiteSchema): + """ResolveMode schema wrapper + + enum('independent', 'shared') + """ + _schema = {'$ref': '#/definitions/ResolveMode'} + + def __init__(self, *args): + super(ResolveMode, self).__init__(*args) + + +class RowColLayoutAlign(VegaLiteSchema): + """RowColLayoutAlign schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : :class:`LayoutAlign` + + row : :class:`LayoutAlign` + + """ + _schema = {'$ref': '#/definitions/RowCol'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RowColLayoutAlign, self).__init__(column=column, row=row, **kwds) + + +class RowColboolean(VegaLiteSchema): + """RowColboolean schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : boolean + + row : boolean + + """ + _schema = {'$ref': '#/definitions/RowCol'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RowColboolean, self).__init__(column=column, row=row, **kwds) + + +class RowColnumber(VegaLiteSchema): + """RowColnumber schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : float + + row : float + + """ + _schema = {'$ref': '#/definitions/RowCol'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RowColnumber, self).__init__(column=column, row=row, **kwds) + + +class RowColumnEncodingFieldDef(VegaLiteSchema): + """RowColumnEncodingFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + align : :class:`LayoutAlign` + The alignment to apply to row/column facet's subplot. The supported string values + are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + **Default value:** ``"all"``. + 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 : anyOf(boolean, :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. + center : boolean + Boolean flag indicating if facet's subviews should be centered relative to their + respective rows or columns. + + **Default value:** ``false`` + field : :class:`Field` + **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``. + header : anyOf(:class:`Header`, None) + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, 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 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`` is not supported for ``row`` and ``column``. + spacing : float + The spacing in pixels between facet's sub-views. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/RowColumnEncodingFieldDef'} + + def __init__(self, aggregate=Undefined, align=Undefined, bandPosition=Undefined, bin=Undefined, + center=Undefined, field=Undefined, header=Undefined, sort=Undefined, spacing=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(RowColumnEncodingFieldDef, self).__init__(aggregate=aggregate, align=align, + bandPosition=bandPosition, bin=bin, + center=center, field=field, header=header, + sort=sort, spacing=spacing, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class Scale(VegaLiteSchema): + """Scale schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(float, :class:`ExprRef`) + The alignment of the steps within the scale range. + + This value must lie in the range ``[0,1]``. A value of ``0.5`` indicates that the + steps should be centered within the range. A value of ``0`` or ``1`` may be used to + shift the bands to one side, say to position them adjacent to an axis. + + **Default value:** ``0.5`` + base : anyOf(float, :class:`ExprRef`) + The logarithm base of the ``log`` scale (default ``10`` ). + bins : :class:`ScaleBins` + Bin boundaries can be provided to scales as either an explicit array of bin + boundaries or as a bin specification object. The legal values are: + + + * An `array <../types/#Array>`__ literal of bin boundary values. For example, ``[0, + 5, 10, 15, 20]``. The array must include both starting and ending boundaries. The + previous example uses five values to indicate a total of four bin intervals: + [0-5), [5-10), [10-15), [15-20]. Array literals may include signal references as + elements. + * A `bin specification object + `__ that indicates the bin + *step* size, and optionally the *start* and *stop* boundaries. + * An array of bin boundaries over the scale domain. If provided, axes and legends + will use the bin boundaries to inform the choice of tick marks and text labels. + clamp : anyOf(boolean, :class:`ExprRef`) + If ``true``, values that exceed the data domain are clamped to either the minimum or + maximum range value + + **Default value:** derived from the `scale config + `__ 's ``clamp`` ( + ``true`` by default). + constant : anyOf(float, :class:`ExprRef`) + A constant determining the slope of the symlog function around zero. Only used for + ``symlog`` scales. + + **Default value:** ``1`` + domain : anyOf(List(anyOf(None, string, float, boolean, :class:`DateTime`, + :class:`ExprRef`)), string, :class:`ParameterExtent`, :class:`DomainUnionWith`, + :class:`ExprRef`) + Customized domain values in the form of constant values or dynamic values driven by + a parameter. + + 1) Constant ``domain`` for *quantitative* fields can take one of the following + forms: + + + * A two-element array with minimum and maximum values. To create a diverging scale, + this two-element array can be combined with the ``domainMid`` property. + * An array with more than two entries, for `Piecewise quantitative scales + `__. + * A string value ``"unaggregated"``, if the input field is aggregated, to indicate + that the domain should include the raw data values prior to the aggregation. + + 2) Constant ``domain`` for *temporal* fields can be a two-element array with minimum + and maximum values, in the form of either timestamps or the `DateTime definition + objects `__. + + 3) Constant ``domain`` for *ordinal* and *nominal* fields can be an array that lists + valid input values. + + 4) To combine (union) specified constant domain with the field's values, ``domain`` + can be an object with a ``unionWith`` property that specify constant domain to be + combined. For example, ``domain: {unionWith: [0, 100]}`` for a quantitative scale + means that the scale domain always includes ``[0, 100]``, but will include other + values in the fields beyond ``[0, 100]``. + + 5) Domain can also takes an object defining a field or encoding of a parameter that + `interactively determines + `__ the scale + domain. + domainMax : anyOf(float, :class:`DateTime`, :class:`ExprRef`) + Sets the maximum value in the scale domain, overriding the ``domain`` property. This + property is only intended for use with scales having continuous domains. + domainMid : anyOf(float, :class:`ExprRef`) + Inserts a single mid-point value into a two-element domain. The mid-point value must + lie between the domain minimum and maximum values. This property can be useful for + setting a midpoint for `diverging color scales + `__. The domainMid + property is only intended for use with scales supporting continuous, piecewise + domains. + domainMin : anyOf(float, :class:`DateTime`, :class:`ExprRef`) + Sets the minimum value in the scale domain, overriding the domain property. This + property is only intended for use with scales having continuous domains. + exponent : anyOf(float, :class:`ExprRef`) + The exponent of the ``pow`` scale. + interpolate : anyOf(:class:`ScaleInterpolateEnum`, :class:`ExprRef`, + :class:`ScaleInterpolateParams`) + The interpolation method for range values. By default, a general interpolator for + numbers, dates, strings and colors (in HCL space) is used. For color ranges, this + property allows interpolation in alternative color spaces. Legal values include + ``rgb``, ``hsl``, ``hsl-long``, ``lab``, ``hcl``, ``hcl-long``, ``cubehelix`` and + ``cubehelix-long`` ('-long' variants use longer paths in polar coordinate spaces). + If object-valued, this property accepts an object with a string-valued *type* + property and an optional numeric *gamma* property applicable to rgb and cubehelix + interpolators. For more, see the `d3-interpolate documentation + `__. + + + * **Default value:** ``hcl`` + nice : anyOf(boolean, float, :class:`TimeInterval`, :class:`TimeIntervalStep`, + :class:`ExprRef`) + Extending the domain so that it starts and ends on nice round values. This method + typically modifies the scale’s domain, and may only extend the bounds to the nearest + round value. Nicing is useful if the domain is computed from data and may be + irregular. For example, for a domain of *[0.201479…, 0.996679…]*, a nice domain + might be *[0.2, 1.0]*. + + For quantitative scales such as linear, ``nice`` can be either a boolean flag or a + number. If ``nice`` is a number, it will represent a desired tick count. This allows + greater control over the step size used to extend the bounds, guaranteeing that the + returned ticks will exactly cover the domain. + + For temporal fields with time and utc scales, the ``nice`` value can be a string + indicating the desired time interval. Legal values are ``"millisecond"``, + ``"second"``, ``"minute"``, ``"hour"``, ``"day"``, ``"week"``, ``"month"``, and + ``"year"``. Alternatively, ``time`` and ``utc`` scales can accept an object-valued + interval specifier of the form ``{"interval": "month", "step": 3}``, which includes + a desired number of interval steps. Here, the domain would snap to quarter (Jan, + Apr, Jul, Oct) boundaries. + + **Default value:** ``true`` for unbinned *quantitative* fields without explicit + domain bounds; ``false`` otherwise. + padding : anyOf(float, :class:`ExprRef`) + For * `continuous `__ * + scales, expands the scale domain to accommodate the specified number of pixels on + each of the scale range. The scale range must represent pixels for this parameter to + function as intended. Padding adjustment is performed prior to all other + adjustments, including the effects of the  ``zero``,  ``nice``,  ``domainMin``, and + ``domainMax``  properties. + + For * `band `__ * scales, + shortcut for setting ``paddingInner`` and ``paddingOuter`` to the same value. + + For * `point `__ * scales, + alias for ``paddingOuter``. + + **Default value:** For *continuous* scales, derived from the `scale config + `__ 's + ``continuousPadding``. For *band and point* scales, see ``paddingInner`` and + ``paddingOuter``. By default, Vega-Lite sets padding such that *width/height = + number of unique values * step*. + paddingInner : anyOf(float, :class:`ExprRef`) + The inner padding (spacing) within each band step of band scales, as a fraction of + the step size. This value must lie in the range [0,1]. + + For point scale, this property is invalid as point scales do not have internal band + widths (only step sizes between bands). + + **Default value:** derived from the `scale config + `__ 's + ``bandPaddingInner``. + paddingOuter : anyOf(float, :class:`ExprRef`) + The outer padding (spacing) at the ends of the range of band and point scales, as a + fraction of the step size. This value must lie in the range [0,1]. + + **Default value:** derived from the `scale config + `__ 's ``bandPaddingOuter`` + for band scales and ``pointPadding`` for point scales. By default, Vega-Lite sets + outer padding such that *width/height = number of unique values * step*. + range : anyOf(:class:`RangeEnum`, List(anyOf(float, string, List(float), :class:`ExprRef`)), + :class:`FieldRange`) + The range of the scale. One of: + + + A string indicating a `pre-defined named scale range + `__ (e.g., example, + ``"symbol"``, or ``"diverging"`` ). + + For `continuous scales + `__, two-element array + indicating minimum and maximum values, or an array with more than two entries for + specifying a `piecewise scale + `__. + + For `discrete `__ and + `discretizing `__ + scales, an array of desired output values or an object with a ``field`` property + representing the range values. For example, if a field ``color`` contains CSS color + names, we can set ``range`` to ``{field: "color"}``. + + **Notes:** + + 1) For color scales you can also specify a color `scheme + `__ instead of ``range``. + + 2) Any directly specified ``range`` for ``x`` and ``y`` channels will be ignored. + Range can be customized via the view's corresponding `size + `__ ( ``width`` and ``height`` ). + rangeMax : anyOf(float, string, :class:`ExprRef`) + Sets the maximum value in the scale range, overriding the ``range`` property or the + default range. This property is only intended for use with scales having continuous + ranges. + rangeMin : anyOf(float, string, :class:`ExprRef`) + Sets the minimum value in the scale range, overriding the ``range`` property or the + default range. This property is only intended for use with scales having continuous + ranges. + reverse : anyOf(boolean, :class:`ExprRef`) + If true, reverses the order of the scale range. **Default value:** ``false``. + round : anyOf(boolean, :class:`ExprRef`) + If ``true``, rounds numeric output values to integers. This can be helpful for + snapping to the pixel grid. + + **Default value:** ``false``. + scheme : anyOf(string, :class:`SchemeParams`, :class:`ExprRef`) + A string indicating a color `scheme + `__ name (e.g., + ``"category10"`` or ``"blues"`` ) or a `scheme parameter object + `__. + + Discrete color schemes may be used with `discrete + `__ or `discretizing + `__ scales. + Continuous color schemes are intended for use with color scales. + + For the full list of supported schemes, please refer to the `Vega Scheme + `__ reference. + type : :class:`ScaleType` + The type of scale. Vega-Lite supports the following categories of scale types: + + 1) `Continuous Scales + `__ -- mapping + continuous domains to continuous output ranges ( `"linear" + `__, `"pow" + `__, `"sqrt" + `__, `"symlog" + `__, `"log" + `__, `"time" + `__, `"utc" + `__. + + 2) `Discrete Scales `__ + -- mapping discrete domains to discrete ( `"ordinal" + `__ ) or continuous ( + `"band" `__ and `"point" + `__ ) output ranges. + + 3) `Discretizing Scales + `__ -- mapping + continuous domains to discrete output ranges `"bin-ordinal" + `__, `"quantile" + `__, `"quantize" + `__ and `"threshold" + `__. + + **Default value:** please see the `scale type table + `__. + zero : anyOf(boolean, :class:`ExprRef`) + If ``true``, ensures that a zero baseline value is included in the scale domain. + + **Default value:** ``true`` for x and y channels if the quantitative field is not + binned and no custom ``domain`` is provided; ``false`` otherwise. + + **Note:** Log, time, and utc scales do not support ``zero``. + """ + _schema = {'$ref': '#/definitions/Scale'} + + def __init__(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, + constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, + domainMin=Undefined, exponent=Undefined, interpolate=Undefined, nice=Undefined, + padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, + rangeMax=Undefined, rangeMin=Undefined, reverse=Undefined, round=Undefined, + scheme=Undefined, type=Undefined, zero=Undefined, **kwds): + super(Scale, self).__init__(align=align, base=base, bins=bins, clamp=clamp, constant=constant, + domain=domain, domainMax=domainMax, domainMid=domainMid, + domainMin=domainMin, exponent=exponent, interpolate=interpolate, + nice=nice, padding=padding, paddingInner=paddingInner, + paddingOuter=paddingOuter, range=range, rangeMax=rangeMax, + rangeMin=rangeMin, reverse=reverse, round=round, scheme=scheme, + type=type, zero=zero, **kwds) + + +class ScaleBins(VegaLiteSchema): + """ScaleBins schema wrapper + + anyOf(List(float), :class:`ScaleBinParams`) + """ + _schema = {'$ref': '#/definitions/ScaleBins'} + + def __init__(self, *args, **kwds): + super(ScaleBins, self).__init__(*args, **kwds) + + +class ScaleBinParams(ScaleBins): + """ScaleBinParams schema wrapper + + Mapping(required=[step]) + + Attributes + ---------- + + step : float + The step size defining the bin interval width. + start : float + The starting (lowest-valued) bin boundary. + + **Default value:** The lowest value of the scale domain will be used. + stop : float + The stopping (highest-valued) bin boundary. + + **Default value:** The highest value of the scale domain will be used. + """ + _schema = {'$ref': '#/definitions/ScaleBinParams'} + + def __init__(self, step=Undefined, start=Undefined, stop=Undefined, **kwds): + super(ScaleBinParams, self).__init__(step=step, start=start, stop=stop, **kwds) + + +class ScaleConfig(VegaLiteSchema): + """ScaleConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + bandPaddingInner : anyOf(float, :class:`ExprRef`) + Default inner padding for ``x`` and ``y`` band scales. + + **Default value:** + + + * ``nestedOffsetPaddingInner`` for x/y scales with nested x/y offset scales. + * ``barBandPaddingInner`` for bar marks ( ``0.1`` by default) + * ``rectBandPaddingInner`` for rect and other marks ( ``0`` by default) + bandPaddingOuter : anyOf(float, :class:`ExprRef`) + Default outer padding for ``x`` and ``y`` band scales. + + **Default value:** ``paddingInner/2`` (which makes *width/height = number of unique + values * step* ) + bandWithNestedOffsetPaddingInner : anyOf(float, :class:`ExprRef`) + Default inner padding for ``x`` and ``y`` band scales with nested ``xOffset`` and + ``yOffset`` encoding. + + **Default value:** ``0.2`` + bandWithNestedOffsetPaddingOuter : anyOf(float, :class:`ExprRef`) + Default outer padding for ``x`` and ``y`` band scales with nested ``xOffset`` and + ``yOffset`` encoding. + + **Default value:** ``0.2`` + barBandPaddingInner : anyOf(float, :class:`ExprRef`) + Default inner padding for ``x`` and ``y`` band-ordinal scales of ``"bar"`` marks. + + **Default value:** ``0.1`` + clamp : anyOf(boolean, :class:`ExprRef`) + If true, values that exceed the data domain are clamped to either the minimum or + maximum range value + continuousPadding : anyOf(float, :class:`ExprRef`) + Default padding for continuous x/y scales. + + **Default:** The bar width for continuous x-scale of a vertical bar and continuous + y-scale of a horizontal bar.; ``0`` otherwise. + maxBandSize : float + The default max value for mapping quantitative fields to bar's size/bandSize. + + If undefined (default), we will use the axis's size (width or height) - 1. + maxFontSize : float + The default max value for mapping quantitative fields to text's size/fontSize. + + **Default value:** ``40`` + maxOpacity : float + Default max opacity for mapping a field to opacity. + + **Default value:** ``0.8`` + maxSize : float + Default max value for point size scale. + maxStrokeWidth : float + Default max strokeWidth for the scale of strokeWidth for rule and line marks and of + size for trail marks. + + **Default value:** ``4`` + minBandSize : float + The default min value for mapping quantitative fields to bar and tick's + size/bandSize scale with zero=false. + + **Default value:** ``2`` + minFontSize : float + The default min value for mapping quantitative fields to tick's size/fontSize scale + with zero=false + + **Default value:** ``8`` + minOpacity : float + Default minimum opacity for mapping a field to opacity. + + **Default value:** ``0.3`` + minSize : float + Default minimum value for point size scale with zero=false. + + **Default value:** ``9`` + minStrokeWidth : float + Default minimum strokeWidth for the scale of strokeWidth for rule and line marks and + of size for trail marks with zero=false. + + **Default value:** ``1`` + offsetBandPaddingInner : anyOf(float, :class:`ExprRef`) + Default padding inner for xOffset/yOffset's band scales. + + **Default Value:** ``0`` + offsetBandPaddingOuter : anyOf(float, :class:`ExprRef`) + Default padding outer for xOffset/yOffset's band scales. + + **Default Value:** ``0`` + pointPadding : anyOf(float, :class:`ExprRef`) + Default outer padding for ``x`` and ``y`` point-ordinal scales. + + **Default value:** ``0.5`` (which makes *width/height = number of unique values * + step* ) + quantileCount : float + Default range cardinality for `quantile + `__ scale. + + **Default value:** ``4`` + quantizeCount : float + Default range cardinality for `quantize + `__ scale. + + **Default value:** ``4`` + rectBandPaddingInner : anyOf(float, :class:`ExprRef`) + Default inner padding for ``x`` and ``y`` band-ordinal scales of ``"rect"`` marks. + + **Default value:** ``0`` + round : anyOf(boolean, :class:`ExprRef`) + If true, rounds numeric output values to integers. This can be helpful for snapping + to the pixel grid. (Only available for ``x``, ``y``, and ``size`` scales.) + useUnaggregatedDomain : boolean + Use the source data range before aggregation as scale domain instead of aggregated + data for aggregate axis. + + This is equivalent to setting ``domain`` to ``"unaggregate"`` for aggregated + *quantitative* fields by default. + + This property only works with aggregate functions that produce values within the raw + data domain ( ``"mean"``, ``"average"``, ``"median"``, ``"q1"``, ``"q3"``, + ``"min"``, ``"max"`` ). For other aggregations that produce values outside of the + raw data domain (e.g. ``"count"``, ``"sum"`` ), this property is ignored. + + **Default value:** ``false`` + xReverse : anyOf(boolean, :class:`ExprRef`) + Reverse x-scale by default (useful for right-to-left charts). + """ + _schema = {'$ref': '#/definitions/ScaleConfig'} + + def __init__(self, bandPaddingInner=Undefined, bandPaddingOuter=Undefined, + bandWithNestedOffsetPaddingInner=Undefined, bandWithNestedOffsetPaddingOuter=Undefined, + barBandPaddingInner=Undefined, clamp=Undefined, continuousPadding=Undefined, + maxBandSize=Undefined, maxFontSize=Undefined, maxOpacity=Undefined, maxSize=Undefined, + maxStrokeWidth=Undefined, minBandSize=Undefined, minFontSize=Undefined, + minOpacity=Undefined, minSize=Undefined, minStrokeWidth=Undefined, + offsetBandPaddingInner=Undefined, offsetBandPaddingOuter=Undefined, + pointPadding=Undefined, quantileCount=Undefined, quantizeCount=Undefined, + rectBandPaddingInner=Undefined, round=Undefined, useUnaggregatedDomain=Undefined, + xReverse=Undefined, **kwds): + super(ScaleConfig, self).__init__(bandPaddingInner=bandPaddingInner, + bandPaddingOuter=bandPaddingOuter, + bandWithNestedOffsetPaddingInner=bandWithNestedOffsetPaddingInner, + bandWithNestedOffsetPaddingOuter=bandWithNestedOffsetPaddingOuter, + barBandPaddingInner=barBandPaddingInner, clamp=clamp, + continuousPadding=continuousPadding, maxBandSize=maxBandSize, + maxFontSize=maxFontSize, maxOpacity=maxOpacity, + maxSize=maxSize, maxStrokeWidth=maxStrokeWidth, + minBandSize=minBandSize, minFontSize=minFontSize, + minOpacity=minOpacity, minSize=minSize, + minStrokeWidth=minStrokeWidth, + offsetBandPaddingInner=offsetBandPaddingInner, + offsetBandPaddingOuter=offsetBandPaddingOuter, + pointPadding=pointPadding, quantileCount=quantileCount, + quantizeCount=quantizeCount, + rectBandPaddingInner=rectBandPaddingInner, round=round, + useUnaggregatedDomain=useUnaggregatedDomain, + xReverse=xReverse, **kwds) + + +class ScaleDatumDef(OffsetDef): + """ScaleDatumDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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``. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + scale : anyOf(: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. + title : anyOf(:class:`Text`, 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:`Type` + 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/ScaleDatumDef'} + + def __init__(self, bandPosition=Undefined, datum=Undefined, scale=Undefined, title=Undefined, + type=Undefined, **kwds): + super(ScaleDatumDef, self).__init__(bandPosition=bandPosition, datum=datum, scale=scale, + title=title, type=type, **kwds) + + +class ScaleFieldDef(OffsetDef): + """ScaleFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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 : :class:`Field` + **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``. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/ScaleFieldDef'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, + scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, + **kwds): + super(ScaleFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, + field=field, scale=scale, sort=sort, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class ScaleInterpolateEnum(VegaLiteSchema): + """ScaleInterpolateEnum schema wrapper + + enum('rgb', 'lab', 'hcl', 'hsl', 'hsl-long', 'hcl-long', 'cubehelix', 'cubehelix-long') + """ + _schema = {'$ref': '#/definitions/ScaleInterpolateEnum'} + + def __init__(self, *args): + super(ScaleInterpolateEnum, self).__init__(*args) + + +class ScaleInterpolateParams(VegaLiteSchema): + """ScaleInterpolateParams schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('rgb', 'cubehelix', 'cubehelix-long') + + gamma : float + + """ + _schema = {'$ref': '#/definitions/ScaleInterpolateParams'} + + def __init__(self, type=Undefined, gamma=Undefined, **kwds): + super(ScaleInterpolateParams, self).__init__(type=type, gamma=gamma, **kwds) + + +class ScaleResolveMap(VegaLiteSchema): + """ScaleResolveMap schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + angle : :class:`ResolveMode` + + color : :class:`ResolveMode` + + fill : :class:`ResolveMode` + + fillOpacity : :class:`ResolveMode` + + opacity : :class:`ResolveMode` + + radius : :class:`ResolveMode` + + shape : :class:`ResolveMode` + + size : :class:`ResolveMode` + + stroke : :class:`ResolveMode` + + strokeDash : :class:`ResolveMode` + + strokeOpacity : :class:`ResolveMode` + + strokeWidth : :class:`ResolveMode` + + theta : :class:`ResolveMode` + + x : :class:`ResolveMode` + + xOffset : :class:`ResolveMode` + + y : :class:`ResolveMode` + + yOffset : :class:`ResolveMode` + + """ + _schema = {'$ref': '#/definitions/ScaleResolveMap'} + + def __init__(self, angle=Undefined, color=Undefined, fill=Undefined, fillOpacity=Undefined, + opacity=Undefined, radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, + strokeDash=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, theta=Undefined, + x=Undefined, xOffset=Undefined, y=Undefined, yOffset=Undefined, **kwds): + super(ScaleResolveMap, self).__init__(angle=angle, color=color, fill=fill, + fillOpacity=fillOpacity, opacity=opacity, radius=radius, + shape=shape, size=size, stroke=stroke, + strokeDash=strokeDash, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, theta=theta, x=x, + xOffset=xOffset, y=y, yOffset=yOffset, **kwds) + + +class ScaleType(VegaLiteSchema): + """ScaleType schema wrapper + + enum('linear', 'log', 'pow', 'sqrt', 'symlog', 'identity', 'sequential', 'time', 'utc', + 'quantile', 'quantize', 'threshold', 'bin-ordinal', 'ordinal', 'point', 'band') + """ + _schema = {'$ref': '#/definitions/ScaleType'} + + def __init__(self, *args): + super(ScaleType, self).__init__(*args) + + +class SchemeParams(VegaLiteSchema): + """SchemeParams schema wrapper + + Mapping(required=[name]) + + Attributes + ---------- + + name : string + A color scheme name for ordinal scales (e.g., ``"category10"`` or ``"blues"`` ). + + For the full list of supported schemes, please refer to the `Vega Scheme + `__ reference. + count : float + The number of colors to use in the scheme. This can be useful for scale types such + as ``"quantize"``, which use the length of the scale range to determine the number + of discrete bins for the scale domain. + extent : List(float) + The extent of the color range to use. For example ``[0.2, 1]`` will rescale the + color scheme such that color values in the range *[0, 0.2)* are excluded from the + scheme. + """ + _schema = {'$ref': '#/definitions/SchemeParams'} + + def __init__(self, name=Undefined, count=Undefined, extent=Undefined, **kwds): + super(SchemeParams, self).__init__(name=name, count=count, extent=extent, **kwds) + + +class SecondaryFieldDef(Position2Def): + """SecondaryFieldDef schema wrapper + + Mapping(required=[]) + A field definition of a secondary channel that shares a scale with another primary channel. + For example, ``x2``, ``xError`` and ``xError2`` share the same scale with ``x``. + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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. + """ + _schema = {'$ref': '#/definitions/SecondaryFieldDef'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(SecondaryFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class SelectionConfig(VegaLiteSchema): + """SelectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + interval : :class:`IntervalSelectionConfigWithoutType` + The default definition for an `interval + `__ selection. All + properties and transformations for an interval selection definition (except ``type`` + ) may be specified here. + + For instance, setting ``interval`` to ``{"translate": false}`` disables the ability + to move interval selections by default. + point : :class:`PointSelectionConfigWithoutType` + The default definition for a `point + `__ selection. All + properties and transformations for a point selection definition (except ``type`` ) + may be specified here. + + For instance, setting ``point`` to ``{"on": "dblclick"}`` populates point selections + on double-click by default. + """ + _schema = {'$ref': '#/definitions/SelectionConfig'} + + def __init__(self, interval=Undefined, point=Undefined, **kwds): + super(SelectionConfig, self).__init__(interval=interval, point=point, **kwds) + + +class SelectionInit(VegaLiteSchema): + """SelectionInit schema wrapper + + anyOf(:class:`PrimitiveValue`, :class:`DateTime`) + """ + _schema = {'$ref': '#/definitions/SelectionInit'} + + def __init__(self, *args, **kwds): + super(SelectionInit, self).__init__(*args, **kwds) + + +class DateTime(SelectionInit): + """DateTime schema wrapper + + Mapping(required=[]) + Object for defining datetime in Vega-Lite Filter. If both month and quarter are provided, + month has higher precedence. ``day`` cannot be combined with other date. We accept string + for month and day names. + + Attributes + ---------- + + date : float + Integer value representing the date (day of the month) from 1-31. + day : anyOf(:class:`Day`, string) + Value representing the day of a week. This can be one of: (1) integer value -- ``1`` + represents Monday; (2) case-insensitive day name (e.g., ``"Monday"`` ); (3) + case-insensitive, 3-character short day name (e.g., ``"Mon"`` ). + + **Warning:** A DateTime definition object with ``day`` ** should not be combined + with ``year``, ``quarter``, ``month``, or ``date``. + hours : float + Integer value representing the hour of a day from 0-23. + milliseconds : float + Integer value representing the millisecond segment of time. + minutes : float + Integer value representing the minute segment of time from 0-59. + month : anyOf(:class:`Month`, string) + One of: (1) integer value representing the month from ``1`` - ``12``. ``1`` + represents January; (2) case-insensitive month name (e.g., ``"January"`` ); (3) + case-insensitive, 3-character short month name (e.g., ``"Jan"`` ). + quarter : float + Integer value representing the quarter of the year (from 1-4). + seconds : float + Integer value representing the second segment (0-59) of a time value + utc : boolean + A boolean flag indicating if date time is in utc time. If false, the date time is in + local time + year : float + Integer value representing the year. + """ + _schema = {'$ref': '#/definitions/DateTime'} + + def __init__(self, date=Undefined, day=Undefined, hours=Undefined, milliseconds=Undefined, + minutes=Undefined, month=Undefined, quarter=Undefined, seconds=Undefined, + utc=Undefined, year=Undefined, **kwds): + super(DateTime, self).__init__(date=date, day=day, hours=hours, milliseconds=milliseconds, + minutes=minutes, month=month, quarter=quarter, seconds=seconds, + utc=utc, year=year, **kwds) + + +class PrimitiveValue(SelectionInit): + """PrimitiveValue schema wrapper + + anyOf(float, string, boolean, None) + """ + _schema = {'$ref': '#/definitions/PrimitiveValue'} + + def __init__(self, *args): + super(PrimitiveValue, self).__init__(*args) + + +class SelectionInitInterval(VegaLiteSchema): + """SelectionInitInterval schema wrapper + + anyOf(:class:`Vector2boolean`, :class:`Vector2number`, :class:`Vector2string`, + :class:`Vector2DateTime`) + """ + _schema = {'$ref': '#/definitions/SelectionInitInterval'} + + def __init__(self, *args, **kwds): + super(SelectionInitInterval, self).__init__(*args, **kwds) + + +class SelectionInitIntervalMapping(VegaLiteSchema): + """SelectionInitIntervalMapping schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/SelectionInitIntervalMapping'} + + def __init__(self, **kwds): + super(SelectionInitIntervalMapping, self).__init__(**kwds) + + +class SelectionInitMapping(VegaLiteSchema): + """SelectionInitMapping schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/SelectionInitMapping'} + + def __init__(self, **kwds): + super(SelectionInitMapping, self).__init__(**kwds) + + +class SelectionParameter(VegaLiteSchema): + """SelectionParameter schema wrapper + + Mapping(required=[name, select]) + + Attributes + ---------- + + name : :class:`ParameterName` + Required. A unique name for the selection parameter. Selection names should be valid + JavaScript identifiers: they should contain only alphanumeric characters (or "$", or + "_") and may not start with a digit. Reserved keywords that may not be used as + parameter names are "datum", "event", "item", and "parent". + select : anyOf(:class:`SelectionType`, :class:`PointSelectionConfig`, + :class:`IntervalSelectionConfig`) + Determines the default event processing and data query for the selection. Vega-Lite + currently supports two selection types: + + + * ``"point"`` -- to select multiple discrete data values; the first value is + selected on ``click`` and additional values toggled on shift-click. + * ``"interval"`` -- to select a continuous range of data values on ``drag``. + bind : anyOf(:class:`Binding`, Mapping(required=[]), :class:`LegendBinding`, string) + When set, a selection is populated by input elements (also known as dynamic query + widgets) or by interacting with the corresponding legend. Direct manipulation + interaction is disabled by default; to re-enable it, set the selection's `on + `__ + property. + + Legend bindings are restricted to selections that only specify a single field or + encoding. + + Query widget binding takes the form of Vega's `input element binding definition + `__ or can be a mapping between + projected field/encodings and binding definitions. + + **See also:** `bind `__ + documentation. + value : anyOf(:class:`SelectionInit`, List(:class:`SelectionInitMapping`), + :class:`SelectionInitIntervalMapping`) + Initialize the selection with a mapping between `projected channels or field names + `__ and initial + values. + + **See also:** `init `__ + documentation. + """ + _schema = {'$ref': '#/definitions/SelectionParameter'} + + def __init__(self, name=Undefined, select=Undefined, bind=Undefined, value=Undefined, **kwds): + super(SelectionParameter, self).__init__(name=name, select=select, bind=bind, value=value, + **kwds) + + +class SelectionResolution(VegaLiteSchema): + """SelectionResolution schema wrapper + + enum('global', 'union', 'intersect') + """ + _schema = {'$ref': '#/definitions/SelectionResolution'} + + def __init__(self, *args): + super(SelectionResolution, self).__init__(*args) + + +class SelectionType(VegaLiteSchema): + """SelectionType schema wrapper + + enum('point', 'interval') + """ + _schema = {'$ref': '#/definitions/SelectionType'} + + def __init__(self, *args): + super(SelectionType, self).__init__(*args) + + +class SequenceGenerator(Generator): + """SequenceGenerator schema wrapper + + Mapping(required=[sequence]) + + Attributes + ---------- + + sequence : :class:`SequenceParams` + Generate a sequence of numbers. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/SequenceGenerator'} + + def __init__(self, sequence=Undefined, name=Undefined, **kwds): + super(SequenceGenerator, self).__init__(sequence=sequence, name=name, **kwds) + + +class SequenceParams(VegaLiteSchema): + """SequenceParams schema wrapper + + Mapping(required=[start, stop]) + + Attributes + ---------- + + start : float + The starting value of the sequence (inclusive). + stop : float + The ending value of the sequence (exclusive). + step : float + The step value between sequence entries. + + **Default value:** ``1`` + as : :class:`FieldName` + The name of the generated sequence field. + + **Default value:** ``"data"`` + """ + _schema = {'$ref': '#/definitions/SequenceParams'} + + def __init__(self, start=Undefined, stop=Undefined, step=Undefined, **kwds): + super(SequenceParams, self).__init__(start=start, stop=stop, step=step, **kwds) + + +class SequentialMultiHue(ColorScheme): + """SequentialMultiHue schema wrapper + + enum('turbo', 'viridis', 'inferno', 'magma', 'plasma', 'cividis', 'bluegreen', + 'bluegreen-3', 'bluegreen-4', 'bluegreen-5', 'bluegreen-6', 'bluegreen-7', 'bluegreen-8', + 'bluegreen-9', 'bluepurple', 'bluepurple-3', 'bluepurple-4', 'bluepurple-5', 'bluepurple-6', + 'bluepurple-7', 'bluepurple-8', 'bluepurple-9', 'goldgreen', 'goldgreen-3', 'goldgreen-4', + 'goldgreen-5', 'goldgreen-6', 'goldgreen-7', 'goldgreen-8', 'goldgreen-9', 'goldorange', + 'goldorange-3', 'goldorange-4', 'goldorange-5', 'goldorange-6', 'goldorange-7', + 'goldorange-8', 'goldorange-9', 'goldred', 'goldred-3', 'goldred-4', 'goldred-5', + 'goldred-6', 'goldred-7', 'goldred-8', 'goldred-9', 'greenblue', 'greenblue-3', + 'greenblue-4', 'greenblue-5', 'greenblue-6', 'greenblue-7', 'greenblue-8', 'greenblue-9', + 'orangered', 'orangered-3', 'orangered-4', 'orangered-5', 'orangered-6', 'orangered-7', + 'orangered-8', 'orangered-9', 'purplebluegreen', 'purplebluegreen-3', 'purplebluegreen-4', + 'purplebluegreen-5', 'purplebluegreen-6', 'purplebluegreen-7', 'purplebluegreen-8', + 'purplebluegreen-9', 'purpleblue', 'purpleblue-3', 'purpleblue-4', 'purpleblue-5', + 'purpleblue-6', 'purpleblue-7', 'purpleblue-8', 'purpleblue-9', 'purplered', 'purplered-3', + 'purplered-4', 'purplered-5', 'purplered-6', 'purplered-7', 'purplered-8', 'purplered-9', + 'redpurple', 'redpurple-3', 'redpurple-4', 'redpurple-5', 'redpurple-6', 'redpurple-7', + 'redpurple-8', 'redpurple-9', 'yellowgreenblue', 'yellowgreenblue-3', 'yellowgreenblue-4', + 'yellowgreenblue-5', 'yellowgreenblue-6', 'yellowgreenblue-7', 'yellowgreenblue-8', + 'yellowgreenblue-9', 'yellowgreen', 'yellowgreen-3', 'yellowgreen-4', 'yellowgreen-5', + 'yellowgreen-6', 'yellowgreen-7', 'yellowgreen-8', 'yellowgreen-9', 'yelloworangebrown', + 'yelloworangebrown-3', 'yelloworangebrown-4', 'yelloworangebrown-5', 'yelloworangebrown-6', + 'yelloworangebrown-7', 'yelloworangebrown-8', 'yelloworangebrown-9', 'yelloworangered', + 'yelloworangered-3', 'yelloworangered-4', 'yelloworangered-5', 'yelloworangered-6', + 'yelloworangered-7', 'yelloworangered-8', 'yelloworangered-9', 'darkblue', 'darkblue-3', + 'darkblue-4', 'darkblue-5', 'darkblue-6', 'darkblue-7', 'darkblue-8', 'darkblue-9', + 'darkgold', 'darkgold-3', 'darkgold-4', 'darkgold-5', 'darkgold-6', 'darkgold-7', + 'darkgold-8', 'darkgold-9', 'darkgreen', 'darkgreen-3', 'darkgreen-4', 'darkgreen-5', + 'darkgreen-6', 'darkgreen-7', 'darkgreen-8', 'darkgreen-9', 'darkmulti', 'darkmulti-3', + 'darkmulti-4', 'darkmulti-5', 'darkmulti-6', 'darkmulti-7', 'darkmulti-8', 'darkmulti-9', + 'darkred', 'darkred-3', 'darkred-4', 'darkred-5', 'darkred-6', 'darkred-7', 'darkred-8', + 'darkred-9', 'lightgreyred', 'lightgreyred-3', 'lightgreyred-4', 'lightgreyred-5', + 'lightgreyred-6', 'lightgreyred-7', 'lightgreyred-8', 'lightgreyred-9', 'lightgreyteal', + 'lightgreyteal-3', 'lightgreyteal-4', 'lightgreyteal-5', 'lightgreyteal-6', + 'lightgreyteal-7', 'lightgreyteal-8', 'lightgreyteal-9', 'lightmulti', 'lightmulti-3', + 'lightmulti-4', 'lightmulti-5', 'lightmulti-6', 'lightmulti-7', 'lightmulti-8', + 'lightmulti-9', 'lightorange', 'lightorange-3', 'lightorange-4', 'lightorange-5', + 'lightorange-6', 'lightorange-7', 'lightorange-8', 'lightorange-9', 'lighttealblue', + 'lighttealblue-3', 'lighttealblue-4', 'lighttealblue-5', 'lighttealblue-6', + 'lighttealblue-7', 'lighttealblue-8', 'lighttealblue-9') + """ + _schema = {'$ref': '#/definitions/SequentialMultiHue'} + + def __init__(self, *args): + super(SequentialMultiHue, self).__init__(*args) + + +class SequentialSingleHue(ColorScheme): + """SequentialSingleHue schema wrapper + + enum('blues', 'tealblues', 'teals', 'greens', 'browns', 'greys', 'purples', 'warmgreys', + 'reds', 'oranges') + """ + _schema = {'$ref': '#/definitions/SequentialSingleHue'} + + def __init__(self, *args): + super(SequentialSingleHue, self).__init__(*args) + + +class ShapeDef(VegaLiteSchema): + """ShapeDef schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, + :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`) + """ + _schema = {'$ref': '#/definitions/ShapeDef'} + + def __init__(self, *args, **kwds): + super(ShapeDef, self).__init__(*args, **kwds) + + +class FieldOrDatumDefWithConditionDatumDefstringnull(MarkPropDefstringnullTypeForShape, ShapeDef): + """FieldOrDatumDefWithConditionDatumDefstringnull schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + title : anyOf(:class:`Text`, 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:`Type` + 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/FieldOrDatumDefWithCondition'} + + def __init__(self, bandPosition=Undefined, condition=Undefined, datum=Undefined, title=Undefined, + type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefstringnull, self).__init__(bandPosition=bandPosition, + condition=condition, + datum=datum, title=title, + type=type, **kwds) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPropDefstringnullTypeForShape, ShapeDef): + """FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :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. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + scale : anyOf(: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 : :class:`Sort` + 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 : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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:`TypeForShape` + 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/FieldOrDatumDefWithCondition,(string|null)>'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull, self).__init__(aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + type=type, + **kwds) + + +class SharedEncoding(VegaLiteSchema): + """SharedEncoding schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + angle : Mapping(required=[]) + + color : Mapping(required=[]) + + description : Mapping(required=[]) + + detail : anyOf(:class:`FieldDefWithoutScale`, List(:class:`FieldDefWithoutScale`)) + Additional levels of detail for grouping data in aggregate views and in line, trail, + and area marks without mapping data to a specific visual channel. + fill : Mapping(required=[]) + + fillOpacity : Mapping(required=[]) + + href : Mapping(required=[]) + + key : Mapping(required=[]) + + latitude : Mapping(required=[]) + + latitude2 : Mapping(required=[]) + + longitude : Mapping(required=[]) + + longitude2 : Mapping(required=[]) + + opacity : Mapping(required=[]) + + order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`OrderValueDef`) + Order of the marks. + + + * For stacked marks, this ``order`` channel encodes `stack order + `__. + * For line and trail marks, this ``order`` channel encodes order of data points in + the lines. This can be useful for creating `a connected scatterplot + `__. Setting + ``order`` to ``{"value": null}`` makes the line marks use the original order in + the data sources. + * Otherwise, this ``order`` channel encodes layer order of the marks. + + **Note** : In aggregate plots, ``order`` field should be ``aggregate`` d to avoid + creating additional aggregation grouping. + radius : Mapping(required=[]) + + radius2 : Mapping(required=[]) + + shape : Mapping(required=[]) + + size : Mapping(required=[]) + + stroke : Mapping(required=[]) + + strokeDash : Mapping(required=[]) + + strokeOpacity : Mapping(required=[]) + + strokeWidth : Mapping(required=[]) + + text : Mapping(required=[]) + + theta : Mapping(required=[]) + + theta2 : Mapping(required=[]) + + tooltip : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`, + List(:class:`StringFieldDef`), None) + The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides + `the tooltip property in the mark definition + `__. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + url : Mapping(required=[]) + + x : Mapping(required=[]) + + x2 : Mapping(required=[]) + + xError : Mapping(required=[]) + + xError2 : Mapping(required=[]) + + xOffset : Mapping(required=[]) + + y : Mapping(required=[]) + + y2 : Mapping(required=[]) + + yError : Mapping(required=[]) + + yError2 : Mapping(required=[]) + + yOffset : Mapping(required=[]) + + """ + _schema = {'$ref': '#/definitions/SharedEncoding'} + + def __init__(self, angle=Undefined, color=Undefined, description=Undefined, detail=Undefined, + fill=Undefined, fillOpacity=Undefined, href=Undefined, key=Undefined, + latitude=Undefined, latitude2=Undefined, longitude=Undefined, longitude2=Undefined, + opacity=Undefined, order=Undefined, radius=Undefined, radius2=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeDash=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, text=Undefined, theta=Undefined, + theta2=Undefined, tooltip=Undefined, url=Undefined, x=Undefined, x2=Undefined, + xError=Undefined, xError2=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, + yError=Undefined, yError2=Undefined, yOffset=Undefined, **kwds): + super(SharedEncoding, self).__init__(angle=angle, color=color, description=description, + detail=detail, fill=fill, fillOpacity=fillOpacity, + href=href, key=key, latitude=latitude, latitude2=latitude2, + longitude=longitude, longitude2=longitude2, + opacity=opacity, order=order, radius=radius, + radius2=radius2, shape=shape, size=size, stroke=stroke, + strokeDash=strokeDash, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, text=text, theta=theta, + theta2=theta2, tooltip=tooltip, url=url, x=x, x2=x2, + xError=xError, xError2=xError2, xOffset=xOffset, y=y, + y2=y2, yError=yError, yError2=yError2, yOffset=yOffset, + **kwds) + + +class SingleDefUnitChannel(VegaLiteSchema): + """SingleDefUnitChannel schema wrapper + + enum('x', 'y', 'xOffset', 'yOffset', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', + 'latitude2', 'theta', 'theta2', 'radius', 'radius2', 'color', 'fill', 'stroke', 'opacity', + 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', 'size', 'angle', 'shape', + 'key', 'text', 'href', 'url', 'description') + """ + _schema = {'$ref': '#/definitions/SingleDefUnitChannel'} + + def __init__(self, *args): + super(SingleDefUnitChannel, self).__init__(*args) + + +class Sort(VegaLiteSchema): + """Sort schema wrapper + + anyOf(:class:`SortArray`, :class:`AllSortString`, :class:`EncodingSortField`, + :class:`SortByEncoding`, None) + """ + _schema = {'$ref': '#/definitions/Sort'} + + def __init__(self, *args, **kwds): + super(Sort, self).__init__(*args, **kwds) + + +class AllSortString(Sort): + """AllSortString schema wrapper + + anyOf(:class:`SortOrder`, :class:`SortByChannel`, :class:`SortByChannelDesc`) + """ + _schema = {'$ref': '#/definitions/AllSortString'} + + def __init__(self, *args, **kwds): + super(AllSortString, self).__init__(*args, **kwds) + + +class EncodingSortField(Sort): + """EncodingSortField schema wrapper + + Mapping(required=[]) + A sort definition for sorting a discrete scale in an encoding field definition. + + Attributes + ---------- + + field : :class:`Field` + The data `field `__ to sort by. + + **Default value:** If unspecified, defaults to the field specified in the outer data + reference. + op : :class:`NonArgAggregateOp` + An `aggregate operation + `__ to perform on the + field prior to sorting (e.g., ``"count"``, ``"mean"`` and ``"median"`` ). An + aggregation is required when there are multiple values of the sort field for each + encoded data field. The input data objects will be aggregated, grouped by the + encoded data field. + + For a full list of operations, please see the documentation for `aggregate + `__. + + **Default value:** ``"sum"`` for stacked plots. Otherwise, ``"min"``. + order : anyOf(:class:`SortOrder`, None) + The sort order. One of ``"ascending"`` (default), ``"descending"``, or ``null`` (no + not sort). + """ + _schema = {'$ref': '#/definitions/EncodingSortField'} + + def __init__(self, field=Undefined, op=Undefined, order=Undefined, **kwds): + super(EncodingSortField, self).__init__(field=field, op=op, order=order, **kwds) + + +class SortArray(Sort): + """SortArray schema wrapper + + anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`)) + """ + _schema = {'$ref': '#/definitions/SortArray'} + + def __init__(self, *args, **kwds): + super(SortArray, self).__init__(*args, **kwds) + + +class SortByChannel(AllSortString): + """SortByChannel schema wrapper + + enum('x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', + 'strokeOpacity', 'opacity', 'text') + """ + _schema = {'$ref': '#/definitions/SortByChannel'} + + def __init__(self, *args): + super(SortByChannel, self).__init__(*args) + + +class SortByChannelDesc(AllSortString): + """SortByChannelDesc schema wrapper + + enum('-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', + '-fillOpacity', '-strokeOpacity', '-opacity', '-text') + """ + _schema = {'$ref': '#/definitions/SortByChannelDesc'} + + def __init__(self, *args): + super(SortByChannelDesc, self).__init__(*args) + + +class SortByEncoding(Sort): + """SortByEncoding schema wrapper + + Mapping(required=[encoding]) + + Attributes + ---------- + + encoding : :class:`SortByChannel` + The `encoding channel + `__ to sort by (e.g., + ``"x"``, ``"y"`` ) + order : anyOf(:class:`SortOrder`, None) + The sort order. One of ``"ascending"`` (default), ``"descending"``, or ``null`` (no + not sort). + """ + _schema = {'$ref': '#/definitions/SortByEncoding'} + + def __init__(self, encoding=Undefined, order=Undefined, **kwds): + super(SortByEncoding, self).__init__(encoding=encoding, order=order, **kwds) + + +class SortField(VegaLiteSchema): + """SortField schema wrapper + + Mapping(required=[field]) + A sort definition for transform + + Attributes + ---------- + + field : :class:`FieldName` + The name of the field to sort. + order : anyOf(:class:`SortOrder`, None) + Whether to sort the field in ascending or descending order. One of ``"ascending"`` + (default), ``"descending"``, or ``null`` (no not sort). + """ + _schema = {'$ref': '#/definitions/SortField'} + + def __init__(self, field=Undefined, order=Undefined, **kwds): + super(SortField, self).__init__(field=field, order=order, **kwds) + + +class SortOrder(AllSortString): + """SortOrder schema wrapper + + enum('ascending', 'descending') + """ + _schema = {'$ref': '#/definitions/SortOrder'} + + def __init__(self, *args): + super(SortOrder, self).__init__(*args) + + +class Spec(VegaLiteSchema): + """Spec schema wrapper + + anyOf(:class:`FacetedUnitSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetSpec`, + :class:`ConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`, + :class:`HConcatSpecGenericSpec`) + Any specification in Vega-Lite. + """ + _schema = {'$ref': '#/definitions/Spec'} + + def __init__(self, *args, **kwds): + super(Spec, self).__init__(*args, **kwds) + + +class ConcatSpecGenericSpec(Spec, NonNormalizedSpec): + """ConcatSpecGenericSpec schema wrapper + + Mapping(required=[concat]) + Base interface for a generalized concatenation specification. + + Attributes + ---------- + + concat : List(:class:`Spec`) + A list of views to be concatenated. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + The spacing in pixels between sub-views of the composition operator. An object of + the form ``{"row": number, "column": number}`` can be used to set different spacing + values for rows and columns. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/ConcatSpec'} + + def __init__(self, concat=Undefined, align=Undefined, bounds=Undefined, center=Undefined, + columns=Undefined, data=Undefined, description=Undefined, name=Undefined, + resolve=Undefined, spacing=Undefined, title=Undefined, transform=Undefined, **kwds): + super(ConcatSpecGenericSpec, self).__init__(concat=concat, align=align, bounds=bounds, + center=center, columns=columns, data=data, + description=description, name=name, resolve=resolve, + spacing=spacing, title=title, transform=transform, + **kwds) + + +class FacetSpec(Spec, NonNormalizedSpec): + """FacetSpec schema wrapper + + Mapping(required=[facet, spec]) + Base interface for a facet specification. + + Attributes + ---------- + + facet : anyOf(:class:`FacetFieldDef`, :class:`FacetMapping`) + Definition for how to facet the data. One of: 1) `a field definition for faceting + the plot by one field + `__ 2) `An object that + maps row and column channels to their field definitions + `__ + spec : anyOf(:class:`LayerSpec`, :class:`FacetedUnitSpec`) + A specification of the view that gets faceted. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + The spacing in pixels between sub-views of the composition operator. An object of + the form ``{"row": number, "column": number}`` can be used to set different spacing + values for rows and columns. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/FacetSpec'} + + def __init__(self, facet=Undefined, spec=Undefined, align=Undefined, bounds=Undefined, + center=Undefined, columns=Undefined, data=Undefined, description=Undefined, + name=Undefined, resolve=Undefined, spacing=Undefined, title=Undefined, + transform=Undefined, **kwds): + super(FacetSpec, self).__init__(facet=facet, spec=spec, align=align, bounds=bounds, + center=center, columns=columns, data=data, + description=description, name=name, resolve=resolve, + spacing=spacing, title=title, transform=transform, **kwds) + + +class FacetedUnitSpec(Spec, NonNormalizedSpec): + """FacetedUnitSpec schema wrapper + + Mapping(required=[mark]) + Unit spec that can have a composite mark and row or column channels (shorthand for a facet + spec). + + Attributes + ---------- + + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and + ``"text"`` ) or a `mark definition object + `__. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + encoding : :class:`FacetedEncoding` + A key-value mapping between encoding channels and definition of fields. + height : anyOf(float, string, :class:`Step`) + The height of a visualization. + + + * For a plot with a continuous y-field, height should be a number. + * For a plot with either a discrete y-field or no y-field, height can be either a + number indicating a fixed height or an object in the form of ``{step: number}`` + defining the height per discrete step. (No y-field is equivalent to having one + discrete step.) + * To enable responsive sizing on height, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. + + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + params : List(anyOf(:class:`VariableParameter`, :class:`SelectionParameter`)) + An array of parameters that may either be simple variables, or more complex + selections that map user input to data queries. + projection : :class:`Projection` + An object defining properties of geographic projection, which will be applied to + ``shape`` path for ``"geoshape"`` marks and to ``latitude`` and ``"longitude"`` + channels for other marks. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + The spacing in pixels between sub-views of the composition operator. An object of + the form ``{"row": number, "column": number}`` can be used to set different spacing + values for rows and columns. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. + + + * For a plot with a continuous x-field, width should be a number. + * For a plot with either a discrete x-field or no x-field, width can be either a + number indicating a fixed width or an object in the form of ``{step: number}`` + defining the width per discrete step. (No x-field is equivalent to having one + discrete step.) + * To enable responsive sizing on width, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. + + **See also:** `width `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FacetedUnitSpec'} + + def __init__(self, mark=Undefined, align=Undefined, bounds=Undefined, center=Undefined, + data=Undefined, description=Undefined, encoding=Undefined, height=Undefined, + name=Undefined, params=Undefined, projection=Undefined, resolve=Undefined, + spacing=Undefined, title=Undefined, transform=Undefined, view=Undefined, + width=Undefined, **kwds): + super(FacetedUnitSpec, self).__init__(mark=mark, align=align, bounds=bounds, center=center, + data=data, description=description, encoding=encoding, + height=height, name=name, params=params, + projection=projection, resolve=resolve, spacing=spacing, + title=title, transform=transform, view=view, width=width, + **kwds) + + +class HConcatSpecGenericSpec(Spec, NonNormalizedSpec): + """HConcatSpecGenericSpec schema wrapper + + Mapping(required=[hconcat]) + Base interface for a horizontal concatenation specification. + + Attributes + ---------- + + hconcat : List(:class:`Spec`) + A list of views to be concatenated and put into a row. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : float + The spacing in pixels between sub-views of the concat operator. + + **Default value** : ``10`` + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/HConcatSpec'} + + def __init__(self, hconcat=Undefined, bounds=Undefined, center=Undefined, data=Undefined, + description=Undefined, name=Undefined, resolve=Undefined, spacing=Undefined, + title=Undefined, transform=Undefined, **kwds): + super(HConcatSpecGenericSpec, self).__init__(hconcat=hconcat, bounds=bounds, center=center, + data=data, description=description, name=name, + resolve=resolve, spacing=spacing, title=title, + transform=transform, **kwds) + + +class LayerSpec(Spec, NonNormalizedSpec): + """LayerSpec schema wrapper + + Mapping(required=[layer]) + A full layered plot specification, which may contains ``encoding`` and ``projection`` + properties that will be applied to underlying unit (single-view) specifications. + + Attributes + ---------- + + layer : List(anyOf(:class:`LayerSpec`, :class:`UnitSpec`)) + Layer or single view specifications to be layered. + + **Note** : Specifications inside ``layer`` cannot use ``row`` and ``column`` + channels as layering facet specifications is not allowed. Instead, use the `facet + operator `__ and place a layer + inside a facet. + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + encoding : :class:`SharedEncoding` + A shared key-value mapping between encoding channels and definition of fields in the + underlying layers. + height : anyOf(float, string, :class:`Step`) + The height of a visualization. + + + * For a plot with a continuous y-field, height should be a number. + * For a plot with either a discrete y-field or no y-field, height can be either a + number indicating a fixed height or an object in the form of ``{step: number}`` + defining the height per discrete step. (No y-field is equivalent to having one + discrete step.) + * To enable responsive sizing on height, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. + + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + projection : :class:`Projection` + An object defining properties of the geographic projection shared by underlying + layers. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. + + + * For a plot with a continuous x-field, width should be a number. + * For a plot with either a discrete x-field or no x-field, width can be either a + number indicating a fixed width or an object in the form of ``{step: number}`` + defining the width per discrete step. (No x-field is equivalent to having one + discrete step.) + * To enable responsive sizing on width, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. + + **See also:** `width `__ + documentation. + """ + _schema = {'$ref': '#/definitions/LayerSpec'} + + def __init__(self, layer=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, projection=Undefined, resolve=Undefined, + title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds): + super(LayerSpec, self).__init__(layer=layer, data=data, description=description, + encoding=encoding, height=height, name=name, + projection=projection, resolve=resolve, title=title, + transform=transform, view=view, width=width, **kwds) + + +class RepeatSpec(Spec, NonNormalizedSpec): + """RepeatSpec schema wrapper + + anyOf(:class:`NonLayerRepeatSpec`, :class:`LayerRepeatSpec`) + """ + _schema = {'$ref': '#/definitions/RepeatSpec'} + + def __init__(self, *args, **kwds): + super(RepeatSpec, self).__init__(*args, **kwds) + + +class LayerRepeatSpec(RepeatSpec): + """LayerRepeatSpec schema wrapper + + Mapping(required=[repeat, spec]) + + Attributes + ---------- + + repeat : :class:`LayerRepeatMapping` + Definition for fields to be repeated. One of: 1) An array of fields to be repeated. + If ``"repeat"`` is an array, the field can be referred to as ``{"repeat": + "repeat"}``. The repeated views are laid out in a wrapped row. You can set the + number of columns to control the wrapping. 2) An object that maps ``"row"`` and/or + ``"column"`` to the listed fields to be repeated along the particular orientations. + The objects ``{"repeat": "row"}`` and ``{"repeat": "column"}`` can be used to refer + to the repeated field respectively. + spec : anyOf(:class:`LayerSpec`, :class:`UnitSpec`) + A specification of the view that gets repeated. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + The spacing in pixels between sub-views of the composition operator. An object of + the form ``{"row": number, "column": number}`` can be used to set different spacing + values for rows and columns. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/LayerRepeatSpec'} + + def __init__(self, repeat=Undefined, spec=Undefined, align=Undefined, bounds=Undefined, + center=Undefined, columns=Undefined, data=Undefined, description=Undefined, + name=Undefined, resolve=Undefined, spacing=Undefined, title=Undefined, + transform=Undefined, **kwds): + super(LayerRepeatSpec, self).__init__(repeat=repeat, spec=spec, align=align, bounds=bounds, + center=center, columns=columns, data=data, + description=description, name=name, resolve=resolve, + spacing=spacing, title=title, transform=transform, **kwds) + + +class NonLayerRepeatSpec(RepeatSpec): + """NonLayerRepeatSpec schema wrapper + + Mapping(required=[repeat, spec]) + Base interface for a repeat specification. + + Attributes + ---------- + + repeat : anyOf(List(string), :class:`RepeatMapping`) + Definition for fields to be repeated. One of: 1) An array of fields to be repeated. + If ``"repeat"`` is an array, the field can be referred to as ``{"repeat": + "repeat"}``. The repeated views are laid out in a wrapped row. You can set the + number of columns to control the wrapping. 2) An object that maps ``"row"`` and/or + ``"column"`` to the listed fields to be repeated along the particular orientations. + The objects ``{"repeat": "row"}`` and ``{"repeat": "column"}`` can be used to refer + to the repeated field respectively. + spec : :class:`NonNormalizedSpec` + A specification of the view that gets repeated. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + The spacing in pixels between sub-views of the composition operator. An object of + the form ``{"row": number, "column": number}`` can be used to set different spacing + values for rows and columns. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/NonLayerRepeatSpec'} + + def __init__(self, repeat=Undefined, spec=Undefined, align=Undefined, bounds=Undefined, + center=Undefined, columns=Undefined, data=Undefined, description=Undefined, + name=Undefined, resolve=Undefined, spacing=Undefined, title=Undefined, + transform=Undefined, **kwds): + super(NonLayerRepeatSpec, self).__init__(repeat=repeat, spec=spec, align=align, bounds=bounds, + center=center, columns=columns, data=data, + description=description, name=name, resolve=resolve, + spacing=spacing, title=title, transform=transform, + **kwds) + + +class SphereGenerator(Generator): + """SphereGenerator schema wrapper + + Mapping(required=[sphere]) + + Attributes + ---------- + + sphere : anyOf(boolean, Mapping(required=[])) + Generate sphere GeoJSON data for the full globe. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/SphereGenerator'} + + def __init__(self, sphere=Undefined, name=Undefined, **kwds): + super(SphereGenerator, self).__init__(sphere=sphere, name=name, **kwds) + + +class StackOffset(VegaLiteSchema): + """StackOffset schema wrapper + + enum('zero', 'center', 'normalize') + """ + _schema = {'$ref': '#/definitions/StackOffset'} + + def __init__(self, *args): + super(StackOffset, self).__init__(*args) + + +class StandardType(VegaLiteSchema): + """StandardType schema wrapper + + enum('quantitative', 'ordinal', 'temporal', 'nominal') + """ + _schema = {'$ref': '#/definitions/StandardType'} + + def __init__(self, *args): + super(StandardType, self).__init__(*args) + + +class Step(VegaLiteSchema): + """Step schema wrapper + + Mapping(required=[step]) + + Attributes + ---------- + + step : float + The size (width/height) per discrete step. + for : :class:`StepFor` + Whether to apply the step to position scale or offset scale when there are both + ``x`` and ``xOffset`` or both ``y`` and ``yOffset`` encodings. + """ + _schema = {'$ref': '#/definitions/Step'} + + def __init__(self, step=Undefined, **kwds): + super(Step, self).__init__(step=step, **kwds) + + +class StepFor(VegaLiteSchema): + """StepFor schema wrapper + + enum('position', 'offset') + """ + _schema = {'$ref': '#/definitions/StepFor'} + + def __init__(self, *args): + super(StepFor, self).__init__(*args) + + +class Stream(VegaLiteSchema): + """Stream schema wrapper + + anyOf(:class:`EventStream`, :class:`DerivedStream`, :class:`MergedStream`) + """ + _schema = {'$ref': '#/definitions/Stream'} + + def __init__(self, *args, **kwds): + super(Stream, self).__init__(*args, **kwds) + + +class DerivedStream(Stream): + """DerivedStream schema wrapper + + Mapping(required=[stream]) + + Attributes + ---------- + + stream : :class:`Stream` + + between : List(:class:`Stream`) + + consume : boolean + + debounce : float + + filter : anyOf(:class:`Expr`, List(:class:`Expr`)) + + markname : string + + marktype : :class:`MarkType` + + throttle : float + + """ + _schema = {'$ref': '#/definitions/DerivedStream'} + + def __init__(self, stream=Undefined, between=Undefined, consume=Undefined, debounce=Undefined, + filter=Undefined, markname=Undefined, marktype=Undefined, throttle=Undefined, **kwds): + super(DerivedStream, self).__init__(stream=stream, between=between, consume=consume, + debounce=debounce, filter=filter, markname=markname, + marktype=marktype, throttle=throttle, **kwds) + + +class EventStream(Stream): + """EventStream schema wrapper + + anyOf(Mapping(required=[type]), Mapping(required=[source, type])) + """ + _schema = {'$ref': '#/definitions/EventStream'} + + def __init__(self, *args, **kwds): + super(EventStream, self).__init__(*args, **kwds) + + +class MergedStream(Stream): + """MergedStream schema wrapper + + Mapping(required=[merge]) + + Attributes + ---------- + + merge : List(:class:`Stream`) + + between : List(:class:`Stream`) + + consume : boolean + + debounce : float + + filter : anyOf(:class:`Expr`, List(:class:`Expr`)) + + markname : string + + marktype : :class:`MarkType` + + throttle : float + + """ + _schema = {'$ref': '#/definitions/MergedStream'} + + def __init__(self, merge=Undefined, between=Undefined, consume=Undefined, debounce=Undefined, + filter=Undefined, markname=Undefined, marktype=Undefined, throttle=Undefined, **kwds): + super(MergedStream, self).__init__(merge=merge, between=between, consume=consume, + debounce=debounce, filter=filter, markname=markname, + marktype=marktype, throttle=throttle, **kwds) + + +class StringFieldDef(VegaLiteSchema): + """StringFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/StringFieldDef'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, + format=Undefined, formatType=Undefined, timeUnit=Undefined, title=Undefined, + type=Undefined, **kwds): + super(StringFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, + field=field, format=format, formatType=formatType, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StringFieldDefWithCondition(VegaLiteSchema): + """StringFieldDefWithCondition schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/StringFieldDefWithCondition'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(StringFieldDefWithCondition, self).__init__(aggregate=aggregate, + bandPosition=bandPosition, bin=bin, + condition=condition, field=field, + format=format, formatType=formatType, + timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class StringValueDefWithCondition(VegaLiteSchema): + """StringValueDefWithCondition schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/StringValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(StringValueDefWithCondition, self).__init__(condition=condition, value=value, **kwds) + + +class StrokeCap(VegaLiteSchema): + """StrokeCap schema wrapper + + enum('butt', 'round', 'square') + """ + _schema = {'$ref': '#/definitions/StrokeCap'} + + def __init__(self, *args): + super(StrokeCap, self).__init__(*args) + + +class StrokeJoin(VegaLiteSchema): + """StrokeJoin schema wrapper + + enum('miter', 'round', 'bevel') + """ + _schema = {'$ref': '#/definitions/StrokeJoin'} + + def __init__(self, *args): + super(StrokeJoin, self).__init__(*args) + + +class StyleConfigIndex(VegaLiteSchema): + """StyleConfigIndex schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + arc : :class:`RectConfig` + Arc-specific Config + area : :class:`AreaConfig` + Area-Specific Config + bar : :class:`BarConfig` + Bar-Specific Config + circle : :class:`MarkConfig` + Circle-Specific Config + geoshape : :class:`MarkConfig` + Geoshape-Specific Config + image : :class:`RectConfig` + Image-specific Config + line : :class:`LineConfig` + Line-Specific Config + mark : :class:`MarkConfig` + Mark Config + point : :class:`MarkConfig` + Point-Specific Config + rect : :class:`RectConfig` + Rect-Specific Config + rule : :class:`MarkConfig` + Rule-Specific Config + square : :class:`MarkConfig` + Square-Specific Config + text : :class:`MarkConfig` + Text-Specific Config + tick : :class:`TickConfig` + Tick-Specific Config + trail : :class:`LineConfig` + Trail-Specific Config + group-subtitle : :class:`MarkConfig` + Default style for chart subtitles + group-title : :class:`MarkConfig` + Default style for chart titles + guide-label : :class:`MarkConfig` + Default style for axis, legend, and header labels. + guide-title : :class:`MarkConfig` + Default style for axis, legend, and header titles. + """ + _schema = {'$ref': '#/definitions/StyleConfigIndex'} + + def __init__(self, arc=Undefined, area=Undefined, bar=Undefined, circle=Undefined, + geoshape=Undefined, image=Undefined, line=Undefined, mark=Undefined, point=Undefined, + rect=Undefined, rule=Undefined, square=Undefined, text=Undefined, tick=Undefined, + trail=Undefined, **kwds): + super(StyleConfigIndex, self).__init__(arc=arc, area=area, bar=bar, circle=circle, + geoshape=geoshape, image=image, line=line, mark=mark, + point=point, rect=rect, rule=rule, square=square, + text=text, tick=tick, trail=trail, **kwds) + + +class SymbolShape(VegaLiteSchema): + """SymbolShape schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/SymbolShape'} + + def __init__(self, *args): + super(SymbolShape, self).__init__(*args) + + +class Text(VegaLiteSchema): + """Text schema wrapper + + anyOf(string, List(string)) + """ + _schema = {'$ref': '#/definitions/Text'} + + def __init__(self, *args, **kwds): + super(Text, self).__init__(*args, **kwds) + + +class TextBaseline(VegaLiteSchema): + """TextBaseline schema wrapper + + anyOf(string, :class:`Baseline`, string, string) + """ + _schema = {'$ref': '#/definitions/TextBaseline'} + + def __init__(self, *args, **kwds): + super(TextBaseline, self).__init__(*args, **kwds) + + +class Baseline(TextBaseline): + """Baseline schema wrapper + + enum('top', 'middle', 'bottom') + """ + _schema = {'$ref': '#/definitions/Baseline'} + + def __init__(self, *args): + super(Baseline, self).__init__(*args) + + +class TextDef(VegaLiteSchema): + """TextDef schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionStringFieldDefText`, + :class:`FieldOrDatumDefWithConditionStringDatumDefText`, + :class:`ValueDefWithConditionStringFieldDefText`) + """ + _schema = {'$ref': '#/definitions/TextDef'} + + def __init__(self, *args, **kwds): + super(TextDef, self).__init__(*args, **kwds) + + +class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): + """FieldOrDatumDefWithConditionStringDatumDefText schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + 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``. + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + title : anyOf(:class:`Text`, 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:`Type` + 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/FieldOrDatumDefWithCondition'} + + def __init__(self, bandPosition=Undefined, condition=Undefined, datum=Undefined, format=Undefined, + formatType=Undefined, title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionStringDatumDefText, self).__init__(bandPosition=bandPosition, + condition=condition, + datum=datum, format=format, + formatType=formatType, + title=title, type=type, + **kwds) + + +class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): + """FieldOrDatumDefWithConditionStringFieldDefText schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: ..., + ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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. + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) + One or more value definition(s) with `a parameter or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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``. + format : anyOf(string, :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. + + + * 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 `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nominal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nominal fields without + ``timeUnit``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/FieldOrDatumDefWithCondition'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionStringFieldDefText, self).__init__(aggregate=aggregate, + bandPosition=bandPosition, + bin=bin, + condition=condition, + field=field, format=format, + formatType=formatType, + timeUnit=timeUnit, + title=title, type=type, + **kwds) + + +class TextDirection(VegaLiteSchema): + """TextDirection schema wrapper + + enum('ltr', 'rtl') + """ + _schema = {'$ref': '#/definitions/TextDirection'} + + def __init__(self, *args): + super(TextDirection, self).__init__(*args) + + +class TickConfig(AnyMarkConfig): + """TickConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). + One of ``"left"``, ``"right"``, ``"center"``. + + **Note:** Expression reference is *not* supported for range marks. + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + bandSize : float + The width of the ticks. + + **Default value:** 3/4 of step (width step for horizontal ticks and height step for + vertical ticks). + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + For text marks, the vertical text baseline. One of ``"alphabetic"`` (default), + ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, ``"line-bottom"``, or an + expression reference that provides one of the valid values. The ``"line-top"`` and + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`` + ``"#4682b4"`` + + **Note:** + + + * This property cannot be used in a `style config + `__. + * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and + will override ``color``. + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default fill color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove fill. + + **Default value:** (None) + fillOpacity : anyOf(float, :class:`ExprRef`) + + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + + **Default value:** ``0`` + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). + + + * If set to ``"filter"`` (default), all data items with null values will be skipped + (for line, trail, and area marks) or filtered (for other marks). + * If ``null``, all data items are included. In this case, invalid values will be + interpreted as zeroes. + limit : anyOf(float, :class:`ExprRef`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). + + **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, + ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. + order : anyOf(None, boolean) + For line and trail marks, this ``order`` property can be set to ``null`` or + ``false`` to make the lines use the original order in the data sources. + orient : :class:`Orientation` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + the line if ``config.sortLineBy`` is not specified. For stacked charts, this is + always determined by the orientation of the stack; therefore explicitly specified + value will be ignored. + outerRadius : anyOf(float, :class:`ExprRef`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + + **Default value:** ``0`` + padAngle : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + For arc mark, the primary (outer) radius in pixels. + + For text marks, polar coordinate radial offset, in pixels, of the text from the + origin determined by the ``x`` and ``y`` properties. + + **Default value:** ``min(plot_width, plot_height)/2`` + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + + **Default value:** ``0`` + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. Note that this value sets the area of the symbol; the side lengths will + increase with the square root of this value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** + + + * ``30`` for point, circle, square marks; width/height's ``step`` + * ``2`` for bar marks with discrete dimensions; + * ``5`` for bar marks with continuous dimensions; + * ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + Default stroke color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove stroke. + + **Default value:** (None) + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + For arc marks, the arc length in radians if theta2 is not specified, otherwise the + start arc angle. (A value of 0 indicates up or “north”, increasing values proceed + clockwise.) + + For text marks, polar coordinate angle in radians. + theta2 : anyOf(float, :class:`ExprRef`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + thickness : float + Thickness of the tick mark. + + **Default value:** ``1`` + 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 + will be positioned in the middle of the time unit band step. + timeUnitBandSize : float + Default relative band size for a time unit. If set to ``1``, the bandwidth of the + marks will be equal to the time unit band step. If set to ``0.5``, bandwidth of the + marks will be half of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + x2 : anyOf(float, string, :class:`ExprRef`) + X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"width"`` for the width + of the plot. + y : anyOf(float, string, :class:`ExprRef`) + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + y2 : anyOf(float, string, :class:`ExprRef`) + Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + + The ``value`` of this channel can be a number or a string ``"height"`` for the + height of the plot. + """ + _schema = {'$ref': '#/definitions/TickConfig'} + + def __init__(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, blend=Undefined, color=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, + description=Undefined, dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, + endAngle=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, lineBreak=Undefined, lineHeight=Undefined, + opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, + padAngle=Undefined, radius=Undefined, radius2=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, startAngle=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, thickness=Undefined, timeUnitBandPosition=Undefined, + timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, + x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, **kwds): + super(TickConfig, self).__init__(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, + bandSize=bandSize, baseline=baseline, blend=blend, color=color, + cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, + description=description, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, endAngle=endAngle, fill=fill, + fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, + interpolate=interpolate, invalid=invalid, limit=limit, + lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, + order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, radius=radius, radius2=radius2, shape=shape, + size=size, smooth=smooth, startAngle=startAngle, stroke=stroke, + strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, theta2=theta2, + thickness=thickness, timeUnitBandPosition=timeUnitBandPosition, + timeUnitBandSize=timeUnitBandSize, tooltip=tooltip, url=url, + width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class TickCount(VegaLiteSchema): + """TickCount schema wrapper + + anyOf(float, :class:`TimeInterval`, :class:`TimeIntervalStep`) + """ + _schema = {'$ref': '#/definitions/TickCount'} + + def __init__(self, *args, **kwds): + super(TickCount, self).__init__(*args, **kwds) + + +class TimeInterval(TickCount): + """TimeInterval schema wrapper + + enum('millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year') + """ + _schema = {'$ref': '#/definitions/TimeInterval'} + + def __init__(self, *args): + super(TimeInterval, self).__init__(*args) + + +class TimeIntervalStep(TickCount): + """TimeIntervalStep schema wrapper + + Mapping(required=[interval, step]) + + Attributes + ---------- + + interval : :class:`TimeInterval` + + step : float + + """ + _schema = {'$ref': '#/definitions/TimeIntervalStep'} + + def __init__(self, interval=Undefined, step=Undefined, **kwds): + super(TimeIntervalStep, self).__init__(interval=interval, step=step, **kwds) + + +class TimeLocale(VegaLiteSchema): + """TimeLocale schema wrapper + + Mapping(required=[dateTime, date, time, periods, days, shortDays, months, shortMonths]) + Locale definition for formatting dates and times. + + Attributes + ---------- + + date : string + The date (%x) format specifier (e.g., "%m/%d/%Y"). + dateTime : string + The date and time (%c) format specifier (e.g., "%a %b %e %X %Y"). + days : :class:`Vector7string` + The full names of the weekdays, starting with Sunday. + months : :class:`Vector12string` + The full names of the months (starting with January). + periods : :class:`Vector2string` + The A.M. and P.M. equivalents (e.g., ["AM", "PM"]). + shortDays : :class:`Vector7string` + The abbreviated names of the weekdays, starting with Sunday. + shortMonths : :class:`Vector12string` + The abbreviated names of the months (starting with January). + time : string + The time (%X) format specifier (e.g., "%H:%M:%S"). + """ + _schema = {'$ref': '#/definitions/TimeLocale'} + + def __init__(self, date=Undefined, dateTime=Undefined, days=Undefined, months=Undefined, + periods=Undefined, shortDays=Undefined, shortMonths=Undefined, time=Undefined, **kwds): + super(TimeLocale, self).__init__(date=date, dateTime=dateTime, days=days, months=months, + periods=periods, shortDays=shortDays, shortMonths=shortMonths, + time=time, **kwds) + + +class TimeUnit(VegaLiteSchema): + """TimeUnit schema wrapper + + anyOf(:class:`SingleTimeUnit`, :class:`MultiTimeUnit`) + """ + _schema = {'$ref': '#/definitions/TimeUnit'} + + def __init__(self, *args, **kwds): + super(TimeUnit, self).__init__(*args, **kwds) + + +class MultiTimeUnit(TimeUnit): + """MultiTimeUnit schema wrapper + + anyOf(:class:`LocalMultiTimeUnit`, :class:`UtcMultiTimeUnit`) + """ + _schema = {'$ref': '#/definitions/MultiTimeUnit'} + + def __init__(self, *args, **kwds): + super(MultiTimeUnit, self).__init__(*args, **kwds) + + +class LocalMultiTimeUnit(MultiTimeUnit): + """LocalMultiTimeUnit schema wrapper + + enum('yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', + 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'yearweek', 'yearweekday', + 'yearweekdayhours', 'yearweekdayhoursminutes', 'yearweekdayhoursminutesseconds', + 'yeardayofyear', 'quartermonth', 'monthdate', 'monthdatehours', 'monthdatehoursminutes', + 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', + 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', + 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds') + """ + _schema = {'$ref': '#/definitions/LocalMultiTimeUnit'} + + def __init__(self, *args): + super(LocalMultiTimeUnit, self).__init__(*args) + + +class SingleTimeUnit(TimeUnit): + """SingleTimeUnit schema wrapper + + anyOf(:class:`LocalSingleTimeUnit`, :class:`UtcSingleTimeUnit`) + """ + _schema = {'$ref': '#/definitions/SingleTimeUnit'} + + def __init__(self, *args, **kwds): + super(SingleTimeUnit, self).__init__(*args, **kwds) + + +class LocalSingleTimeUnit(SingleTimeUnit): + """LocalSingleTimeUnit schema wrapper + + enum('year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', + 'seconds', 'milliseconds') + """ + _schema = {'$ref': '#/definitions/LocalSingleTimeUnit'} + + def __init__(self, *args): + super(LocalSingleTimeUnit, self).__init__(*args) + + +class TimeUnitParams(VegaLiteSchema): + """TimeUnitParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + maxbins : float + If no ``unit`` is specified, maxbins is used to infer time units. + step : float + The number of steps between bins, in terms of the least significant unit provided. + unit : :class:`TimeUnit` + Defines how date-time values should be binned. + utc : boolean + True to use UTC timezone. Equivalent to using a ``utc`` prefixed ``TimeUnit``. + """ + _schema = {'$ref': '#/definitions/TimeUnitParams'} + + def __init__(self, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds): + super(TimeUnitParams, self).__init__(maxbins=maxbins, step=step, unit=unit, utc=utc, **kwds) + + +class TitleAnchor(VegaLiteSchema): + """TitleAnchor schema wrapper + + enum(None, 'start', 'middle', 'end') + """ + _schema = {'$ref': '#/definitions/TitleAnchor'} + + def __init__(self, *args): + super(TitleAnchor, self).__init__(*args) + + +class TitleConfig(VegaLiteSchema): + """TitleConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or + ``"right"``. + anchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + baseline : :class:`TextBaseline` + Vertical text baseline for title and subtitle text. One of ``"alphabetic"`` + (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or + ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly + to ``"top"`` and ``"bottom"``, but are calculated relative to the *lineHeight* + rather than *fontSize* alone. + color : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) + + limit : anyOf(float, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + + orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) + + subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + subtitleFont : anyOf(string, :class:`ExprRef`) + + subtitleFontSize : anyOf(float, :class:`ExprRef`) + + subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + subtitleLineHeight : anyOf(float, :class:`ExprRef`) + + subtitlePadding : anyOf(float, :class:`ExprRef`) + + zindex : anyOf(float, :class:`ExprRef`) + + """ + _schema = {'$ref': '#/definitions/TitleConfig'} + + def __init__(self, align=Undefined, anchor=Undefined, angle=Undefined, aria=Undefined, + baseline=Undefined, color=Undefined, dx=Undefined, dy=Undefined, font=Undefined, + fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, frame=Undefined, + limit=Undefined, lineHeight=Undefined, offset=Undefined, orient=Undefined, + subtitleColor=Undefined, subtitleFont=Undefined, subtitleFontSize=Undefined, + subtitleFontStyle=Undefined, subtitleFontWeight=Undefined, + subtitleLineHeight=Undefined, subtitlePadding=Undefined, zindex=Undefined, **kwds): + super(TitleConfig, self).__init__(align=align, anchor=anchor, angle=angle, aria=aria, + baseline=baseline, color=color, dx=dx, dy=dy, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + frame=frame, limit=limit, lineHeight=lineHeight, + offset=offset, orient=orient, subtitleColor=subtitleColor, + subtitleFont=subtitleFont, subtitleFontSize=subtitleFontSize, + subtitleFontStyle=subtitleFontStyle, + subtitleFontWeight=subtitleFontWeight, + subtitleLineHeight=subtitleLineHeight, + subtitlePadding=subtitlePadding, zindex=zindex, **kwds) + + +class TitleFrame(VegaLiteSchema): + """TitleFrame schema wrapper + + enum('bounds', 'group') + """ + _schema = {'$ref': '#/definitions/TitleFrame'} + + def __init__(self, *args): + super(TitleFrame, self).__init__(*args) + + +class TitleOrient(VegaLiteSchema): + """TitleOrient schema wrapper + + enum('none', 'left', 'right', 'top', 'bottom') + """ + _schema = {'$ref': '#/definitions/TitleOrient'} + + def __init__(self, *args): + super(TitleOrient, self).__init__(*args) + + +class TitleParams(VegaLiteSchema): + """TitleParams schema wrapper + + Mapping(required=[text]) + + Attributes + ---------- + + text : anyOf(:class:`Text`, :class:`ExprRef`) + The title text. + align : :class:`Align` + Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or + ``"right"``. + anchor : :class:`TitleAnchor` + The anchor position for placing the title. One of ``"start"``, ``"middle"``, or + ``"end"``. For example, with an orientation of top these anchor positions map to a + left-, center-, or right-aligned title. + + **Default value:** ``"middle"`` for `single + `__ and `layered + `__ views. ``"start"`` for other + composite views. + + **Note:** `For now `__, ``anchor`` is + only customizable only for `single + `__ and `layered + `__ views. For other composite + views, ``anchor`` is always ``"start"``. + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + baseline : :class:`TextBaseline` + Vertical text baseline for title and subtitle text. One of ``"alphabetic"`` + (default), ``"top"``, ``"middle"``, ``"bottom"``, ``"line-top"``, or + ``"line-bottom"``. The ``"line-top"`` and ``"line-bottom"`` values operate similarly + to ``"top"`` and ``"bottom"``, but are calculated relative to the *lineHeight* + rather than *fontSize* alone. + color : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) + + limit : anyOf(float, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + + orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) + + style : anyOf(string, List(string)) + A `mark style property `__ + to apply to the title text mark. + + **Default value:** ``"group-title"``. + subtitle : :class:`Text` + The subtitle Text. + subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + subtitleFont : anyOf(string, :class:`ExprRef`) + + subtitleFontSize : anyOf(float, :class:`ExprRef`) + + subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + subtitleLineHeight : anyOf(float, :class:`ExprRef`) + + subtitlePadding : anyOf(float, :class:`ExprRef`) + + zindex : float + The integer z-index indicating the layering of the title group relative to other + axis, mark and legend groups. + + **Default value:** ``0``. + """ + _schema = {'$ref': '#/definitions/TitleParams'} + + def __init__(self, text=Undefined, align=Undefined, anchor=Undefined, angle=Undefined, + aria=Undefined, baseline=Undefined, color=Undefined, dx=Undefined, dy=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + frame=Undefined, limit=Undefined, lineHeight=Undefined, offset=Undefined, + orient=Undefined, style=Undefined, subtitle=Undefined, subtitleColor=Undefined, + subtitleFont=Undefined, subtitleFontSize=Undefined, subtitleFontStyle=Undefined, + subtitleFontWeight=Undefined, subtitleLineHeight=Undefined, subtitlePadding=Undefined, + zindex=Undefined, **kwds): + super(TitleParams, self).__init__(text=text, align=align, anchor=anchor, angle=angle, aria=aria, + baseline=baseline, color=color, dx=dx, dy=dy, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + frame=frame, limit=limit, lineHeight=lineHeight, + offset=offset, orient=orient, style=style, subtitle=subtitle, + subtitleColor=subtitleColor, subtitleFont=subtitleFont, + subtitleFontSize=subtitleFontSize, + subtitleFontStyle=subtitleFontStyle, + subtitleFontWeight=subtitleFontWeight, + subtitleLineHeight=subtitleLineHeight, + subtitlePadding=subtitlePadding, zindex=zindex, **kwds) + + +class TooltipContent(VegaLiteSchema): + """TooltipContent schema wrapper + + Mapping(required=[content]) + + Attributes + ---------- + + content : enum('encoding', 'data') + + """ + _schema = {'$ref': '#/definitions/TooltipContent'} + + def __init__(self, content=Undefined, **kwds): + super(TooltipContent, self).__init__(content=content, **kwds) + + +class TopLevelSelectionParameter(VegaLiteSchema): + """TopLevelSelectionParameter schema wrapper + + Mapping(required=[name, select]) + + Attributes + ---------- + + name : :class:`ParameterName` + Required. A unique name for the selection parameter. Selection names should be valid + JavaScript identifiers: they should contain only alphanumeric characters (or "$", or + "_") and may not start with a digit. Reserved keywords that may not be used as + parameter names are "datum", "event", "item", and "parent". + select : anyOf(:class:`SelectionType`, :class:`PointSelectionConfig`, + :class:`IntervalSelectionConfig`) + Determines the default event processing and data query for the selection. Vega-Lite + currently supports two selection types: + + + * ``"point"`` -- to select multiple discrete data values; the first value is + selected on ``click`` and additional values toggled on shift-click. + * ``"interval"`` -- to select a continuous range of data values on ``drag``. + bind : anyOf(:class:`Binding`, Mapping(required=[]), :class:`LegendBinding`, string) + When set, a selection is populated by input elements (also known as dynamic query + widgets) or by interacting with the corresponding legend. Direct manipulation + interaction is disabled by default; to re-enable it, set the selection's `on + `__ + property. + + Legend bindings are restricted to selections that only specify a single field or + encoding. + + Query widget binding takes the form of Vega's `input element binding definition + `__ or can be a mapping between + projected field/encodings and binding definitions. + + **See also:** `bind `__ + documentation. + value : anyOf(:class:`SelectionInit`, List(:class:`SelectionInitMapping`), + :class:`SelectionInitIntervalMapping`) + Initialize the selection with a mapping between `projected channels or field names + `__ and initial + values. + + **See also:** `init `__ + documentation. + views : List(anyOf(string, List(string))) + By default, top-level selections are applied to every view in the visualization. If + this property is specified, selections will only be applied to views with the given + names. + """ + _schema = {'$ref': '#/definitions/TopLevelSelectionParameter'} + + def __init__(self, name=Undefined, select=Undefined, bind=Undefined, value=Undefined, + views=Undefined, **kwds): + super(TopLevelSelectionParameter, self).__init__(name=name, select=select, bind=bind, + value=value, views=views, **kwds) + + +class TopLevelSpec(VegaLiteSchema): + """TopLevelSpec schema wrapper + + anyOf(:class:`TopLevelUnitSpec`, :class:`TopLevelFacetSpec`, :class:`TopLevelLayerSpec`, + :class:`TopLevelRepeatSpec`, :class:`TopLevelConcatSpec`, :class:`TopLevelVConcatSpec`, + :class:`TopLevelHConcatSpec`) + A Vega-Lite top-level specification. This is the root class for all Vega-Lite + specifications. (The json schema is generated from this type.) + """ + _schema = {'$ref': '#/definitions/TopLevelSpec'} + + def __init__(self, *args, **kwds): + super(TopLevelSpec, self).__init__(*args, **kwds) + + +class TopLevelConcatSpec(TopLevelSpec): + """TopLevelConcatSpec schema wrapper + + Mapping(required=[concat]) + + Attributes + ---------- + + concat : List(:class:`NonNormalizedSpec`) + A list of views to be concatenated. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + How the visualization size should be determined. If a string, should be one of + ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify + parameters for content sizing and automatic resizing. + + **Default value** : ``pad`` + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + datasets : :class:`Datasets` + A global data store for named datasets. This is a mapping from names to inline + datasets. This can be an array of objects or primitive values or a string. Arrays of + primitive values are ingested as objects with a ``data`` property. + description : string + Description of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + The default visualization padding, in pixels, from the edge of the visualization + canvas to the data rectangle. If a number, specifies padding for all sides. If an + object, the value should have the format ``{"left": 5, "top": 5, "right": 5, + "bottom": 5}`` to specify padding for each side of the visualization. + + **Default value** : ``5`` + params : List(anyOf(:class:`VariableParameter`, :class:`TopLevelSelectionParameter`)) + Dynamic variables or selections that parameterize a visualization. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + The spacing in pixels between sub-views of the composition operator. An object of + the form ``{"row": number, "column": number}`` can be used to set different spacing + values for rows and columns. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dict` + Optional metadata that will be passed to Vega. This object is completely ignored by + Vega and Vega-Lite and can be used for custom metadata. + $schema : string + 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`` + property allows automatic validation and autocomplete in editors that support JSON + schema. + """ + _schema = {'$ref': '#/definitions/TopLevelConcatSpec'} + + def __init__(self, concat=Undefined, align=Undefined, autosize=Undefined, background=Undefined, + bounds=Undefined, center=Undefined, columns=Undefined, config=Undefined, + data=Undefined, datasets=Undefined, description=Undefined, name=Undefined, + padding=Undefined, params=Undefined, resolve=Undefined, spacing=Undefined, + title=Undefined, transform=Undefined, usermeta=Undefined, **kwds): + super(TopLevelConcatSpec, self).__init__(concat=concat, align=align, autosize=autosize, + background=background, bounds=bounds, center=center, + columns=columns, config=config, data=data, + datasets=datasets, description=description, name=name, + padding=padding, params=params, resolve=resolve, + spacing=spacing, title=title, transform=transform, + usermeta=usermeta, **kwds) + + +class TopLevelFacetSpec(TopLevelSpec): + """TopLevelFacetSpec schema wrapper + + Mapping(required=[data, facet, spec]) + + Attributes + ---------- + + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + facet : anyOf(:class:`FacetFieldDef`, :class:`FacetMapping`) + Definition for how to facet the data. One of: 1) `a field definition for faceting + the plot by one field + `__ 2) `An object that + maps row and column channels to their field definitions + `__ + spec : anyOf(:class:`LayerSpec`, :class:`UnitSpecWithFrame`) + A specification of the view that gets faceted. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + How the visualization size should be determined. If a string, should be one of + ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify + parameters for content sizing and automatic resizing. + + **Default value** : ``pad`` + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + datasets : :class:`Datasets` + A global data store for named datasets. This is a mapping from names to inline + datasets. This can be an array of objects or primitive values or a string. Arrays of + primitive values are ingested as objects with a ``data`` property. + description : string + Description of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + The default visualization padding, in pixels, from the edge of the visualization + canvas to the data rectangle. If a number, specifies padding for all sides. If an + object, the value should have the format ``{"left": 5, "top": 5, "right": 5, + "bottom": 5}`` to specify padding for each side of the visualization. + + **Default value** : ``5`` + params : List(anyOf(:class:`VariableParameter`, :class:`TopLevelSelectionParameter`)) + Dynamic variables or selections that parameterize a visualization. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + The spacing in pixels between sub-views of the composition operator. An object of + the form ``{"row": number, "column": number}`` can be used to set different spacing + values for rows and columns. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dict` + Optional metadata that will be passed to Vega. This object is completely ignored by + Vega and Vega-Lite and can be used for custom metadata. + $schema : string + 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`` + property allows automatic validation and autocomplete in editors that support JSON + schema. + """ + _schema = {'$ref': '#/definitions/TopLevelFacetSpec'} + + def __init__(self, data=Undefined, facet=Undefined, spec=Undefined, align=Undefined, + autosize=Undefined, background=Undefined, bounds=Undefined, center=Undefined, + columns=Undefined, config=Undefined, datasets=Undefined, description=Undefined, + name=Undefined, padding=Undefined, params=Undefined, resolve=Undefined, + spacing=Undefined, title=Undefined, transform=Undefined, usermeta=Undefined, **kwds): + super(TopLevelFacetSpec, self).__init__(data=data, facet=facet, spec=spec, align=align, + autosize=autosize, background=background, bounds=bounds, + center=center, columns=columns, config=config, + datasets=datasets, description=description, name=name, + padding=padding, params=params, resolve=resolve, + spacing=spacing, title=title, transform=transform, + usermeta=usermeta, **kwds) + + +class TopLevelHConcatSpec(TopLevelSpec): + """TopLevelHConcatSpec schema wrapper + + Mapping(required=[hconcat]) + + Attributes + ---------- + + hconcat : List(:class:`NonNormalizedSpec`) + A list of views to be concatenated and put into a row. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + How the visualization size should be determined. If a string, should be one of + ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify + parameters for content sizing and automatic resizing. + + **Default value** : ``pad`` + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + datasets : :class:`Datasets` + A global data store for named datasets. This is a mapping from names to inline + datasets. This can be an array of objects or primitive values or a string. Arrays of + primitive values are ingested as objects with a ``data`` property. + description : string + Description of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + The default visualization padding, in pixels, from the edge of the visualization + canvas to the data rectangle. If a number, specifies padding for all sides. If an + object, the value should have the format ``{"left": 5, "top": 5, "right": 5, + "bottom": 5}`` to specify padding for each side of the visualization. + + **Default value** : ``5`` + params : List(anyOf(:class:`VariableParameter`, :class:`TopLevelSelectionParameter`)) + Dynamic variables or selections that parameterize a visualization. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : float + The spacing in pixels between sub-views of the concat operator. + + **Default value** : ``10`` + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dict` + Optional metadata that will be passed to Vega. This object is completely ignored by + Vega and Vega-Lite and can be used for custom metadata. + $schema : string + 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`` + property allows automatic validation and autocomplete in editors that support JSON + schema. + """ + _schema = {'$ref': '#/definitions/TopLevelHConcatSpec'} + + def __init__(self, hconcat=Undefined, autosize=Undefined, background=Undefined, bounds=Undefined, + center=Undefined, config=Undefined, data=Undefined, datasets=Undefined, + description=Undefined, name=Undefined, padding=Undefined, params=Undefined, + resolve=Undefined, spacing=Undefined, title=Undefined, transform=Undefined, + usermeta=Undefined, **kwds): + super(TopLevelHConcatSpec, self).__init__(hconcat=hconcat, autosize=autosize, + background=background, bounds=bounds, center=center, + config=config, data=data, datasets=datasets, + description=description, name=name, padding=padding, + params=params, resolve=resolve, spacing=spacing, + title=title, transform=transform, usermeta=usermeta, + **kwds) + + +class TopLevelLayerSpec(TopLevelSpec): + """TopLevelLayerSpec schema wrapper + + Mapping(required=[layer]) + + Attributes + ---------- + + layer : List(anyOf(:class:`LayerSpec`, :class:`UnitSpec`)) + Layer or single view specifications to be layered. + + **Note** : Specifications inside ``layer`` cannot use ``row`` and ``column`` + channels as layering facet specifications is not allowed. Instead, use the `facet + operator `__ and place a layer + inside a facet. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + How the visualization size should be determined. If a string, should be one of + ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify + parameters for content sizing and automatic resizing. + + **Default value** : ``pad`` + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + datasets : :class:`Datasets` + A global data store for named datasets. This is a mapping from names to inline + datasets. This can be an array of objects or primitive values or a string. Arrays of + primitive values are ingested as objects with a ``data`` property. + description : string + Description of this mark for commenting purpose. + encoding : :class:`SharedEncoding` + A shared key-value mapping between encoding channels and definition of fields in the + underlying layers. + height : anyOf(float, string, :class:`Step`) + The height of a visualization. + + + * For a plot with a continuous y-field, height should be a number. + * For a plot with either a discrete y-field or no y-field, height can be either a + number indicating a fixed height or an object in the form of ``{step: number}`` + defining the height per discrete step. (No y-field is equivalent to having one + discrete step.) + * To enable responsive sizing on height, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. + + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + The default visualization padding, in pixels, from the edge of the visualization + canvas to the data rectangle. If a number, specifies padding for all sides. If an + object, the value should have the format ``{"left": 5, "top": 5, "right": 5, + "bottom": 5}`` to specify padding for each side of the visualization. + + **Default value** : ``5`` + params : List(anyOf(:class:`VariableParameter`, :class:`TopLevelSelectionParameter`)) + Dynamic variables or selections that parameterize a visualization. + projection : :class:`Projection` + An object defining properties of the geographic projection shared by underlying + layers. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dict` + Optional metadata that will be passed to Vega. This object is completely ignored by + Vega and Vega-Lite and can be used for custom metadata. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. + + + * For a plot with a continuous x-field, width should be a number. + * For a plot with either a discrete x-field or no x-field, width can be either a + number indicating a fixed width or an object in the form of ``{step: number}`` + defining the width per discrete step. (No x-field is equivalent to having one + discrete step.) + * To enable responsive sizing on width, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. + + **See also:** `width `__ + documentation. + $schema : string + 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`` + property allows automatic validation and autocomplete in editors that support JSON + schema. + """ + _schema = {'$ref': '#/definitions/TopLevelLayerSpec'} + + def __init__(self, layer=Undefined, autosize=Undefined, background=Undefined, config=Undefined, + data=Undefined, datasets=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, padding=Undefined, params=Undefined, + projection=Undefined, resolve=Undefined, title=Undefined, transform=Undefined, + usermeta=Undefined, view=Undefined, width=Undefined, **kwds): + super(TopLevelLayerSpec, self).__init__(layer=layer, autosize=autosize, background=background, + config=config, data=data, datasets=datasets, + description=description, encoding=encoding, + height=height, name=name, padding=padding, + params=params, projection=projection, resolve=resolve, + title=title, transform=transform, usermeta=usermeta, + view=view, width=width, **kwds) + + +class TopLevelRepeatSpec(TopLevelSpec): + """TopLevelRepeatSpec schema wrapper + + anyOf(Mapping(required=[repeat, spec]), Mapping(required=[repeat, spec])) + """ + _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} + + def __init__(self, *args, **kwds): + super(TopLevelRepeatSpec, self).__init__(*args, **kwds) + + +class TopLevelUnitSpec(TopLevelSpec): + """TopLevelUnitSpec schema wrapper + + Mapping(required=[data, mark]) + + Attributes + ---------- + + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and + ``"text"`` ) or a `mark definition object + `__. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + How the visualization size should be determined. If a string, should be one of + ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify + parameters for content sizing and automatic resizing. + + **Default value** : ``pad`` + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + datasets : :class:`Datasets` + A global data store for named datasets. This is a mapping from names to inline + datasets. This can be an array of objects or primitive values or a string. Arrays of + primitive values are ingested as objects with a ``data`` property. + description : string + Description of this mark for commenting purpose. + encoding : :class:`FacetedEncoding` + A key-value mapping between encoding channels and definition of fields. + height : anyOf(float, string, :class:`Step`) + The height of a visualization. + + + * For a plot with a continuous y-field, height should be a number. + * For a plot with either a discrete y-field or no y-field, height can be either a + number indicating a fixed height or an object in the form of ``{step: number}`` + defining the height per discrete step. (No y-field is equivalent to having one + discrete step.) + * To enable responsive sizing on height, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. + + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + The default visualization padding, in pixels, from the edge of the visualization + canvas to the data rectangle. If a number, specifies padding for all sides. If an + object, the value should have the format ``{"left": 5, "top": 5, "right": 5, + "bottom": 5}`` to specify padding for each side of the visualization. + + **Default value** : ``5`` + params : List(anyOf(:class:`VariableParameter`, :class:`SelectionParameter`)) + An array of parameters that may either be simple variables, or more complex + selections that map user input to data queries. + projection : :class:`Projection` + An object defining properties of geographic projection, which will be applied to + ``shape`` path for ``"geoshape"`` marks and to ``latitude`` and ``"longitude"`` + channels for other marks. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + The spacing in pixels between sub-views of the composition operator. An object of + the form ``{"row": number, "column": number}`` can be used to set different spacing + values for rows and columns. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dict` + Optional metadata that will be passed to Vega. This object is completely ignored by + Vega and Vega-Lite and can be used for custom metadata. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. + + + * For a plot with a continuous x-field, width should be a number. + * For a plot with either a discrete x-field or no x-field, width can be either a + number indicating a fixed width or an object in the form of ``{step: number}`` + defining the width per discrete step. (No x-field is equivalent to having one + discrete step.) + * To enable responsive sizing on width, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. + + **See also:** `width `__ + documentation. + $schema : string + 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`` + property allows automatic validation and autocomplete in editors that support JSON + schema. + """ + _schema = {'$ref': '#/definitions/TopLevelUnitSpec'} + + def __init__(self, data=Undefined, mark=Undefined, align=Undefined, autosize=Undefined, + background=Undefined, bounds=Undefined, center=Undefined, config=Undefined, + datasets=Undefined, description=Undefined, encoding=Undefined, height=Undefined, + name=Undefined, padding=Undefined, params=Undefined, projection=Undefined, + resolve=Undefined, spacing=Undefined, title=Undefined, transform=Undefined, + usermeta=Undefined, view=Undefined, width=Undefined, **kwds): + super(TopLevelUnitSpec, self).__init__(data=data, mark=mark, align=align, autosize=autosize, + background=background, bounds=bounds, center=center, + config=config, datasets=datasets, + description=description, encoding=encoding, + height=height, name=name, padding=padding, params=params, + projection=projection, resolve=resolve, spacing=spacing, + title=title, transform=transform, usermeta=usermeta, + view=view, width=width, **kwds) + + +class TopLevelVConcatSpec(TopLevelSpec): + """TopLevelVConcatSpec schema wrapper + + Mapping(required=[vconcat]) + + Attributes + ---------- + + vconcat : List(:class:`NonNormalizedSpec`) + A list of views to be concatenated and put into a column. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + How the visualization size should be determined. If a string, should be one of + ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify + parameters for content sizing and automatic resizing. + + **Default value** : ``pad`` + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + datasets : :class:`Datasets` + A global data store for named datasets. This is a mapping from names to inline + datasets. This can be an array of objects or primitive values or a string. Arrays of + primitive values are ingested as objects with a ``data`` property. + description : string + Description of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + The default visualization padding, in pixels, from the edge of the visualization + canvas to the data rectangle. If a number, specifies padding for all sides. If an + object, the value should have the format ``{"left": 5, "top": 5, "right": 5, + "bottom": 5}`` to specify padding for each side of the visualization. + + **Default value** : ``5`` + params : List(anyOf(:class:`VariableParameter`, :class:`TopLevelSelectionParameter`)) + Dynamic variables or selections that parameterize a visualization. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : float + The spacing in pixels between sub-views of the concat operator. + + **Default value** : ``10`` + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dict` + Optional metadata that will be passed to Vega. This object is completely ignored by + Vega and Vega-Lite and can be used for custom metadata. + $schema : string + 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`` + property allows automatic validation and autocomplete in editors that support JSON + schema. + """ + _schema = {'$ref': '#/definitions/TopLevelVConcatSpec'} + + def __init__(self, vconcat=Undefined, autosize=Undefined, background=Undefined, bounds=Undefined, + center=Undefined, config=Undefined, data=Undefined, datasets=Undefined, + description=Undefined, name=Undefined, padding=Undefined, params=Undefined, + resolve=Undefined, spacing=Undefined, title=Undefined, transform=Undefined, + usermeta=Undefined, **kwds): + super(TopLevelVConcatSpec, self).__init__(vconcat=vconcat, autosize=autosize, + background=background, bounds=bounds, center=center, + config=config, data=data, datasets=datasets, + description=description, name=name, padding=padding, + params=params, resolve=resolve, spacing=spacing, + title=title, transform=transform, usermeta=usermeta, + **kwds) + + +class TopoDataFormat(DataFormat): + """TopoDataFormat schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + feature : string + The name of the TopoJSON object set to convert to a GeoJSON feature collection. For + example, in a map of the world, there may be an object set named ``"countries"``. + Using the feature property, we can extract this set and generate a GeoJSON feature + object for each country. + mesh : string + The name of the TopoJSON object set to convert to mesh. Similar to the ``feature`` + option, ``mesh`` extracts a named TopoJSON object set. Unlike the ``feature`` + option, the corresponding geo data is returned as a single, unified mesh instance, + not as individual GeoJSON features. Extracting a mesh is useful for more efficiently + drawing borders or other geographic elements that you do not need to associate with + specific regions such as individual countries, states or counties. + parse : anyOf(:class:`Parse`, None) + If set to ``null``, disable type inference based on the spec and only use type + inference based on the data. Alternatively, a parsing directive object can be + provided for explicit data types. Each property of the object corresponds to a field + name, and the value to the desired data type (one of ``"number"``, ``"boolean"``, + ``"date"``, or null (do not parse the field)). For example, ``"parse": + {"modified_on": "date"}`` parses the ``modified_on`` field in each input record a + Date value. + + For ``"date"``, we parse data based using JavaScript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + type : string + Type of input data: ``"json"``, ``"csv"``, ``"tsv"``, ``"dsv"``. + + **Default value:** The default format type is determined by the extension of the + file URL. If no extension is detected, ``"json"`` will be used by default. + """ + _schema = {'$ref': '#/definitions/TopoDataFormat'} + + def __init__(self, feature=Undefined, mesh=Undefined, parse=Undefined, type=Undefined, **kwds): + super(TopoDataFormat, self).__init__(feature=feature, mesh=mesh, parse=parse, type=type, **kwds) + + +class Transform(VegaLiteSchema): + """Transform schema wrapper + + anyOf(:class:`AggregateTransform`, :class:`BinTransform`, :class:`CalculateTransform`, + :class:`DensityTransform`, :class:`FilterTransform`, :class:`FlattenTransform`, + :class:`FoldTransform`, :class:`ImputeTransform`, :class:`JoinAggregateTransform`, + :class:`LoessTransform`, :class:`LookupTransform`, :class:`QuantileTransform`, + :class:`RegressionTransform`, :class:`TimeUnitTransform`, :class:`SampleTransform`, + :class:`StackTransform`, :class:`WindowTransform`, :class:`PivotTransform`) + """ + _schema = {'$ref': '#/definitions/Transform'} + + def __init__(self, *args, **kwds): + super(Transform, self).__init__(*args, **kwds) + + +class AggregateTransform(Transform): + """AggregateTransform schema wrapper + + Mapping(required=[aggregate]) + + Attributes + ---------- + + aggregate : List(:class:`AggregatedFieldDef`) + Array of objects that define fields to aggregate. + groupby : List(:class:`FieldName`) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + """ + _schema = {'$ref': '#/definitions/AggregateTransform'} + + def __init__(self, aggregate=Undefined, groupby=Undefined, **kwds): + super(AggregateTransform, self).__init__(aggregate=aggregate, groupby=groupby, **kwds) + + +class BinTransform(Transform): + """BinTransform schema wrapper + + Mapping(required=[bin, field, as]) + + Attributes + ---------- + + bin : anyOf(boolean, :class:`BinParams`) + An object indicating bin properties, or simply ``true`` for using default bin + parameters. + field : :class:`FieldName` + The data field to bin. + as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + The output fields at which to write the start and end bin values. This can be either + a string or an array of strings with two elements denoting the name for the fields + for bin start and bin end respectively. If a single string (e.g., ``"val"`` ) is + provided, the end field will be ``"val_end"``. + """ + _schema = {'$ref': '#/definitions/BinTransform'} + + def __init__(self, bin=Undefined, field=Undefined, **kwds): + super(BinTransform, self).__init__(bin=bin, field=field, **kwds) + + +class CalculateTransform(Transform): + """CalculateTransform schema wrapper + + Mapping(required=[calculate, as]) + + Attributes + ---------- + + calculate : string + A `expression `__ + string. Use the variable ``datum`` to refer to the current data object. + as : :class:`FieldName` + The field for storing the computed formula value. + """ + _schema = {'$ref': '#/definitions/CalculateTransform'} + + def __init__(self, calculate=Undefined, **kwds): + super(CalculateTransform, self).__init__(calculate=calculate, **kwds) + + +class DensityTransform(Transform): + """DensityTransform schema wrapper + + Mapping(required=[density]) + + Attributes + ---------- + + density : :class:`FieldName` + The data field for which to perform density estimation. + bandwidth : float + The bandwidth (standard deviation) of the Gaussian kernel. If unspecified or set to + zero, the bandwidth value is automatically estimated from the input data using + Scott’s rule. + counts : boolean + A boolean flag indicating if the output values should be probability estimates + (false) or smoothed counts (true). + + **Default value:** ``false`` + cumulative : boolean + A boolean flag indicating whether to produce density estimates (false) or cumulative + density estimates (true). + + **Default value:** ``false`` + extent : List(float) + A [min, max] domain from which to sample the distribution. If unspecified, the + extent will be determined by the observed minimum and maximum values of the density + value field. + groupby : List(:class:`FieldName`) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + maxsteps : float + The maximum number of samples to take along the extent domain for plotting the + density. + + **Default value:** ``200`` + minsteps : float + The minimum number of samples to take along the extent domain for plotting the + density. + + **Default value:** ``25`` + steps : float + The exact number of samples to take along the extent domain for plotting the + density. If specified, overrides both minsteps and maxsteps to set an exact number + of uniform samples. Potentially useful in conjunction with a fixed extent to ensure + consistent sample points for stacked densities. + as : List(:class:`FieldName`) + The output fields for the sample value and corresponding density estimate. + + **Default value:** ``["value", "density"]`` + """ + _schema = {'$ref': '#/definitions/DensityTransform'} + + def __init__(self, density=Undefined, bandwidth=Undefined, counts=Undefined, cumulative=Undefined, + extent=Undefined, groupby=Undefined, maxsteps=Undefined, minsteps=Undefined, + steps=Undefined, **kwds): + super(DensityTransform, self).__init__(density=density, bandwidth=bandwidth, counts=counts, + cumulative=cumulative, extent=extent, groupby=groupby, + maxsteps=maxsteps, minsteps=minsteps, steps=steps, **kwds) + + +class FilterTransform(Transform): + """FilterTransform schema wrapper + + Mapping(required=[filter]) + + Attributes + ---------- + + filter : :class:`PredicateComposition` + The ``filter`` property must be a predication definition, which can take one of the + following forms: + + 1) an `expression `__ + string, where ``datum`` can be used to refer to the current data object. For + example, ``{filter: "datum.b2 > 60"}`` would make the output data includes only + items that have values in the field ``b2`` over 60. + + 2) one of the `field predicates + `__ : `equal + `__, `lt + `__, `lte + `__, `gt + `__, `gte + `__, `range + `__, `oneOf + `__, or + `valid `__, + + 3) a `selection predicate + `__, which + define the names of a selection that the data point should belong to (or a logical + composition of selections). + + 4) a `logical composition + `__ of (1), (2), + or (3). + """ + _schema = {'$ref': '#/definitions/FilterTransform'} + + def __init__(self, filter=Undefined, **kwds): + super(FilterTransform, self).__init__(filter=filter, **kwds) + + +class FlattenTransform(Transform): + """FlattenTransform schema wrapper + + Mapping(required=[flatten]) + + Attributes + ---------- + + flatten : List(:class:`FieldName`) + An array of one or more data fields containing arrays to flatten. If multiple fields + are specified, their array values should have a parallel structure, ideally with the + same length. If the lengths of parallel arrays do not match, the longest array will + be used with ``null`` values added for missing entries. + as : List(:class:`FieldName`) + The output field names for extracted array values. + + **Default value:** The field name of the corresponding array field + """ + _schema = {'$ref': '#/definitions/FlattenTransform'} + + def __init__(self, flatten=Undefined, **kwds): + super(FlattenTransform, self).__init__(flatten=flatten, **kwds) + + +class FoldTransform(Transform): + """FoldTransform schema wrapper + + Mapping(required=[fold]) + + Attributes + ---------- + + fold : List(:class:`FieldName`) + An array of data fields indicating the properties to fold. + as : List(:class:`FieldName`) + The output field names for the key and value properties produced by the fold + transform. **Default value:** ``["key", "value"]`` + """ + _schema = {'$ref': '#/definitions/FoldTransform'} + + def __init__(self, fold=Undefined, **kwds): + super(FoldTransform, self).__init__(fold=fold, **kwds) + + +class ImputeTransform(Transform): + """ImputeTransform schema wrapper + + Mapping(required=[impute, key]) + + Attributes + ---------- + + impute : :class:`FieldName` + The data field for which the missing values should be imputed. + key : :class:`FieldName` + A key field that uniquely identifies data objects within a group. Missing key values + (those occurring in the data but not in the current group) will be imputed. + frame : List(anyOf(None, float)) + A frame specification as a two-element array used to control the window over which + the specified method is applied. The array entries should either be a number + indicating the offset from the current data object, or null to indicate unbounded + rows preceding or following the current data object. For example, the value ``[-5, + 5]`` indicates that the window should include five objects preceding and five + objects following the current object. + + **Default value:** : ``[null, null]`` indicating that the window includes all + objects. + groupby : List(:class:`FieldName`) + An optional array of fields by which to group the values. Imputation will then be + performed on a per-group basis. + keyvals : anyOf(List(Any), :class:`ImputeSequence`) + Defines the key values that should be considered for imputation. An array of key + values or an object defining a `number sequence + `__. + + If provided, this will be used in addition to the key values observed within the + input data. If not provided, the values will be derived from all unique values of + the ``key`` field. For ``impute`` in ``encoding``, the key field is the x-field if + the y-field is imputed, or vice versa. + + If there is no impute grouping, this property *must* be specified. + method : :class:`ImputeMethod` + The imputation method to use for the field value of imputed data objects. One of + ``"value"``, ``"mean"``, ``"median"``, ``"max"`` or ``"min"``. + + **Default value:** ``"value"`` + value : Any + The field value to use when the imputation ``method`` is ``"value"``. + """ + _schema = {'$ref': '#/definitions/ImputeTransform'} + + def __init__(self, impute=Undefined, key=Undefined, frame=Undefined, groupby=Undefined, + keyvals=Undefined, method=Undefined, value=Undefined, **kwds): + super(ImputeTransform, self).__init__(impute=impute, key=key, frame=frame, groupby=groupby, + keyvals=keyvals, method=method, value=value, **kwds) + + +class JoinAggregateTransform(Transform): + """JoinAggregateTransform schema wrapper + + Mapping(required=[joinaggregate]) + + Attributes + ---------- + + joinaggregate : List(:class:`JoinAggregateFieldDef`) + The definition of the fields in the join aggregate, and what calculations to use. + groupby : List(:class:`FieldName`) + The data fields for partitioning the data objects into separate groups. If + unspecified, all data points will be in a single group. + """ + _schema = {'$ref': '#/definitions/JoinAggregateTransform'} + + def __init__(self, joinaggregate=Undefined, groupby=Undefined, **kwds): + super(JoinAggregateTransform, self).__init__(joinaggregate=joinaggregate, groupby=groupby, + **kwds) + + +class LoessTransform(Transform): + """LoessTransform schema wrapper + + Mapping(required=[loess, on]) + + Attributes + ---------- + + loess : :class:`FieldName` + The data field of the dependent variable to smooth. + on : :class:`FieldName` + The data field of the independent variable to use a predictor. + bandwidth : float + A bandwidth parameter in the range ``[0, 1]`` that determines the amount of + smoothing. + + **Default value:** ``0.3`` + groupby : List(:class:`FieldName`) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + as : List(:class:`FieldName`) + The output field names for the smoothed points generated by the loess transform. + + **Default value:** The field names of the input x and y values. + """ + _schema = {'$ref': '#/definitions/LoessTransform'} + + def __init__(self, loess=Undefined, on=Undefined, bandwidth=Undefined, groupby=Undefined, **kwds): + super(LoessTransform, self).__init__(loess=loess, on=on, bandwidth=bandwidth, groupby=groupby, + **kwds) + + +class LookupTransform(Transform): + """LookupTransform schema wrapper + + Mapping(required=[lookup, from]) + + Attributes + ---------- + + lookup : string + Key in primary data source. + default : Any + The default value to use if lookup fails. + + **Default value:** ``null`` + as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + The output fields on which to store the looked up data values. + + For data lookups, this property may be left blank if ``from.fields`` has been + specified (those field names will be used); if ``from.fields`` has not been + specified, ``as`` must be a string. + + For selection lookups, this property is optional: if unspecified, looked up values + will be stored under a property named for the selection; and if specified, it must + correspond to ``from.fields``. + from : anyOf(:class:`LookupData`, :class:`LookupSelection`) + Data source or selection for secondary data reference. + """ + _schema = {'$ref': '#/definitions/LookupTransform'} + + def __init__(self, lookup=Undefined, default=Undefined, **kwds): + super(LookupTransform, self).__init__(lookup=lookup, default=default, **kwds) + + +class PivotTransform(Transform): + """PivotTransform schema wrapper + + Mapping(required=[pivot, value]) + + Attributes + ---------- + + pivot : :class:`FieldName` + The data field to pivot on. The unique values of this field become new field names + in the output stream. + value : :class:`FieldName` + The data field to populate pivoted fields. The aggregate values of this field become + the values of the new pivoted fields. + groupby : List(:class:`FieldName`) + The optional data fields to group by. If not specified, a single group containing + all data objects will be used. + limit : float + An optional parameter indicating the maximum number of pivoted fields to generate. + The default ( ``0`` ) applies no limit. The pivoted ``pivot`` names are sorted in + ascending order prior to enforcing the limit. **Default value:** ``0`` + op : :class:`AggregateOp` + The aggregation operation to apply to grouped ``value`` field values. **Default + value:** ``sum`` + """ + _schema = {'$ref': '#/definitions/PivotTransform'} + + def __init__(self, pivot=Undefined, value=Undefined, groupby=Undefined, limit=Undefined, + op=Undefined, **kwds): + super(PivotTransform, self).__init__(pivot=pivot, value=value, groupby=groupby, limit=limit, + op=op, **kwds) + + +class QuantileTransform(Transform): + """QuantileTransform schema wrapper + + Mapping(required=[quantile]) + + Attributes + ---------- + + quantile : :class:`FieldName` + The data field for which to perform quantile estimation. + groupby : List(:class:`FieldName`) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + probs : List(float) + An array of probabilities in the range (0, 1) for which to compute quantile values. + If not specified, the *step* parameter will be used. + step : float + A probability step size (default 0.01) for sampling quantile values. All values from + one-half the step size up to 1 (exclusive) will be sampled. This parameter is only + used if the *probs* parameter is not provided. + as : List(:class:`FieldName`) + The output field names for the probability and quantile values. + + **Default value:** ``["prob", "value"]`` + """ + _schema = {'$ref': '#/definitions/QuantileTransform'} + + def __init__(self, quantile=Undefined, groupby=Undefined, probs=Undefined, step=Undefined, **kwds): + super(QuantileTransform, self).__init__(quantile=quantile, groupby=groupby, probs=probs, + step=step, **kwds) + + +class RegressionTransform(Transform): + """RegressionTransform schema wrapper + + Mapping(required=[regression, on]) + + Attributes + ---------- + + on : :class:`FieldName` + The data field of the independent variable to use a predictor. + regression : :class:`FieldName` + The data field of the dependent variable to predict. + extent : List(float) + A [min, max] domain over the independent (x) field for the starting and ending + points of the generated trend line. + groupby : List(:class:`FieldName`) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + method : enum('linear', 'log', 'exp', 'pow', 'quad', 'poly') + The functional form of the regression model. One of ``"linear"``, ``"log"``, + ``"exp"``, ``"pow"``, ``"quad"``, or ``"poly"``. + + **Default value:** ``"linear"`` + order : float + The polynomial order (number of coefficients) for the 'poly' method. + + **Default value:** ``3`` + params : boolean + A boolean flag indicating if the transform should return the regression model + parameters (one object per group), rather than trend line points. The resulting + objects include a ``coef`` array of fitted coefficient values (starting with the + intercept term and then including terms of increasing order) and an ``rSquared`` + value (indicating the total variance explained by the model). + + **Default value:** ``false`` + as : List(:class:`FieldName`) + The output field names for the smoothed points generated by the regression + transform. + + **Default value:** The field names of the input x and y values. + """ + _schema = {'$ref': '#/definitions/RegressionTransform'} + + def __init__(self, on=Undefined, regression=Undefined, extent=Undefined, groupby=Undefined, + method=Undefined, order=Undefined, params=Undefined, **kwds): + super(RegressionTransform, self).__init__(on=on, regression=regression, extent=extent, + groupby=groupby, method=method, order=order, + params=params, **kwds) + + +class SampleTransform(Transform): + """SampleTransform schema wrapper + + Mapping(required=[sample]) + + Attributes + ---------- + + sample : float + The maximum number of data objects to include in the sample. + + **Default value:** ``1000`` + """ + _schema = {'$ref': '#/definitions/SampleTransform'} + + def __init__(self, sample=Undefined, **kwds): + super(SampleTransform, self).__init__(sample=sample, **kwds) + + +class StackTransform(Transform): + """StackTransform schema wrapper + + Mapping(required=[stack, groupby, as]) + + Attributes + ---------- + + groupby : List(:class:`FieldName`) + The data fields to group by. + stack : :class:`FieldName` + The field which is stacked. + offset : enum('zero', 'center', 'normalize') + Mode for stacking marks. One of ``"zero"`` (default), ``"center"``, or + ``"normalize"``. The ``"zero"`` offset will stack starting at ``0``. The + ``"center"`` offset will center the stacks. The ``"normalize"`` offset will compute + percentage values for each stack point, with output values in the range ``[0,1]``. + + **Default value:** ``"zero"`` + sort : List(:class:`SortField`) + Field that determines the order of leaves in the stacked charts. + as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + Output field names. This can be either a string or an array of strings with two + elements denoting the name for the fields for stack start and stack end + respectively. If a single string(e.g., ``"val"`` ) is provided, the end field will + be ``"val_end"``. + """ + _schema = {'$ref': '#/definitions/StackTransform'} + + def __init__(self, groupby=Undefined, stack=Undefined, offset=Undefined, sort=Undefined, **kwds): + super(StackTransform, self).__init__(groupby=groupby, stack=stack, offset=offset, sort=sort, + **kwds) + + +class TimeUnitTransform(Transform): + """TimeUnitTransform schema wrapper + + Mapping(required=[timeUnit, field, as]) + + Attributes + ---------- + + field : :class:`FieldName` + The data field to apply time unit. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + The timeUnit. + as : :class:`FieldName` + The output field to write the timeUnit value. + """ + _schema = {'$ref': '#/definitions/TimeUnitTransform'} + + def __init__(self, field=Undefined, timeUnit=Undefined, **kwds): + super(TimeUnitTransform, self).__init__(field=field, timeUnit=timeUnit, **kwds) + + +class Type(VegaLiteSchema): + """Type schema wrapper + + enum('quantitative', 'ordinal', 'temporal', 'nominal', 'geojson') + Data type based on level of measurement + """ + _schema = {'$ref': '#/definitions/Type'} + + def __init__(self, *args): + super(Type, self).__init__(*args) + + +class TypeForShape(VegaLiteSchema): + """TypeForShape schema wrapper + + enum('nominal', 'ordinal', 'geojson') + """ + _schema = {'$ref': '#/definitions/TypeForShape'} + + def __init__(self, *args): + super(TypeForShape, self).__init__(*args) + + +class TypedFieldDef(VegaLiteSchema): + """TypedFieldDef schema wrapper + + Mapping(required=[]) + Definition object for a data field, its type and transformation of an encoding channel. + + Attributes + ---------- + + aggregate : :class:`Aggregate` + 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 : anyOf(boolean, :class:`BinParams`, string, 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 : :class:`Field` + **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``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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 : anyOf(:class:`Text`, 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` + 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/TypedFieldDef'} + + def __init__(self, aggregate=Undefined, bandPosition=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(TypedFieldDef, self).__init__(aggregate=aggregate, bandPosition=bandPosition, bin=bin, + field=field, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class URI(VegaLiteSchema): + """URI schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/URI'} + + def __init__(self, *args): + super(URI, self).__init__(*args) + + +class UnitSpec(VegaLiteSchema): + """UnitSpec schema wrapper + + Mapping(required=[mark]) + Base interface for a unit (single-view) specification. + + Attributes + ---------- + + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and + ``"text"`` ) or a `mark definition object + `__. + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + encoding : :class:`Encoding` + A key-value mapping between encoding channels and definition of fields. + name : string + Name of the visualization for later reference. + params : List(anyOf(:class:`VariableParameter`, :class:`SelectionParameter`)) + An array of parameters that may either be simple variables, or more complex + selections that map user input to data queries. + projection : :class:`Projection` + An object defining properties of geographic projection, which will be applied to + ``shape`` path for ``"geoshape"`` marks and to ``latitude`` and ``"longitude"`` + channels for other marks. + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/UnitSpec'} + + def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + name=Undefined, params=Undefined, projection=Undefined, title=Undefined, + transform=Undefined, **kwds): + super(UnitSpec, self).__init__(mark=mark, data=data, description=description, encoding=encoding, + name=name, params=params, projection=projection, title=title, + transform=transform, **kwds) + + +class UnitSpecWithFrame(VegaLiteSchema): + """UnitSpecWithFrame schema wrapper + + Mapping(required=[mark]) + + Attributes + ---------- + + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and + ``"text"`` ) or a `mark definition object + `__. + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + encoding : :class:`Encoding` + A key-value mapping between encoding channels and definition of fields. + height : anyOf(float, string, :class:`Step`) + The height of a visualization. + + + * For a plot with a continuous y-field, height should be a number. + * For a plot with either a discrete y-field or no y-field, height can be either a + number indicating a fixed height or an object in the form of ``{step: number}`` + defining the height per discrete step. (No y-field is equivalent to having one + discrete step.) + * To enable responsive sizing on height, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. + + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + params : List(anyOf(:class:`VariableParameter`, :class:`SelectionParameter`)) + An array of parameters that may either be simple variables, or more complex + selections that map user input to data queries. + projection : :class:`Projection` + An object defining properties of geographic projection, which will be applied to + ``shape`` path for ``"geoshape"`` marks and to ``latitude`` and ``"longitude"`` + channels for other marks. + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. + + + * For a plot with a continuous x-field, width should be a number. + * For a plot with either a discrete x-field or no x-field, width can be either a + number indicating a fixed width or an object in the form of ``{step: number}`` + defining the width per discrete step. (No x-field is equivalent to having one + discrete step.) + * To enable responsive sizing on width, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. + + **See also:** `width `__ + documentation. + """ + _schema = {'$ref': '#/definitions/UnitSpecWithFrame'} + + def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, params=Undefined, projection=Undefined, + title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds): + super(UnitSpecWithFrame, self).__init__(mark=mark, data=data, description=description, + encoding=encoding, height=height, name=name, + params=params, projection=projection, title=title, + transform=transform, view=view, width=width, **kwds) + + +class UrlData(DataSource): + """UrlData schema wrapper + + Mapping(required=[url]) + + Attributes + ---------- + + url : string + An URL from which to load the data set. Use the ``format.type`` property to ensure + the loaded data is correctly parsed. + format : :class:`DataFormat` + An object that specifies the format for parsing the data. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/UrlData'} + + def __init__(self, url=Undefined, format=Undefined, name=Undefined, **kwds): + super(UrlData, self).__init__(url=url, format=format, name=name, **kwds) + + +class UtcMultiTimeUnit(MultiTimeUnit): + """UtcMultiTimeUnit schema wrapper + + enum('utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', + 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', + 'utcyearmonthdatehoursminutesseconds', 'utcyearweek', 'utcyearweekday', + 'utcyearweekdayhours', 'utcyearweekdayhoursminutes', 'utcyearweekdayhoursminutesseconds', + 'utcyeardayofyear', 'utcquartermonth', 'utcmonthdate', 'utcmonthdatehours', + 'utcmonthdatehoursminutes', 'utcmonthdatehoursminutesseconds', 'utcweekday', + 'utcweeksdayhours', 'utcweekdayhoursminutes', 'utcweekdayhoursminutesseconds', + 'utcdayhours', 'utcdayhoursminutes', 'utcdayhoursminutesseconds', 'utchoursminutes', + 'utchoursminutesseconds', 'utcminutesseconds', 'utcsecondsmilliseconds') + """ + _schema = {'$ref': '#/definitions/UtcMultiTimeUnit'} + + def __init__(self, *args): + super(UtcMultiTimeUnit, self).__init__(*args) + + +class UtcSingleTimeUnit(SingleTimeUnit): + """UtcSingleTimeUnit schema wrapper + + enum('utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', + 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds') + """ + _schema = {'$ref': '#/definitions/UtcSingleTimeUnit'} + + def __init__(self, *args): + super(UtcSingleTimeUnit, self).__init__(*args) + + +class VConcatSpecGenericSpec(Spec, NonNormalizedSpec): + """VConcatSpecGenericSpec schema wrapper + + Mapping(required=[vconcat]) + Base interface for a vertical concatenation specification. + + Attributes + ---------- + + vconcat : List(:class:`Spec`) + A list of views to be concatenated and put into a column. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + data : anyOf(:class:`Data`, None) + An object describing the data source. Set to ``null`` to ignore the parent's data + source. If no data is set, it is derived from the parent. + description : string + Description of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : float + The spacing in pixels between sub-views of the concat operator. + + **Default value** : ``10`` + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/VConcatSpec'} + + def __init__(self, vconcat=Undefined, bounds=Undefined, center=Undefined, data=Undefined, + description=Undefined, name=Undefined, resolve=Undefined, spacing=Undefined, + title=Undefined, transform=Undefined, **kwds): + super(VConcatSpecGenericSpec, self).__init__(vconcat=vconcat, bounds=bounds, center=center, + data=data, description=description, name=name, + resolve=resolve, spacing=spacing, title=title, + transform=transform, **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull(ColorDef, MarkPropDefGradientstringnull): + """ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, self).__init__(condition=condition, + value=value, + **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull(MarkPropDefstringnullTypeForShape, ShapeDef): + """ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition,(string|null)>'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull, self).__init__(condition=condition, + value=value, + **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefnumber(MarkPropDefnumber, NumericMarkPropDef): + """ValueDefWithConditionMarkPropFieldOrDatumDefnumber schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldOrDatumDefnumber, self).__init__(condition=condition, + value=value, **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray(MarkPropDefnumberArray, NumericArrayMarkPropDef): + """ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(List(float), :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray, self).__init__(condition=condition, + value=value, + **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefstringnull(VegaLiteSchema): + """ValueDefWithConditionMarkPropFieldOrDatumDefstringnull schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldOrDatumDefstringnull, self).__init__(condition=condition, + value=value, **kwds) + + +class ValueDefWithConditionStringFieldDefText(TextDef): + """ValueDefWithConditionStringFieldDefText schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalStringFieldDef`, + :class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) + A field definition or one or more value definition(s) with a parameter predicate. + value : anyOf(:class:`Text`, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionStringFieldDefText, self).__init__(condition=condition, value=value, + **kwds) + + +class ValueDefnumber(OffsetDef): + """ValueDefnumber schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDef'} + + def __init__(self, value=Undefined, **kwds): + super(ValueDefnumber, self).__init__(value=value, **kwds) + + +class ValueDefnumberwidthheightExprRef(VegaLiteSchema): + """ValueDefnumberwidthheightExprRef schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDef<(number|"width"|"height"|ExprRef)>'} + + def __init__(self, value=Undefined, **kwds): + super(ValueDefnumberwidthheightExprRef, self).__init__(value=value, **kwds) + + +class VariableParameter(VegaLiteSchema): + """VariableParameter schema wrapper + + Mapping(required=[name]) + + Attributes + ---------- + + name : :class:`ParameterName` + A unique name for the variable parameter. Parameter names should be valid JavaScript + identifiers: they should contain only alphanumeric characters (or "$", or "_") and + may not start with a digit. Reserved keywords that may not be used as parameter + names are "datum", "event", "item", and "parent". + bind : :class:`Binding` + Binds the parameter to an external input element such as a slider, selection list or + radio button group. + expr : :class:`Expr` + An expression for the value of the parameter. This expression may include other + parameters, in which case the parameter will automatically update in response to + upstream parameter changes. + value : Any + The `initial value `__ of the + parameter. + + **Default value:** ``undefined`` + """ + _schema = {'$ref': '#/definitions/VariableParameter'} + + def __init__(self, name=Undefined, bind=Undefined, expr=Undefined, value=Undefined, **kwds): + super(VariableParameter, self).__init__(name=name, bind=bind, expr=expr, value=value, **kwds) + + +class Vector10string(VegaLiteSchema): + """Vector10string schema wrapper + + List(string) + """ + _schema = {'$ref': '#/definitions/Vector10'} + + def __init__(self, *args): + super(Vector10string, self).__init__(*args) + + +class Vector12string(VegaLiteSchema): + """Vector12string schema wrapper + + List(string) + """ + _schema = {'$ref': '#/definitions/Vector12'} + + def __init__(self, *args): + super(Vector12string, self).__init__(*args) + + +class Vector2DateTime(SelectionInitInterval): + """Vector2DateTime schema wrapper + + List(:class:`DateTime`) + """ + _schema = {'$ref': '#/definitions/Vector2'} + + def __init__(self, *args): + super(Vector2DateTime, self).__init__(*args) + + +class Vector2Vector2number(VegaLiteSchema): + """Vector2Vector2number schema wrapper + + List(:class:`Vector2number`) + """ + _schema = {'$ref': '#/definitions/Vector2>'} + + def __init__(self, *args): + super(Vector2Vector2number, self).__init__(*args) + + +class Vector2boolean(SelectionInitInterval): + """Vector2boolean schema wrapper + + List(boolean) + """ + _schema = {'$ref': '#/definitions/Vector2'} + + def __init__(self, *args): + super(Vector2boolean, self).__init__(*args) + + +class Vector2number(SelectionInitInterval): + """Vector2number schema wrapper + + List(float) + """ + _schema = {'$ref': '#/definitions/Vector2'} + + def __init__(self, *args): + super(Vector2number, self).__init__(*args) + + +class Vector2string(SelectionInitInterval): + """Vector2string schema wrapper + + List(string) + """ + _schema = {'$ref': '#/definitions/Vector2'} + + def __init__(self, *args): + super(Vector2string, self).__init__(*args) + + +class Vector3number(VegaLiteSchema): + """Vector3number schema wrapper + + List(float) + """ + _schema = {'$ref': '#/definitions/Vector3'} + + def __init__(self, *args): + super(Vector3number, self).__init__(*args) + + +class Vector7string(VegaLiteSchema): + """Vector7string schema wrapper + + List(string) + """ + _schema = {'$ref': '#/definitions/Vector7'} + + def __init__(self, *args): + super(Vector7string, self).__init__(*args) + + +class ViewBackground(VegaLiteSchema): + """ViewBackground schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + cornerRadius : anyOf(float, :class:`ExprRef`) + + cursor : :class:`Cursor` + The mouse cursor used over the view. Any valid `CSS cursor type + `__ can be used. + fill : anyOf(:class:`Color`, None, :class:`ExprRef`) + The fill color. + + **Default value:** ``undefined`` + fillOpacity : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). + + **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, + ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. + stroke : anyOf(:class:`Color`, None, :class:`ExprRef`) + The stroke color. + + **Default value:** ``"#ddd"`` + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + style : anyOf(string, List(string)) + A string or array of strings indicating the name of custom styles to apply to the + view background. A style is a named collection of mark property defaults defined + within the `style configuration + `__. If style is an + array, later styles will override earlier styles. + + **Default value:** ``"cell"`` **Note:** Any specified view background properties + will augment the default style. + """ + _schema = {'$ref': '#/definitions/ViewBackground'} + + def __init__(self, cornerRadius=Undefined, cursor=Undefined, fill=Undefined, fillOpacity=Undefined, + opacity=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, **kwds): + super(ViewBackground, self).__init__(cornerRadius=cornerRadius, cursor=cursor, fill=fill, + fillOpacity=fillOpacity, opacity=opacity, stroke=stroke, + strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + style=style, **kwds) + + +class ViewConfig(VegaLiteSchema): + """ViewConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + clip : boolean + Whether the view should be clipped. + continuousHeight : float + The default height when the plot has a continuous y-field for x or latitude, or has + arc marks. + + **Default value:** ``200`` + continuousWidth : float + The default width when the plot has a continuous field for x or longitude, or has + arc marks. + + **Default value:** ``200`` + cornerRadius : anyOf(float, :class:`ExprRef`) + + cursor : :class:`Cursor` + The mouse cursor used over the view. Any valid `CSS cursor type + `__ can be used. + discreteHeight : anyOf(float, Mapping(required=[step])) + The default height when the plot has non arc marks and either a discrete y-field or + no y-field. The height can be either a number indicating a fixed height or an object + in the form of ``{step: number}`` defining the height per discrete step. + + **Default value:** a step size based on ``config.view.step``. + discreteWidth : anyOf(float, Mapping(required=[step])) + The default width when the plot has non-arc marks and either a discrete x-field or + no x-field. The width can be either a number indicating a fixed width or an object + in the form of ``{step: number}`` defining the width per discrete step. + + **Default value:** a step size based on ``config.view.step``. + fill : anyOf(:class:`Color`, None, :class:`ExprRef`) + The fill color. + + **Default value:** ``undefined`` + fillOpacity : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). + + **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, + ``circle``, or ``square`` marks or layered ``bar`` charts and ``1`` otherwise. + step : float + Default step size for x-/y- discrete fields. + stroke : anyOf(:class:`Color`, None, :class:`ExprRef`) + The stroke color. + + **Default value:** ``"#ddd"`` + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + """ + _schema = {'$ref': '#/definitions/ViewConfig'} + + def __init__(self, clip=Undefined, continuousHeight=Undefined, continuousWidth=Undefined, + cornerRadius=Undefined, cursor=Undefined, discreteHeight=Undefined, + discreteWidth=Undefined, fill=Undefined, fillOpacity=Undefined, opacity=Undefined, + step=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, **kwds): + super(ViewConfig, self).__init__(clip=clip, continuousHeight=continuousHeight, + continuousWidth=continuousWidth, cornerRadius=cornerRadius, + cursor=cursor, discreteHeight=discreteHeight, + discreteWidth=discreteWidth, fill=fill, + fillOpacity=fillOpacity, opacity=opacity, step=step, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, **kwds) + + +class WindowEventType(VegaLiteSchema): + """WindowEventType schema wrapper + + anyOf(:class:`EventType`, string) + """ + _schema = {'$ref': '#/definitions/WindowEventType'} + + def __init__(self, *args, **kwds): + super(WindowEventType, self).__init__(*args, **kwds) + + +class EventType(WindowEventType): + """EventType schema wrapper + + enum('click', 'dblclick', 'dragenter', 'dragleave', 'dragover', 'keydown', 'keypress', + 'keyup', 'mousedown', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'mousewheel', + 'timer', 'touchend', 'touchmove', 'touchstart', 'wheel') + """ + _schema = {'$ref': '#/definitions/EventType'} + + def __init__(self, *args): + super(EventType, self).__init__(*args) + + +class WindowFieldDef(VegaLiteSchema): + """WindowFieldDef schema wrapper + + Mapping(required=[op, as]) + + Attributes + ---------- + + op : anyOf(:class:`AggregateOp`, :class:`WindowOnlyOp`) + The window or aggregation operation to apply within a window (e.g., ``"rank"``, + ``"lead"``, ``"sum"``, ``"average"`` or ``"count"`` ). See the list of all supported + operations `here `__. + field : :class:`FieldName` + The data field for which to compute the aggregate or window function. This can be + omitted for window functions that do not operate over a field such as ``"count"``, + ``"rank"``, ``"dense_rank"``. + param : float + Parameter values for the window functions. Parameter values can be omitted for + operations that do not accept a parameter. + + See the list of all supported operations and their parameters `here + `__. + as : :class:`FieldName` + The output name for the window operation. + """ + _schema = {'$ref': '#/definitions/WindowFieldDef'} + + def __init__(self, op=Undefined, field=Undefined, param=Undefined, **kwds): + super(WindowFieldDef, self).__init__(op=op, field=field, param=param, **kwds) + + +class WindowOnlyOp(VegaLiteSchema): + """WindowOnlyOp schema wrapper + + enum('row_number', 'rank', 'dense_rank', 'percent_rank', 'cume_dist', 'ntile', 'lag', + 'lead', 'first_value', 'last_value', 'nth_value') + """ + _schema = {'$ref': '#/definitions/WindowOnlyOp'} + + def __init__(self, *args): + super(WindowOnlyOp, self).__init__(*args) + + +class WindowTransform(Transform): + """WindowTransform schema wrapper + + Mapping(required=[window]) + + Attributes + ---------- + + window : List(:class:`WindowFieldDef`) + The definition of the fields in the window, and what calculations to use. + frame : List(anyOf(None, float)) + A frame specification as a two-element array indicating how the sliding window + should proceed. The array entries should either be a number indicating the offset + from the current data object, or null to indicate unbounded rows preceding or + following the current data object. The default value is ``[null, 0]``, indicating + that the sliding window includes the current object and all preceding objects. The + value ``[-5, 5]`` indicates that the window should include five objects preceding + and five objects following the current object. Finally, ``[null, null]`` indicates + that the window frame should always include all data objects. If you this frame and + want to assign the same value to add objects, you can use the simpler `join + aggregate transform `__. + The only operators affected are the aggregation operations and the ``first_value``, + ``last_value``, and ``nth_value`` window operations. The other window operations are + not affected by this. + + **Default value:** : ``[null, 0]`` (includes the current object and all preceding + objects) + groupby : List(:class:`FieldName`) + The data fields for partitioning the data objects into separate windows. If + unspecified, all data points will be in a single window. + ignorePeers : boolean + Indicates if the sliding window frame should ignore peer values (data that are + considered identical by the sort criteria). The default is false, causing the window + frame to expand to include all peer values. If set to true, the window frame will be + defined by offset values only. This setting only affects those operations that + depend on the window frame, namely aggregation operations and the first_value, + last_value, and nth_value window operations. + + **Default value:** ``false`` + sort : List(:class:`SortField`) + A sort field definition for sorting data objects within a window. If two data + objects are considered equal by the comparator, they are considered "peer" values of + equal rank. If sort is not specified, the order is undefined: data objects are + processed in the order they are observed and none are considered peers (the + ignorePeers parameter is ignored and treated as if set to ``true`` ). + """ + _schema = {'$ref': '#/definitions/WindowTransform'} + + def __init__(self, window=Undefined, frame=Undefined, groupby=Undefined, ignorePeers=Undefined, + sort=Undefined, **kwds): + super(WindowTransform, self).__init__(window=window, frame=frame, groupby=groupby, + ignorePeers=ignorePeers, sort=sort, **kwds) + diff --git a/altair/vegalite/v5/schema/mixins.py b/altair/vegalite/v5/schema/mixins.py new file mode 100644 index 000000000..5abe99e58 --- /dev/null +++ b/altair/vegalite/v5/schema/mixins.py @@ -0,0 +1,1318 @@ +# The contents of this file are automatically written by +# tools/generate_schema_wrapper.py. Do not modify directly. +from . import core +from altair.utils import use_signature +from altair.utils.schemapi import Undefined + + +class MarkMethodMixin(object): + """A mixin class that defines mark methods""" + + def mark_arc(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, + discreteBandSize=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, + fill=Undefined, fillOpacity=Undefined, filled=Undefined, font=Undefined, + fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, height=Undefined, + href=Undefined, innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, + limit=Undefined, line=Undefined, lineBreak=Undefined, lineHeight=Undefined, + opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, + padAngle=Undefined, point=Undefined, radius=Undefined, radius2=Undefined, + radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, size=Undefined, + smooth=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + theta2Offset=Undefined, thetaOffset=Undefined, thickness=Undefined, + timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, + xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, + **kwds): + """Set the chart's mark to 'arc' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="arc", **kwds) + else: + copy.mark = "arc" + return copy + + def mark_area(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'area' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="area", **kwds) + else: + copy.mark = "area" + return copy + + def mark_bar(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, + discreteBandSize=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, + fill=Undefined, fillOpacity=Undefined, filled=Undefined, font=Undefined, + fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, height=Undefined, + href=Undefined, innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, + limit=Undefined, line=Undefined, lineBreak=Undefined, lineHeight=Undefined, + opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, + padAngle=Undefined, point=Undefined, radius=Undefined, radius2=Undefined, + radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, size=Undefined, + smooth=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + theta2Offset=Undefined, thetaOffset=Undefined, thickness=Undefined, + timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, + xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, + **kwds): + """Set the chart's mark to 'bar' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="bar", **kwds) + else: + copy.mark = "bar" + return copy + + def mark_image(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'image' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="image", **kwds) + else: + copy.mark = "image" + return copy + + def mark_line(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'line' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="line", **kwds) + else: + copy.mark = "line" + return copy + + def mark_point(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'point' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="point", **kwds) + else: + copy.mark = "point" + return copy + + def mark_rect(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'rect' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="rect", **kwds) + else: + copy.mark = "rect" + return copy + + def mark_rule(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'rule' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="rule", **kwds) + else: + copy.mark = "rule" + return copy + + def mark_text(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'text' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="text", **kwds) + else: + copy.mark = "text" + return copy + + def mark_tick(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'tick' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="tick", **kwds) + else: + copy.mark = "tick" + return copy + + def mark_trail(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'trail' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="trail", **kwds) + else: + copy.mark = "trail" + return copy + + def mark_circle(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, + y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'circle' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="circle", **kwds) + else: + copy.mark = "circle" + return copy + + def mark_square(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, shape=Undefined, + size=Undefined, smooth=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, theta2=Undefined, theta2Offset=Undefined, thetaOffset=Undefined, + thickness=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, + y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'square' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="square", **kwds) + else: + copy.mark = "square" + return copy + + def mark_geoshape(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, + ariaRoleDescription=Undefined, aspect=Undefined, bandSize=Undefined, + baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, + cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, + dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, + ellipsis=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, + font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, + height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, + invalid=Undefined, limit=Undefined, line=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + outerRadius=Undefined, padAngle=Undefined, point=Undefined, radius=Undefined, + radius2=Undefined, radius2Offset=Undefined, radiusOffset=Undefined, + shape=Undefined, size=Undefined, smooth=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, + tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + theta2Offset=Undefined, thetaOffset=Undefined, thickness=Undefined, + timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, + xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'geoshape' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, + ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, + baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, color=color, + continuousBandSize=continuousBandSize, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, cornerRadiusEnd=cornerRadiusEnd, + cornerRadiusTopLeft=cornerRadiusTopLeft, cornerRadiusTopRight=cornerRadiusTopRight, + cursor=cursor, description=description, dir=dir, discreteBandSize=discreteBandSize, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, + font=font, fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, innerRadius=innerRadius, interpolate=interpolate, + invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, lineHeight=lineHeight, + opacity=opacity, order=order, orient=orient, outerRadius=outerRadius, + padAngle=padAngle, point=point, radius=radius, radius2=radius2, + radius2Offset=radius2Offset, radiusOffset=radiusOffset, shape=shape, size=size, + smooth=smooth, stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, tension=tension, + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, + timeUnitBandPosition=timeUnitBandPosition, timeUnitBandSize=timeUnitBandSize, + tooltip=tooltip, url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.MarkDef(type="geoshape", **kwds) + else: + copy.mark = "geoshape" + return copy + + def mark_boxplot(self, box=Undefined, clip=Undefined, color=Undefined, extent=Undefined, + median=Undefined, opacity=Undefined, orient=Undefined, outliers=Undefined, + rule=Undefined, size=Undefined, ticks=Undefined, **kwds): + """Set the chart's mark to 'boxplot' + + For information on additional arguments, see :class:`BoxPlotDef` + """ + kwds = dict(box=box, clip=clip, color=color, extent=extent, median=median, opacity=opacity, + orient=orient, outliers=outliers, rule=rule, size=size, ticks=ticks, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.BoxPlotDef(type="boxplot", **kwds) + else: + copy.mark = "boxplot" + return copy + + def mark_errorbar(self, clip=Undefined, color=Undefined, extent=Undefined, opacity=Undefined, + orient=Undefined, rule=Undefined, size=Undefined, thickness=Undefined, + ticks=Undefined, **kwds): + """Set the chart's mark to 'errorbar' + + For information on additional arguments, see :class:`ErrorBarDef` + """ + kwds = dict(clip=clip, color=color, extent=extent, opacity=opacity, orient=orient, rule=rule, + size=size, thickness=thickness, ticks=ticks, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.ErrorBarDef(type="errorbar", **kwds) + else: + copy.mark = "errorbar" + return copy + + def mark_errorband(self, band=Undefined, borders=Undefined, clip=Undefined, color=Undefined, + extent=Undefined, interpolate=Undefined, opacity=Undefined, orient=Undefined, + tension=Undefined, **kwds): + """Set the chart's mark to 'errorband' + + For information on additional arguments, see :class:`ErrorBandDef` + """ + kwds = dict(band=band, borders=borders, clip=clip, color=color, extent=extent, + interpolate=interpolate, opacity=opacity, orient=orient, tension=tension, **kwds) + copy = self.copy(deep=False) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.ErrorBandDef(type="errorband", **kwds) + else: + copy.mark = "errorband" + return copy + + +class ConfigMethodMixin(object): + """A mixin class that defines config methods""" + + @use_signature(core.Config) + def configure(self, *args, **kwargs): + copy = self.copy(deep=False) + copy.config = core.Config(*args, **kwargs) + return copy + + @use_signature(core.RectConfig) + def configure_arc(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["arc"] = core.RectConfig(*args, **kwargs) + return copy + + @use_signature(core.AreaConfig) + def configure_area(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["area"] = core.AreaConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axis(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axis"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisBand(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisBand"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisBottom(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisBottom"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisDiscrete(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisDiscrete"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisLeft(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisLeft"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisPoint(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisPoint"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisQuantitative(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisQuantitative"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisRight(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisRight"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisTemporal(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisTemporal"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisTop(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisTop"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisX(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisX"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisXBand(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisXBand"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisXDiscrete(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisXDiscrete"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisXPoint(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisXPoint"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisXQuantitative(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisXQuantitative"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisXTemporal(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisXTemporal"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisY(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisY"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisYBand(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisYBand"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisYDiscrete(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisYDiscrete"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisYPoint(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisYPoint"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisYQuantitative(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisYQuantitative"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisYTemporal(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisYTemporal"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.BarConfig) + def configure_bar(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["bar"] = core.BarConfig(*args, **kwargs) + return copy + + @use_signature(core.BoxPlotConfig) + def configure_boxplot(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["boxplot"] = core.BoxPlotConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_circle(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["circle"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.CompositionConfig) + def configure_concat(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["concat"] = core.CompositionConfig(*args, **kwargs) + return copy + + @use_signature(core.ErrorBandConfig) + def configure_errorband(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["errorband"] = core.ErrorBandConfig(*args, **kwargs) + return copy + + @use_signature(core.ErrorBarConfig) + def configure_errorbar(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["errorbar"] = core.ErrorBarConfig(*args, **kwargs) + return copy + + @use_signature(core.CompositionConfig) + def configure_facet(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["facet"] = core.CompositionConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_geoshape(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["geoshape"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_header(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["header"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_headerColumn(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["headerColumn"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_headerFacet(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["headerFacet"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_headerRow(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["headerRow"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.RectConfig) + def configure_image(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["image"] = core.RectConfig(*args, **kwargs) + return copy + + @use_signature(core.LegendConfig) + def configure_legend(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["legend"] = core.LegendConfig(*args, **kwargs) + return copy + + @use_signature(core.LineConfig) + def configure_line(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["line"] = core.LineConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_mark(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["mark"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_point(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["point"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.ProjectionConfig) + def configure_projection(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["projection"] = core.ProjectionConfig(*args, **kwargs) + return copy + + @use_signature(core.RangeConfig) + def configure_range(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["range"] = core.RangeConfig(*args, **kwargs) + return copy + + @use_signature(core.RectConfig) + def configure_rect(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["rect"] = core.RectConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_rule(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["rule"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.ScaleConfig) + def configure_scale(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["scale"] = core.ScaleConfig(*args, **kwargs) + return copy + + @use_signature(core.SelectionConfig) + def configure_selection(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["selection"] = core.SelectionConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_square(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["square"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_text(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["text"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.TickConfig) + def configure_tick(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["tick"] = core.TickConfig(*args, **kwargs) + return copy + + @use_signature(core.TitleConfig) + def configure_title(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["title"] = core.TitleConfig(*args, **kwargs) + return copy + + @use_signature(core.LineConfig) + def configure_trail(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["trail"] = core.LineConfig(*args, **kwargs) + return copy + + @use_signature(core.ViewConfig) + def configure_view(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["view"] = core.ViewConfig(*args, **kwargs) + return copy \ No newline at end of file diff --git a/altair/vegalite/v5/schema/vega-lite-schema.json b/altair/vegalite/v5/schema/vega-lite-schema.json new file mode 100644 index 000000000..cedaa872a --- /dev/null +++ b/altair/vegalite/v5/schema/vega-lite-schema.json @@ -0,0 +1,30999 @@ +{ + "$ref": "#/definitions/TopLevelSpec", + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "Aggregate": { + "anyOf": [ + { + "$ref": "#/definitions/NonArgAggregateOp" + }, + { + "$ref": "#/definitions/ArgmaxDef" + }, + { + "$ref": "#/definitions/ArgminDef" + } + ] + }, + "AggregateOp": { + "enum": [ + "argmax", + "argmin", + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep" + ], + "type": "string" + }, + "AggregateTransform": { + "additionalProperties": false, + "properties": { + "aggregate": { + "description": "Array of objects that define fields to aggregate.", + "items": { + "$ref": "#/definitions/AggregatedFieldDef" + }, + "type": "array" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + }, + "required": [ + "aggregate" + ], + "type": "object" + }, + "AggregatedFieldDef": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output field names to use for each aggregated field." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which to compute aggregate function. This is required for all aggregation operations except `\"count\"`." + }, + "op": { + "$ref": "#/definitions/AggregateOp", + "description": "The aggregation operation to apply to the fields (e.g., `\"sum\"`, `\"average\"`, or `\"count\"`). See the [full list of supported aggregation operations](https://vega.github.io/vega-lite/docs/aggregate.html#ops) for more information." + } + }, + "required": [ + "op", + "as" + ], + "type": "object" + }, + "Align": { + "enum": [ + "left", + "center", + "right" + ], + "type": "string" + }, + "AllSortString": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/SortByChannel" + }, + { + "$ref": "#/definitions/SortByChannelDesc" + } + ] + }, + "AnyMark": { + "anyOf": [ + { + "$ref": "#/definitions/CompositeMark" + }, + { + "$ref": "#/definitions/CompositeMarkDef" + }, + { + "$ref": "#/definitions/Mark" + }, + { + "$ref": "#/definitions/MarkDef" + } + ] + }, + "AnyMarkConfig": { + "anyOf": [ + { + "$ref": "#/definitions/MarkConfig" + }, + { + "$ref": "#/definitions/AreaConfig" + }, + { + "$ref": "#/definitions/BarConfig" + }, + { + "$ref": "#/definitions/RectConfig" + }, + { + "$ref": "#/definitions/LineConfig" + }, + { + "$ref": "#/definitions/TickConfig" + } + ] + }, + "AreaConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "line": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + } + ], + "description": "A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines.\n\n- If this value is an empty object (`{}`) or `true`, lines with default properties will be used.\n\n- If this value is `false`, no lines would be automatically added to area marks.\n\n__Default value:__ `false`." + }, + "lineBreak": { + "anyOf": [ + { + "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." + }, + "outerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "point": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + }, + { + "const": "transparent", + "type": "string" + } + ], + "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", + "minimum": 0 + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "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" + }, + "timeUnitBandSize": { + "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "ArgmaxDef": { + "additionalProperties": false, + "properties": { + "argmax": { + "$ref": "#/definitions/FieldName" + } + }, + "required": [ + "argmax" + ], + "type": "object" + }, + "ArgminDef": { + "additionalProperties": false, + "properties": { + "argmin": { + "$ref": "#/definitions/FieldName" + } + }, + "required": [ + "argmin" + ], + "type": "object" + }, + "AutoSizeParams": { + "additionalProperties": false, + "properties": { + "contains": { + "description": "Determines how size calculation should be performed, one of `\"content\"` or `\"padding\"`. The default setting (`\"content\"`) interprets the width and height settings as the data rectangle (plotting) dimensions, to which padding is then added. In contrast, the `\"padding\"` setting includes the padding within the view size calculations, such that the width and height settings indicate the **total** intended size of the view.\n\n__Default value__: `\"content\"`", + "enum": [ + "content", + "padding" + ], + "type": "string" + }, + "resize": { + "description": "A boolean flag indicating if autosize layout should be re-calculated on every view update.\n\n__Default value__: `false`", + "type": "boolean" + }, + "type": { + "$ref": "#/definitions/AutosizeType", + "description": "The sizing format type. One of `\"pad\"`, `\"fit\"`, `\"fit-x\"`, `\"fit-y\"`, or `\"none\"`. See the [autosize type](https://vega.github.io/vega-lite/docs/size.html#autosize) documentation for descriptions of each.\n\n__Default value__: `\"pad\"`" + } + }, + "type": "object" + }, + "AutosizeType": { + "enum": [ + "pad", + "none", + "fit", + "fit-x", + "fit-y" + ], + "type": "string" + }, + "Axis": { + "additionalProperties": false, + "properties": { + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the axis from the ARIA accessibility tree.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "bandPosition": { + "anyOf": [ + { + "description": "An interpolation fraction indicating where, for `band` scales, axis ticks should be positioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5` places ticks in the middle of their bands.\n\n __Default value:__ `0.5`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of this axis for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If the `aria` property is true, for SVG output the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) will be set to this description. If the description is unspecified it will be automatically generated.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domain": { + "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "domainCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for the domain line's ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the domain dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainOpacity": { + "anyOf": [ + { + "description": "Opacity of the axis domain line.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainWidth": { + "anyOf": [ + { + "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "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." + }, + "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`.", + "type": "string" + }, + "grid": { + "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned; otherwise, `false`.", + "type": "boolean" + }, + "gridCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for grid lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gridColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of gridlines.\n\n__Default value:__ `\"lightGray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "gridDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed grid lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumberArray" + } + ] + }, + "gridDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the grid dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "gridOpacity": { + "anyOf": [ + { + "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "gridWidth": { + "anyOf": [ + { + "description": "The grid width, in pixels.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelAlign" + } + ] + }, + "labelAngle": { + "anyOf": [ + { + "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelBaseline" + } + ] + }, + "labelBound": { + "anyOf": [ + { + "description": "Indicates if labels should be hidden if they exceed the axis range. If `false` (the default) no bounds overlap analysis is performed. If `true`, labels will be hidden if they exceed the axis range by more than 1 pixel. If this property is a number, it specifies the pixel tolerance: the maximum amount by which a label bounding box may exceed the axis range.\n\n__Default value:__ `false`.", + "type": [ + "number", + "boolean" + ] + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the tick label, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "labelFlush": { + "description": "Indicates if the first and last axis labels should be aligned flush with the scale range. Flush alignment for a horizontal axis will left-align the first label and right-align the last label. For vertical axes, bottom and top text baselines are applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.", + "type": [ + "boolean", + "number" + ] + }, + "labelFlushOffset": { + "anyOf": [ + { + "description": "Indicates the number of pixels by which to offset flush-adjusted labels. For example, a value of `2` will push flush-adjusted labels 2 pixels outward from the center of the axis. Offsets can help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFont": { + "anyOf": [ + { + "description": "The font of the tick label.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisString" + } + ] + }, + "labelFontSize": { + "anyOf": [ + { + "description": "The font size of the label, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelFontStyle" + } + ] + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of axis tick labels." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelFontWeight" + } + ] + }, + "labelLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line label text or label text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOffset": { + "anyOf": [ + { + "description": "Position offset in pixels to apply to labels, in addition to tickOffset.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelOpacity": { + "anyOf": [ + { + "description": "The opacity of the labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelOverlap": { + "anyOf": [ + { + "$ref": "#/definitions/LabelOverlap" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The strategy to use for resolving overlap of axis labels. If `false` (the default), no overlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing every other label is used (this works well for standard linear axes). If set to `\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log scales; otherwise `false`." + }, + "labelPadding": { + "anyOf": [ + { + "description": "The padding in pixels between labels and ticks.\n\n__Default value:__ `2`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelSeparation": { + "anyOf": [ + { + "description": "The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default `0`). This property is ignored if *labelOverlap* resolution is not enabled.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labels": { + "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "maxExtent": { + "anyOf": [ + { + "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "minExtent": { + "anyOf": [ + { + "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle.\n\n__Default value:__ derived from the [axis config](https://vega.github.io/vega-lite/docs/config.html#facet-scale-config)'s `offset` (`0` by default)" + }, + "orient": { + "anyOf": [ + { + "$ref": "#/definitions/AxisOrient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The orientation of the axis. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`. The orientation can be used to further specialize the axis type (e.g., a y-axis oriented towards the right edge of the chart).\n\n__Default value:__ `\"bottom\"` for x-axes and `\"left\"` for y-axes." + }, + "position": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The anchor position of the axis in pixels. For x-axes with top or bottom orientation, this sets the axis group x coordinate. For y-axes with left or right orientation, this sets the axis group y coordinate.\n\n__Default value__: `0`" + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "A string or array of strings indicating the name of custom styles to apply to the axis. A style is a named collection of axis property defined within the [style configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles.\n\n__Default value:__ (none) __Note:__ Any specified style will augment the default style. For example, an x-axis mark with `\"style\": \"foo\"` will use `config.axisX` and `config.style.foo` (the specified style `\"foo\"` has higher precedence)." + }, + "tickBand": { + "anyOf": [ + { + "description": "For band scales, indicates if ticks and grid lines should be placed at the `\"center\"` of a band (default) or at the band `\"extent\"`s to indicate intervals", + "enum": [ + "center", + "extent" + ], + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for the tick lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the axis's tick.\n\n__Default value:__ `\"gray\"`" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "tickCount": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/TimeInterval" + }, + { + "$ref": "#/definitions/TimeIntervalStep" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are \"nice\" (multiples of 2, 5, 10) and lie within the underlying scale's range.\n\nFor scales of type `\"time\"` or `\"utc\"`, the tick count can instead be a time interval specifier. Legal string values are `\"millisecond\"`, `\"second\"`, `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, an object-valued interval specifier of the form `{\"interval\": \"month\", \"step\": 3}` includes a desired number of interval steps. Here, ticks are generated for each quarter (Jan, Apr, Jul, Oct) boundary.\n\n__Default value__: Determine using a formula `ceil(width/40)` for x and `ceil(height/40)` for y.", + "minimum": 0 + }, + "tickDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed tick mark lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumberArray" + } + ] + }, + "tickDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the tick mark dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickExtra": { + "description": "Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for `band` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with `\"bandPosition\": 1` and an axis `\"padding\"` value of `0`.", + "type": "boolean" + }, + "tickMinStep": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The minimum desired step between axis ticks, in terms of scale domain values. For example, a value of `1` indicates that ticks should not be less than 1 unit apart. If `tickMinStep` is specified, the `tickCount` value will be adjusted, if necessary, to enforce the minimum step value." + }, + "tickOffset": { + "anyOf": [ + { + "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickOpacity": { + "anyOf": [ + { + "description": "Opacity of the ticks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickRound": { + "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "tickSize": { + "anyOf": [ + { + "description": "The size in pixels of axis ticks.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickWidth": { + "anyOf": [ + { + "description": "The width, in pixels, of ticks.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "ticks": { + "description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "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." + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAnchor": { + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAngle": { + "anyOf": [ + { + "description": "Angle in degrees of axis titles.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for axis titles. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of the title, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFont": { + "anyOf": [ + { + "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontSize": { + "anyOf": [ + { + "description": "Font size of the title.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of the title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis titles.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOpacity": { + "anyOf": [ + { + "description": "Opacity of the axis title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titlePadding": { + "anyOf": [ + { + "description": "The padding, in pixels, between title and axis.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleX": { + "anyOf": [ + { + "description": "X-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleY": { + "anyOf": [ + { + "description": "Y-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "translate": { + "anyOf": [ + { + "description": "Coordinate space translation offset for axis layout. By default, axes are translated by a 0.5 pixel offset for both the x and y coordinates in order to align stroked lines with the pixel grid. However, for vector graphics output these pixel-specific adjustments may be undesirable, in which case translate can be changed (for example, to zero).\n\n__Default value:__ `0.5`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "values": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Explicitly set the visible axis tick values." + }, + "zindex": { + "description": "A non-negative integer indicating the z-index of the axis. If zindex is 0, axes should be drawn behind all chart elements. To put them in front, set `zindex` to `1` or more.\n\n__Default value:__ `0` (behind the marks).", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "AxisConfig": { + "additionalProperties": false, + "properties": { + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the axis from the ARIA accessibility tree.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "bandPosition": { + "anyOf": [ + { + "description": "An interpolation fraction indicating where, for `band` scales, axis ticks should be positioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5` places ticks in the middle of their bands.\n\n __Default value:__ `0.5`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of this axis for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If the `aria` property is true, for SVG output the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) will be set to this description. If the description is unspecified it will be automatically generated.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "disable": { + "description": "Disable axis by default.", + "type": "boolean" + }, + "domain": { + "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "domainCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for the domain line's ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the domain dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainOpacity": { + "anyOf": [ + { + "description": "Opacity of the axis domain line.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainWidth": { + "anyOf": [ + { + "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "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." + }, + "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`.", + "type": "string" + }, + "grid": { + "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned; otherwise, `false`.", + "type": "boolean" + }, + "gridCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for grid lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gridColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of gridlines.\n\n__Default value:__ `\"lightGray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "gridDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed grid lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumberArray" + } + ] + }, + "gridDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the grid dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "gridOpacity": { + "anyOf": [ + { + "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "gridWidth": { + "anyOf": [ + { + "description": "The grid width, in pixels.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelAlign" + } + ] + }, + "labelAngle": { + "anyOf": [ + { + "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelBaseline" + } + ] + }, + "labelBound": { + "anyOf": [ + { + "description": "Indicates if labels should be hidden if they exceed the axis range. If `false` (the default) no bounds overlap analysis is performed. If `true`, labels will be hidden if they exceed the axis range by more than 1 pixel. If this property is a number, it specifies the pixel tolerance: the maximum amount by which a label bounding box may exceed the axis range.\n\n__Default value:__ `false`.", + "type": [ + "number", + "boolean" + ] + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the tick label, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "labelFlush": { + "description": "Indicates if the first and last axis labels should be aligned flush with the scale range. Flush alignment for a horizontal axis will left-align the first label and right-align the last label. For vertical axes, bottom and top text baselines are applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.", + "type": [ + "boolean", + "number" + ] + }, + "labelFlushOffset": { + "anyOf": [ + { + "description": "Indicates the number of pixels by which to offset flush-adjusted labels. For example, a value of `2` will push flush-adjusted labels 2 pixels outward from the center of the axis. Offsets can help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFont": { + "anyOf": [ + { + "description": "The font of the tick label.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisString" + } + ] + }, + "labelFontSize": { + "anyOf": [ + { + "description": "The font size of the label, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelFontStyle" + } + ] + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of axis tick labels." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelFontWeight" + } + ] + }, + "labelLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line label text or label text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOffset": { + "anyOf": [ + { + "description": "Position offset in pixels to apply to labels, in addition to tickOffset.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelOpacity": { + "anyOf": [ + { + "description": "The opacity of the labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelOverlap": { + "anyOf": [ + { + "$ref": "#/definitions/LabelOverlap" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The strategy to use for resolving overlap of axis labels. If `false` (the default), no overlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing every other label is used (this works well for standard linear axes). If set to `\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log scales; otherwise `false`." + }, + "labelPadding": { + "anyOf": [ + { + "description": "The padding in pixels between labels and ticks.\n\n__Default value:__ `2`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelSeparation": { + "anyOf": [ + { + "description": "The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default `0`). This property is ignored if *labelOverlap* resolution is not enabled.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labels": { + "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "maxExtent": { + "anyOf": [ + { + "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "minExtent": { + "anyOf": [ + { + "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle.\n\n__Default value:__ derived from the [axis config](https://vega.github.io/vega-lite/docs/config.html#facet-scale-config)'s `offset` (`0` by default)" + }, + "orient": { + "anyOf": [ + { + "$ref": "#/definitions/AxisOrient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The orientation of the axis. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`. The orientation can be used to further specialize the axis type (e.g., a y-axis oriented towards the right edge of the chart).\n\n__Default value:__ `\"bottom\"` for x-axes and `\"left\"` for y-axes." + }, + "position": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The anchor position of the axis in pixels. For x-axes with top or bottom orientation, this sets the axis group x coordinate. For y-axes with left or right orientation, this sets the axis group y coordinate.\n\n__Default value__: `0`" + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "A string or array of strings indicating the name of custom styles to apply to the axis. A style is a named collection of axis property defined within the [style configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles.\n\n__Default value:__ (none) __Note:__ Any specified style will augment the default style. For example, an x-axis mark with `\"style\": \"foo\"` will use `config.axisX` and `config.style.foo` (the specified style `\"foo\"` has higher precedence)." + }, + "tickBand": { + "anyOf": [ + { + "description": "For band scales, indicates if ticks and grid lines should be placed at the `\"center\"` of a band (default) or at the band `\"extent\"`s to indicate intervals", + "enum": [ + "center", + "extent" + ], + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for the tick lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the axis's tick.\n\n__Default value:__ `\"gray\"`" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "tickCount": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/TimeInterval" + }, + { + "$ref": "#/definitions/TimeIntervalStep" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are \"nice\" (multiples of 2, 5, 10) and lie within the underlying scale's range.\n\nFor scales of type `\"time\"` or `\"utc\"`, the tick count can instead be a time interval specifier. Legal string values are `\"millisecond\"`, `\"second\"`, `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, an object-valued interval specifier of the form `{\"interval\": \"month\", \"step\": 3}` includes a desired number of interval steps. Here, ticks are generated for each quarter (Jan, Apr, Jul, Oct) boundary.\n\n__Default value__: Determine using a formula `ceil(width/40)` for x and `ceil(height/40)` for y.", + "minimum": 0 + }, + "tickDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed tick mark lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumberArray" + } + ] + }, + "tickDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the tick mark dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickExtra": { + "description": "Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for `band` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with `\"bandPosition\": 1` and an axis `\"padding\"` value of `0`.", + "type": "boolean" + }, + "tickMinStep": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The minimum desired step between axis ticks, in terms of scale domain values. For example, a value of `1` indicates that ticks should not be less than 1 unit apart. If `tickMinStep` is specified, the `tickCount` value will be adjusted, if necessary, to enforce the minimum step value." + }, + "tickOffset": { + "anyOf": [ + { + "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickOpacity": { + "anyOf": [ + { + "description": "Opacity of the ticks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickRound": { + "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "tickSize": { + "anyOf": [ + { + "description": "The size in pixels of axis ticks.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickWidth": { + "anyOf": [ + { + "description": "The width, in pixels, of ticks.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "ticks": { + "description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "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." + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAnchor": { + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAngle": { + "anyOf": [ + { + "description": "Angle in degrees of axis titles.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for axis titles. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of the title, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFont": { + "anyOf": [ + { + "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontSize": { + "anyOf": [ + { + "description": "Font size of the title.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of the title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis titles.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOpacity": { + "anyOf": [ + { + "description": "Opacity of the axis title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titlePadding": { + "anyOf": [ + { + "description": "The padding, in pixels, between title and axis.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleX": { + "anyOf": [ + { + "description": "X-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleY": { + "anyOf": [ + { + "description": "Y-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "translate": { + "anyOf": [ + { + "description": "Coordinate space translation offset for axis layout. By default, axes are translated by a 0.5 pixel offset for both the x and y coordinates in order to align stroked lines with the pixel grid. However, for vector graphics output these pixel-specific adjustments may be undesirable, in which case translate can be changed (for example, to zero).\n\n__Default value:__ `0.5`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "values": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Explicitly set the visible axis tick values." + }, + "zindex": { + "description": "A non-negative integer indicating the z-index of the axis. If zindex is 0, axes should be drawn behind all chart elements. To put them in front, set `zindex` to `1` or more.\n\n__Default value:__ `0` (behind the marks).", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "AxisOrient": { + "enum": [ + "top", + "bottom", + "left", + "right" + ], + "type": "string" + }, + "AxisResolveMap": { + "additionalProperties": false, + "properties": { + "x": { + "$ref": "#/definitions/ResolveMode" + }, + "y": { + "$ref": "#/definitions/ResolveMode" + } + }, + "type": "object" + }, + "BarConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "binSpacing": { + "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "continuousBandSize": { + "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusEnd": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For vertical bars, top-left and top-right corner radius.\n\n- For horizontal bars, top-right and bottom-right corner radius." + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "discreteBandSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RelativeBandSize" + } + ], + "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.", + "minimum": 0 + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." + }, + "outerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", + "minimum": 0 + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "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" + }, + "timeUnitBandSize": { + "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "BaseTitleNoValueRefs": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for title text. One of `\"left\"`, `\"center\"`, or `\"right\"`." + }, + "anchor": { + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "The anchor position for placing the title and subtitle text. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "angle": { + "anyOf": [ + { + "description": "Angle in degrees of title and subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the title from the ARIA accessibility tree.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for title and subtitle text. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." + }, + "color": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Text color for title text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "Delta offset for title and subtitle text x-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "Delta offset for title and subtitle text y-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "font": { + "anyOf": [ + { + "description": "Font name for title text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "Font size in pixels for title text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for title text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "Font weight for title text. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "frame": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/TitleFrame" + }, + { + "type": "string" + } + ], + "description": "The reference frame for the anchor position, one of `\"bounds\"` (to anchor relative to the full bounding box) or `\"group\"` (to anchor relative to the group width or height)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum allowed length in pixels of title and subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "anyOf": [ + { + "description": "The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "orient": { + "anyOf": [ + { + "$ref": "#/definitions/TitleOrient", + "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Text color for subtitle text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFont": { + "anyOf": [ + { + "description": "Font name for subtitle text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontSize": { + "anyOf": [ + { + "description": "Font size in pixels for subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for subtitle text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "Font weight for subtitle text. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitlePadding": { + "anyOf": [ + { + "description": "The padding in pixels between title and subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "zindex": { + "anyOf": [ + { + "description": "The integer z-index indicating the layering of the title group relative to other axis, mark, and legend groups.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + } + }, + "type": "object" + }, + "Baseline": { + "enum": [ + "top", + "middle", + "bottom" + ], + "type": "string" + }, + "BinExtent": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + { + "$ref": "#/definitions/ParameterExtent" + } + ] + }, + "BinParams": { + "additionalProperties": false, + "description": "Binning properties or boolean flag for determining whether to bin data or not.", + "properties": { + "anchor": { + "description": "A value in the binned domain at which to anchor the bins, shifting the bin boundaries if necessary to ensure that a boundary aligns with the anchor value.\n\n__Default value:__ the minimum bin extent value", + "type": "number" + }, + "base": { + "description": "The number base to use for automatic bin determination (default is base 10).\n\n__Default value:__ `10`", + "type": "number" + }, + "binned": { + "description": "When set to `true`, Vega-Lite treats the input data as already binned.", + "type": "boolean" + }, + "divide": { + "description": "Scale factors indicating allowable subdivisions. The default value is [5, 2], which indicates that for base 10 numbers (the default base), the method may consider dividing bin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the given constraints.\n\n__Default value:__ `[5, 2]`", + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 1, + "type": "array" + }, + "extent": { + "$ref": "#/definitions/BinExtent", + "description": "A two-element (`[min, max]`) array indicating the range of desired bin values." + }, + "maxbins": { + "description": "Maximum number of bins.\n\n__Default value:__ `6` for `row`, `column` and `shape` channels; `10` for other channels", + "minimum": 2, + "type": "number" + }, + "minstep": { + "description": "A minimum allowable step size (particularly useful for integer values).", + "type": "number" + }, + "nice": { + "description": "If true, attempts to make the bin boundaries use human-friendly boundaries, such as multiples of ten.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "step": { + "description": "An exact step size to use between bins.\n\n__Note:__ If provided, options such as maxbins will be ignored.", + "type": "number" + }, + "steps": { + "description": "An array of allowable step sizes to choose from.", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "BinTransform": { + "additionalProperties": false, + "properties": { + "as": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + ], + "description": "The output fields at which to write the start and end bin values. This can be either a string or an array of strings with two elements denoting the name for the fields for bin start and bin end respectively. If a single string (e.g., `\"val\"`) is provided, the end field will be `\"val_end\"`." + }, + "bin": { + "anyOf": [ + { + "const": true, + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + } + ], + "description": "An object indicating bin properties, or simply `true` for using default bin parameters." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field to bin." + } + }, + "required": [ + "bin", + "field", + "as" + ], + "type": "object" + }, + "BindCheckbox": { + "additionalProperties": false, + "properties": { + "debounce": { + "description": "If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.", + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element", + "description": "An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view." + }, + "input": { + "const": "checkbox", + "type": "string" + }, + "name": { + "description": "By default, the signal name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound signal.", + "type": "string" + } + }, + "required": [ + "input" + ], + "type": "object" + }, + "BindDirect": { + "additionalProperties": false, + "properties": { + "debounce": { + "description": "If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.", + "type": "number" + }, + "element": { + "anyOf": [ + { + "$ref": "#/definitions/Element" + }, + { + "additionalProperties": false, + "type": "object" + } + ], + "description": "An input element that exposes a _value_ property and supports the [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) interface, or a CSS selector string to such an element. When the element updates and dispatches an event, the _value_ property will be used as the new, bound signal value. When the signal updates independent of the element, the _value_ property will be set to the signal value and a new event will be dispatched on the element." + }, + "event": { + "description": "The event (default `\"input\"`) to listen for to track changes on the external element.", + "type": "string" + } + }, + "required": [ + "element" + ], + "type": "object" + }, + "BindInput": { + "additionalProperties": false, + "properties": { + "autocomplete": { + "description": "A hint for form autofill. See the [HTML autocomplete attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for additional information.", + "type": "string" + }, + "debounce": { + "description": "If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.", + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element", + "description": "An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view." + }, + "input": { + "description": "The type of input element to use. The valid values are `\"checkbox\"`, `\"radio\"`, `\"range\"`, `\"select\"`, and any other legal [HTML form input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).", + "type": "string" + }, + "name": { + "description": "By default, the signal name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound signal.", + "type": "string" + }, + "placeholder": { + "description": "Text that appears in the form control when it has no value set.", + "type": "string" + } + }, + "type": "object" + }, + "BindRadioSelect": { + "additionalProperties": false, + "properties": { + "debounce": { + "description": "If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.", + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element", + "description": "An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view." + }, + "input": { + "enum": [ + "radio", + "select" + ], + "type": "string" + }, + "labels": { + "description": "An array of label strings to represent the `options` values. If unspecified, the `options` value will be coerced to a string and used as the label.", + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "description": "By default, the signal name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound signal.", + "type": "string" + }, + "options": { + "description": "An array of options to select from.", + "items": {}, + "type": "array" + } + }, + "required": [ + "input", + "options" + ], + "type": "object" + }, + "BindRange": { + "additionalProperties": false, + "properties": { + "debounce": { + "description": "If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.", + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element", + "description": "An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view." + }, + "input": { + "const": "range", + "type": "string" + }, + "max": { + "description": "Sets the maximum slider value. Defaults to the larger of the signal value and `100`.", + "type": "number" + }, + "min": { + "description": "Sets the minimum slider value. Defaults to the smaller of the signal value and `0`.", + "type": "number" + }, + "name": { + "description": "By default, the signal name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound signal.", + "type": "string" + }, + "step": { + "description": "Sets the minimum slider increment. If undefined, the step size will be automatically determined based on the `min` and `max` values.", + "type": "number" + } + }, + "required": [ + "input" + ], + "type": "object" + }, + "Binding": { + "anyOf": [ + { + "$ref": "#/definitions/BindCheckbox" + }, + { + "$ref": "#/definitions/BindRadioSelect" + }, + { + "$ref": "#/definitions/BindRange" + }, + { + "$ref": "#/definitions/BindInput" + }, + { + "$ref": "#/definitions/BindDirect" + } + ] + }, + "Blend": { + "enum": [ + null, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity" + ], + "type": [ + "null", + "string" + ] + }, + "BoxPlot": { + "const": "boxplot", + "type": "string" + }, + "BoxPlotConfig": { + "additionalProperties": false, + "properties": { + "box": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "extent": { + "anyOf": [ + { + "const": "min-max", + "type": "string" + }, + { + "type": "number" + } + ], + "description": "The extent of the whiskers. Available options include:\n- `\"min-max\"`: min and max are the lower and upper whiskers respectively.\n- A number representing multiple of the interquartile range. This number will be multiplied by the IQR to determine whisker boundary, which spans from the smallest data to the largest data within the range _[Q1 - k * IQR, Q3 + k * IQR]_ where _Q1_ and _Q3_ are the first and third quartiles while _IQR_ is the interquartile range (_Q3-Q1_).\n\n__Default value:__ `1.5`." + }, + "median": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "outliers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "size": { + "description": "Size of the box and median tick of a box plot", + "type": "number" + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + } + }, + "type": "object" + }, + "BoxPlotDef": { + "additionalProperties": false, + "properties": { + "box": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "extent": { + "anyOf": [ + { + "const": "min-max", + "type": "string" + }, + { + "type": "number" + } + ], + "description": "The extent of the whiskers. Available options include:\n- `\"min-max\"`: min and max are the lower and upper whiskers respectively.\n- A number representing multiple of the interquartile range. This number will be multiplied by the IQR to determine whisker boundary, which spans from the smallest data to the largest data within the range _[Q1 - k * IQR, Q3 + k * IQR]_ where _Q1_ and _Q3_ are the first and third quartiles while _IQR_ is the interquartile range (_Q3-Q1_).\n\n__Default value:__ `1.5`." + }, + "median": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "Orientation of the box plot. This is normally automatically determined based on types of fields on x and y channels. However, an explicit `orient` be specified when the orientation is ambiguous.\n\n__Default value:__ `\"vertical\"`." + }, + "outliers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "size": { + "description": "Size of the box and median tick of a box plot", + "type": "number" + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "type": { + "$ref": "#/definitions/BoxPlot", + "description": "The mark type. This could a primitive mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`) or a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "BrushConfig": { + "additionalProperties": false, + "properties": { + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the interval mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + "fill": { + "$ref": "#/definitions/Color", + "description": "The fill color of the interval mark.\n\n__Default value:__ `\"#333333\"`" + }, + "fillOpacity": { + "description": "The fill opacity of the interval mark (a value between `0` and `1`).\n\n__Default value:__ `0.125`", + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "The stroke color of the interval mark.\n\n__Default value:__ `\"#ffffff\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke and space lengths, for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) with which to begin drawing the stroke dash array.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity of the interval mark (a value between `0` and `1`).", + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width of the interval mark.", + "type": "number" + } + }, + "type": "object" + }, + "CalculateTransform": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The field for storing the computed formula value." + }, + "calculate": { + "description": "A [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string. Use the variable `datum` to refer to the current data object.", + "type": "string" + } + }, + "required": [ + "calculate", + "as" + ], + "type": "object" + }, + "Categorical": { + "enum": [ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20" + ], + "type": "string" + }, + "Color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorName" + }, + { + "$ref": "#/definitions/HexColor" + }, + { + "type": "string" + } + ] + }, + "ColorDef": { + "$ref": "#/definitions/MarkPropDef<(Gradient|string|null)>" + }, + "ColorName": { + "enum": [ + "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" + ], + "type": "string" + }, + "ColorScheme": { + "anyOf": [ + { + "$ref": "#/definitions/Categorical" + }, + { + "$ref": "#/definitions/SequentialSingleHue" + }, + { + "$ref": "#/definitions/SequentialMultiHue" + }, + { + "$ref": "#/definitions/Diverging" + }, + { + "$ref": "#/definitions/Cyclical" + } + ] + }, + "Encoding": { + "additionalProperties": false, + "properties": { + "angle": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Rotation angle of point and text marks." + }, + "color": { + "$ref": "#/definitions/ColorDef", + "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition. By default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`, `\"text\"`, `\"trail\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ 1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. The `fill` or `stroke` encodings have higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified. 2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "description": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "A text description of this mark for ARIA accessibility (SVG output only). For SVG output the `\"aria-label\"` attribute will be set to this description." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + { + "items": { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + "type": "array" + } + ], + "description": "Additional levels of detail for grouping data in aggregate views and in line, trail, and area marks without mapping data to a specific visual channel." + }, + "fill": { + "$ref": "#/definitions/ColorDef", + "description": "Fill color of the marks. __Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ The `fill` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." + }, + "fillOpacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Fill opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `fillOpacity` property." + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "A URL to load upon mouse click." + }, + "key": { + "$ref": "#/definitions/FieldDefWithoutScale", + "description": "A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data." + }, + "latitude": { + "$ref": "#/definitions/LatLongDef", + "description": "Latitude position of geographically projected marks." + }, + "latitude2": { + "$ref": "#/definitions/Position2Def", + "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "longitude": { + "$ref": "#/definitions/LatLongDef", + "description": "Longitude position of geographically projected marks." + }, + "longitude2": { + "$ref": "#/definitions/Position2Def", + "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "opacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `opacity` property." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/OrderValueDef" + } + ], + "description": "Order of the marks.\n- For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#order).\n- For line and trail marks, this `order` channel encodes order of data points in the lines. This can be useful for creating [a connected scatterplot](https://vega.github.io/vega-lite/examples/connected_scatterplot.html). Setting `order` to `{\"value\": null}` makes the line marks use the original order in the data sources.\n- Otherwise, this `order` channel encodes layer order of the marks.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." + }, + "radius": { + "$ref": "#/definitions/PolarDef", + "description": "The outer radius in pixels of arc marks." + }, + "radius2": { + "$ref": "#/definitions/Position2Def", + "description": "The inner radius in pixels of arc marks." + }, + "shape": { + "$ref": "#/definitions/ShapeDef", + "description": "Shape of the mark.\n\n1. For `point` marks the supported values include: - plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`. - the line symbol `\"stroke\"` - centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"` - a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n2. For `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#point-config)'s `shape` property. (`\"circle\"` if unset.)" + }, + "size": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" + }, + "stroke": { + "$ref": "#/definitions/ColorDef", + "description": "Stroke color of the marks. __Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ The `stroke` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." + }, + "strokeDash": { + "$ref": "#/definitions/NumericArrayMarkPropDef", + "description": "Stroke dash of the marks.\n\n__Default value:__ `[1,0]` (No dash)." + }, + "strokeOpacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Stroke opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `strokeOpacity` property." + }, + "strokeWidth": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Stroke width of the marks.\n\n__Default value:__ If undefined, the default stroke width depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `strokeWidth` property." + }, + "text": { + "$ref": "#/definitions/TextDef", + "description": "Text of the `text` mark." + }, + "theta": { + "$ref": "#/definitions/PolarDef", + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians." + }, + "theta2": { + "$ref": "#/definitions/Position2Def", + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/StringFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "The tooltip text to show upon mouse hover. Specifying `tooltip` encoding overrides [the `tooltip` property in the mark definition](https://vega.github.io/vega-lite/docs/mark.html#mark-def).\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite." + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "The URL of an image mark." + }, + "x": { + "$ref": "#/definitions/PositionDef", + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "$ref": "#/definitions/Position2Def", + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xOffset": { + "$ref": "#/definitions/OffsetDef", + "description": "Offset of x-position of the marks" + }, + "y": { + "$ref": "#/definitions/PositionDef", + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "$ref": "#/definitions/Position2Def", + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yOffset": { + "$ref": "#/definitions/OffsetDef", + "description": "Offset of y-position of the marks" + } + }, + "type": "object" + }, + "CompositeMark": { + "anyOf": [ + { + "$ref": "#/definitions/BoxPlot" + }, + { + "$ref": "#/definitions/ErrorBar" + }, + { + "$ref": "#/definitions/ErrorBand" + } + ] + }, + "CompositeMarkDef": { + "anyOf": [ + { + "$ref": "#/definitions/BoxPlotDef" + }, + { + "$ref": "#/definitions/ErrorBarDef" + }, + { + "$ref": "#/definitions/ErrorBandDef" + } + ] + }, + "CompositionConfig": { + "additionalProperties": false, + "properties": { + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "spacing": { + "description": "The default spacing in pixels between composed sub-views.\n\n__Default value__: `20`", + "type": "number" + } + }, + "type": "object" + }, + "ConditionalMarkPropFieldOrDatumDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalParameter" + } + ] + }, + "ConditionalMarkPropFieldOrDatumDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalParameter>" + } + ] + }, + "ConditionalStringFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalParameter" + } + ] + }, + "ConditionalValueDef<(Gradient|string|null|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalParameter>" + } + ] + }, + "ConditionalValueDef<(Text|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalParameter>" + } + ] + }, + "ConditionalValueDef<(number[]|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalParameter>" + } + ] + }, + "ConditionalValueDef<(number|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalParameter>" + } + ] + }, + "ConditionalValueDef<(string|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalParameter>" + } + ] + }, + "ConditionalValueDef<(string|null|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalParameter>" + } + ] + }, + "ConditionalValueDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalParameter>" + } + ] + }, + "ConditionalAxisColor": { + "$ref": "#/definitions/ConditionalAxisProperty<(Color|null)>" + }, + "ConditionalAxisLabelAlign": { + "$ref": "#/definitions/ConditionalAxisProperty<(Align|null)>" + }, + "ConditionalAxisLabelBaseline": { + "$ref": "#/definitions/ConditionalAxisProperty<(TextBaseline|null)>" + }, + "ConditionalAxisLabelFontStyle": { + "$ref": "#/definitions/ConditionalAxisProperty<(FontStyle|null)>" + }, + "ConditionalAxisLabelFontWeight": { + "$ref": "#/definitions/ConditionalAxisProperty<(FontWeight|null)>" + }, + "ConditionalAxisNumber": { + "$ref": "#/definitions/ConditionalAxisProperty<(number|null)>" + }, + "ConditionalAxisNumberArray": { + "$ref": "#/definitions/ConditionalAxisProperty<(number[]|null)>" + }, + "ConditionalAxisProperty<(Align|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(Color|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(FontStyle|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(FontWeight|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(TextBaseline|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(number[]|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(number|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(string|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisString": { + "$ref": "#/definitions/ConditionalAxisProperty<(string|null)>" + }, + "ConditionalParameter": { + "anyOf": [ + { + "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#params), 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) 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." + }, + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "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/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." + } + }, + "required": [ + "param" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "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" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "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." + }, + "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/Type", + "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." + } + }, + "required": [ + "param" + ], + "type": "object" + } + ] + }, + "ConditionalParameter>": { + "anyOf": [ + { + "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#params), 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) 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." + }, + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "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/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/TypeForShape", + "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." + } + }, + "required": [ + "param" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "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" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "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." + }, + "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/Type", + "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." + } + }, + "required": [ + "param" + ], + "type": "object" + } + ] + }, + "ConditionalParameter": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "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`." + }, + "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." + }, + "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`.", + "type": "string" + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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." + } + }, + "required": [ + "param" + ], + "type": "object" + }, + "ConditionalParameter>": { + "additionalProperties": false, + "properties": { + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "param", + "value" + ], + "type": "object" + }, + "ConditionalParameter>": { + "additionalProperties": false, + "properties": { + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "param", + "value" + ], + "type": "object" + }, + "ConditionalParameter>": { + "additionalProperties": false, + "properties": { + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "param", + "value" + ], + "type": "object" + }, + "ConditionalParameter>": { + "additionalProperties": false, + "properties": { + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "param", + "value" + ], + "type": "object" + }, + "ConditionalParameter>": { + "additionalProperties": false, + "properties": { + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "param", + "value" + ], + "type": "object" + }, + "ConditionalParameter>": { + "additionalProperties": false, + "properties": { + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "param", + "value" + ], + "type": "object" + }, + "ConditionalParameter>": { + "additionalProperties": false, + "properties": { + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "required": [ + "param", + "value" + ], + "type": "object" + }, + "ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate": { + "anyOf": [ + { + "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#params), 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) 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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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." + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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." + } + }, + "required": [ + "test" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "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" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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." + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "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/Type", + "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." + } + }, + "required": [ + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate>": { + "anyOf": [ + { + "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#params), 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) 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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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." + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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/TypeForShape", + "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." + } + }, + "required": [ + "test" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "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" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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." + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "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/Type", + "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." + } + }, + "required": [ + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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`." + }, + "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." + }, + "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`.", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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." + } + }, + "required": [ + "test" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "Config": { + "additionalProperties": false, + "properties": { + "arc": { + "$ref": "#/definitions/RectConfig", + "description": "Arc-specific Config" + }, + "area": { + "$ref": "#/definitions/AreaConfig", + "description": "Area-Specific Config" + }, + "aria": { + "description": "A boolean flag indicating if ARIA default attributes should be included for marks and guides (SVG output only). If false, the `\"aria-hidden\"` attribute will be set for all guides, removing them from the ARIA accessibility tree and Vega-Lite will not generate default descriptions for marks.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + }, + "axis": { + "$ref": "#/definitions/AxisConfig", + "description": "Axis configuration, which determines default properties for all `x` and `y` [axes](https://vega.github.io/vega-lite/docs/axis.html). For a full list of axis configuration options, please see the [corresponding section of the axis documentation](https://vega.github.io/vega-lite/docs/axis.html#config)." + }, + "axisBand": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for axes with \"band\" scales." + }, + "axisBottom": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-axis along the bottom edge of the chart." + }, + "axisDiscrete": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for axes with \"point\" or \"band\" scales." + }, + "axisLeft": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-axis along the left edge of the chart." + }, + "axisPoint": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for axes with \"point\" scales." + }, + "axisQuantitative": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for quantitative axes." + }, + "axisRight": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-axis along the right edge of the chart." + }, + "axisTemporal": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for temporal axes." + }, + "axisTop": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-axis along the top edge of the chart." + }, + "axisX": { + "$ref": "#/definitions/AxisConfig", + "description": "X-axis specific config." + }, + "axisXBand": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-axes with \"band\" scales." + }, + "axisXDiscrete": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-axes with \"point\" or \"band\" scales." + }, + "axisXPoint": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-axes with \"point\" scales." + }, + "axisXQuantitative": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-quantitative axes." + }, + "axisXTemporal": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-temporal axes." + }, + "axisY": { + "$ref": "#/definitions/AxisConfig", + "description": "Y-axis specific config." + }, + "axisYBand": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-axes with \"band\" scales." + }, + "axisYDiscrete": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-axes with \"point\" or \"band\" scales." + }, + "axisYPoint": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-axes with \"point\" scales." + }, + "axisYQuantitative": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-quantitative axes." + }, + "axisYTemporal": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-temporal axes." + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bar": { + "$ref": "#/definitions/BarConfig", + "description": "Bar-Specific Config" + }, + "boxplot": { + "$ref": "#/definitions/BoxPlotConfig", + "description": "Box Config" + }, + "circle": { + "$ref": "#/definitions/MarkConfig", + "description": "Circle-Specific Config" + }, + "concat": { + "$ref": "#/definitions/CompositionConfig", + "description": "Default configuration for all concatenation and repeat view composition operators (`concat`, `hconcat`, `vconcat`, and `repeat`)" + }, + "countTitle": { + "description": "Default axis and legend title for count fields.\n\n__Default value:__ `'Count of Records`.", + "type": "string" + }, + "customFormatTypes": { + "description": "Allow the `formatType` property for text marks and guides to accept a custom formatter function [registered as a Vega expression](https://vega.github.io/vega-lite/usage/compile.html#format-type).", + "type": "boolean" + }, + "errorband": { + "$ref": "#/definitions/ErrorBandConfig", + "description": "ErrorBand Config" + }, + "errorbar": { + "$ref": "#/definitions/ErrorBarConfig", + "description": "ErrorBar Config" + }, + "facet": { + "$ref": "#/definitions/CompositionConfig", + "description": "Default configuration for the `facet` view composition operator" + }, + "fieldTitle": { + "description": "Defines how Vega-Lite generates title for fields. There are three possible styles:\n- `\"verbal\"` (Default) - displays function in a verbal style (e.g., \"Sum of field\", \"Year-month of date\", \"field (binned)\").\n- `\"function\"` - displays function using parentheses and capitalized texts (e.g., \"SUM(field)\", \"YEARMONTH(date)\", \"BIN(field)\").\n- `\"plain\"` - displays only the field name without functions (e.g., \"field\", \"date\", \"field\").", + "enum": [ + "verbal", + "functional", + "plain" + ], + "type": "string" + }, + "font": { + "description": "Default font for all text marks, titles, and labels.", + "type": "string" + }, + "geoshape": { + "$ref": "#/definitions/MarkConfig", + "description": "Geoshape-Specific Config" + }, + "header": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for all [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor a full list of header configuration options, please see the [corresponding section of in the header documentation](https://vega.github.io/vega-lite/docs/header.html#config)." + }, + "headerColumn": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for column [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor a full list of header configuration options, please see the [corresponding section of in the header documentation](https://vega.github.io/vega-lite/docs/header.html#config)." + }, + "headerFacet": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for non-row/column facet [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor a full list of header configuration options, please see the [corresponding section of in the header documentation](https://vega.github.io/vega-lite/docs/header.html#config)." + }, + "headerRow": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for row [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor a full list of header configuration options, please see the [corresponding section of in the header documentation](https://vega.github.io/vega-lite/docs/header.html#config)." + }, + "image": { + "$ref": "#/definitions/RectConfig", + "description": "Image-specific Config" + }, + "legend": { + "$ref": "#/definitions/LegendConfig", + "description": "Legend configuration, which determines default properties for all [legends](https://vega.github.io/vega-lite/docs/legend.html). For a full list of legend configuration options, please see the [corresponding section of in the legend documentation](https://vega.github.io/vega-lite/docs/legend.html#config)." + }, + "line": { + "$ref": "#/definitions/LineConfig", + "description": "Line-Specific Config" + }, + "lineBreak": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property provides a global default for text marks, which is overridden by mark or style config settings, and by the lineBreak mark encoding channel. If signal-valued, either string or regular expression (regexp) values are valid." + }, + "locale": { + "$ref": "#/definitions/Locale", + "description": "Locale definitions for string parsing and formatting of number and date values. The locale object should contain `number` and/or `time` properties with [locale definitions](https://vega.github.io/vega/docs/api/locale/). Locale definitions provided in the config block may be overridden by the View constructor locale option." + }, + "mark": { + "$ref": "#/definitions/MarkConfig", + "description": "Mark Config" + }, + "numberFormat": { + "description": "D3 Number format for guide labels and text marks. For example `\"s\"` for SI units. Use [D3's number format pattern](https://github.com/d3/d3-format#locale_format).", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables or selections that parameterize a visualization.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/TopLevelSelectionParameter" + } + ] + }, + "type": "array" + }, + "point": { + "$ref": "#/definitions/MarkConfig", + "description": "Point-Specific Config" + }, + "projection": { + "$ref": "#/definitions/ProjectionConfig", + "description": "Projection configuration, which determines default properties for all [projections](https://vega.github.io/vega-lite/docs/projection.html). For a full list of projection configuration options, please see the [corresponding section of the projection documentation](https://vega.github.io/vega-lite/docs/projection.html#config)." + }, + "range": { + "$ref": "#/definitions/RangeConfig", + "description": "An object hash that defines default range arrays or schemes for using with scales. For a full list of scale range configuration options, please see the [corresponding section of the scale documentation](https://vega.github.io/vega-lite/docs/scale.html#config)." + }, + "rect": { + "$ref": "#/definitions/RectConfig", + "description": "Rect-Specific Config" + }, + "rule": { + "$ref": "#/definitions/MarkConfig", + "description": "Rule-Specific Config" + }, + "scale": { + "$ref": "#/definitions/ScaleConfig", + "description": "Scale configuration determines default properties for all [scales](https://vega.github.io/vega-lite/docs/scale.html). For a full list of scale configuration options, please see the [corresponding section of the scale documentation](https://vega.github.io/vega-lite/docs/scale.html#config)." + }, + "selection": { + "$ref": "#/definitions/SelectionConfig", + "description": "An object hash for defining default properties for each type of selections." + }, + "square": { + "$ref": "#/definitions/MarkConfig", + "description": "Square-Specific Config" + }, + "style": { + "$ref": "#/definitions/StyleConfigIndex", + "description": "An object hash that defines key-value mappings to determine default properties for marks with a given [style](https://vega.github.io/vega-lite/docs/mark.html#mark-def). The keys represent styles names; the values have to be valid [mark configuration objects](https://vega.github.io/vega-lite/docs/mark.html#config)." + }, + "text": { + "$ref": "#/definitions/MarkConfig", + "description": "Text-Specific Config" + }, + "tick": { + "$ref": "#/definitions/TickConfig", + "description": "Tick-Specific Config" + }, + "timeFormat": { + "description": "Default time format for raw time values (without time units) in text marks, legend labels and header labels.\n\n__Default value:__ `\"%b %d, %Y\"` __Note:__ Axes automatically determine the format for each label automatically so this config does not affect axes.", + "type": "string" + }, + "title": { + "$ref": "#/definitions/TitleConfig", + "description": "Title configuration, which determines default properties for all [titles](https://vega.github.io/vega-lite/docs/title.html). For a full list of title configuration options, please see the [corresponding section of the title documentation](https://vega.github.io/vega-lite/docs/title.html#config)." + }, + "trail": { + "$ref": "#/definitions/LineConfig", + "description": "Trail-Specific Config" + }, + "view": { + "$ref": "#/definitions/ViewConfig", + "description": "Default properties for [single view plots](https://vega.github.io/vega-lite/docs/spec.html#single)." + } + }, + "type": "object" + }, + "CsvDataFormat": { + "additionalProperties": false, + "properties": { + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using JavaScript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: \"utc:'%m%d%Y'\"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)" + }, + "type": { + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `\"json\"` will be used by default.", + "enum": [ + "csv", + "tsv" + ], + "type": "string" + } + }, + "type": "object" + }, + "Cursor": { + "enum": [ + "auto", + "default", + "none", + "context-menu", + "help", + "pointer", + "progress", + "wait", + "cell", + "crosshair", + "text", + "vertical-text", + "alias", + "copy", + "move", + "no-drop", + "not-allowed", + "e-resize", + "n-resize", + "ne-resize", + "nw-resize", + "s-resize", + "se-resize", + "sw-resize", + "w-resize", + "ew-resize", + "ns-resize", + "nesw-resize", + "nwse-resize", + "col-resize", + "row-resize", + "all-scroll", + "zoom-in", + "zoom-out", + "grab", + "grabbing" + ], + "type": "string" + }, + "Cyclical": { + "enum": [ + "rainbow", + "sinebow" + ], + "type": "string" + }, + "Data": { + "anyOf": [ + { + "$ref": "#/definitions/DataSource" + }, + { + "$ref": "#/definitions/Generator" + } + ] + }, + "DataFormat": { + "anyOf": [ + { + "$ref": "#/definitions/CsvDataFormat" + }, + { + "$ref": "#/definitions/DsvDataFormat" + }, + { + "$ref": "#/definitions/JsonDataFormat" + }, + { + "$ref": "#/definitions/TopoDataFormat" + } + ] + }, + "DataSource": { + "anyOf": [ + { + "$ref": "#/definitions/UrlData" + }, + { + "$ref": "#/definitions/InlineData" + }, + { + "$ref": "#/definitions/NamedData" + } + ] + }, + "Datasets": { + "$ref": "#/definitions/Dict" + }, + "DateTime": { + "additionalProperties": false, + "description": "Object for defining datetime in Vega-Lite Filter. If both month and quarter are provided, month has higher precedence. `day` cannot be combined with other date. We accept string for month and day names.", + "properties": { + "date": { + "description": "Integer value representing the date (day of the month) from 1-31.", + "maximum": 31, + "minimum": 1, + "type": "number" + }, + "day": { + "anyOf": [ + { + "$ref": "#/definitions/Day" + }, + { + "type": "string" + } + ], + "description": "Value representing the day of a week. This can be one of: (1) integer value -- `1` represents Monday; (2) case-insensitive day name (e.g., `\"Monday\"`); (3) case-insensitive, 3-character short day name (e.g., `\"Mon\"`).\n\n**Warning:** A DateTime definition object with `day`** should not be combined with `year`, `quarter`, `month`, or `date`." + }, + "hours": { + "description": "Integer value representing the hour of a day from 0-23.", + "maximum": 24, + "minimum": 0, + "type": "number" + }, + "milliseconds": { + "description": "Integer value representing the millisecond segment of time.", + "maximum": 1000, + "minimum": 0, + "type": "number" + }, + "minutes": { + "description": "Integer value representing the minute segment of time from 0-59.", + "maximum": 60, + "minimum": 0, + "type": "number" + }, + "month": { + "anyOf": [ + { + "$ref": "#/definitions/Month" + }, + { + "type": "string" + } + ], + "description": "One of: (1) integer value representing the month from `1`-`12`. `1` represents January; (2) case-insensitive month name (e.g., `\"January\"`); (3) case-insensitive, 3-character short month name (e.g., `\"Jan\"`)." + }, + "quarter": { + "description": "Integer value representing the quarter of the year (from 1-4).", + "maximum": 4, + "minimum": 1, + "type": "number" + }, + "seconds": { + "description": "Integer value representing the second segment (0-59) of a time value", + "maximum": 60, + "minimum": 0, + "type": "number" + }, + "utc": { + "description": "A boolean flag indicating if date time is in utc time. If false, the date time is in local time", + "type": "boolean" + }, + "year": { + "description": "Integer value representing the year.", + "type": "number" + } + }, + "type": "object" + }, + "DatumDef": { + "additionalProperties": false, + "properties": { + "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" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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/Type", + "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" + }, + "Day": { + "maximum": 7, + "minimum": 1, + "type": "number" + }, + "DensityTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output fields for the sample value and corresponding density estimate.\n\n__Default value:__ `[\"value\", \"density\"]`", + "items": { + "$ref": "#/definitions/FieldName" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "bandwidth": { + "description": "The bandwidth (standard deviation) of the Gaussian kernel. If unspecified or set to zero, the bandwidth value is automatically estimated from the input data using Scott’s rule.", + "type": "number" + }, + "counts": { + "description": "A boolean flag indicating if the output values should be probability estimates (false) or smoothed counts (true).\n\n__Default value:__ `false`", + "type": "boolean" + }, + "cumulative": { + "description": "A boolean flag indicating whether to produce density estimates (false) or cumulative density estimates (true).\n\n__Default value:__ `false`", + "type": "boolean" + }, + "density": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which to perform density estimation." + }, + "extent": { + "description": "A [min, max] domain from which to sample the distribution. If unspecified, the extent will be determined by the observed minimum and maximum values of the density value field.", + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "maxsteps": { + "description": "The maximum number of samples to take along the extent domain for plotting the density.\n\n__Default value:__ `200`", + "type": "number" + }, + "minsteps": { + "description": "The minimum number of samples to take along the extent domain for plotting the density.\n\n__Default value:__ `25`", + "type": "number" + }, + "steps": { + "description": "The exact number of samples to take along the extent domain for plotting the density. If specified, overrides both minsteps and maxsteps to set an exact number of uniform samples. Potentially useful in conjunction with a fixed extent to ensure consistent sample points for stacked densities.", + "type": "number" + } + }, + "required": [ + "density" + ], + "type": "object" + }, + "DerivedStream": { + "additionalProperties": false, + "properties": { + "between": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" + }, + "consume": { + "type": "boolean" + }, + "debounce": { + "type": "number" + }, + "filter": { + "anyOf": [ + { + "$ref": "#/definitions/Expr" + }, + { + "items": { + "$ref": "#/definitions/Expr" + }, + "type": "array" + } + ] + }, + "markname": { + "type": "string" + }, + "marktype": { + "$ref": "#/definitions/MarkType" + }, + "stream": { + "$ref": "#/definitions/Stream" + }, + "throttle": { + "type": "number" + } + }, + "required": [ + "stream" + ], + "type": "object" + }, + "Dict": { + "additionalProperties": { + "$ref": "#/definitions/InlineDataset" + }, + "type": "object" + }, + "Dict": { + "additionalProperties": { + "$ref": "#/definitions/SelectionInit" + }, + "type": "object" + }, + "Dict": { + "additionalProperties": { + "$ref": "#/definitions/SelectionInitInterval" + }, + "type": "object" + }, + "Dict": { + "additionalProperties": {}, + "type": "object" + }, + "Diverging": { + "enum": [ + "blueorange", + "blueorange-3", + "blueorange-4", + "blueorange-5", + "blueorange-6", + "blueorange-7", + "blueorange-8", + "blueorange-9", + "blueorange-10", + "blueorange-11", + "brownbluegreen", + "brownbluegreen-3", + "brownbluegreen-4", + "brownbluegreen-5", + "brownbluegreen-6", + "brownbluegreen-7", + "brownbluegreen-8", + "brownbluegreen-9", + "brownbluegreen-10", + "brownbluegreen-11", + "purplegreen", + "purplegreen-3", + "purplegreen-4", + "purplegreen-5", + "purplegreen-6", + "purplegreen-7", + "purplegreen-8", + "purplegreen-9", + "purplegreen-10", + "purplegreen-11", + "pinkyellowgreen", + "pinkyellowgreen-3", + "pinkyellowgreen-4", + "pinkyellowgreen-5", + "pinkyellowgreen-6", + "pinkyellowgreen-7", + "pinkyellowgreen-8", + "pinkyellowgreen-9", + "pinkyellowgreen-10", + "pinkyellowgreen-11", + "purpleorange", + "purpleorange-3", + "purpleorange-4", + "purpleorange-5", + "purpleorange-6", + "purpleorange-7", + "purpleorange-8", + "purpleorange-9", + "purpleorange-10", + "purpleorange-11", + "redblue", + "redblue-3", + "redblue-4", + "redblue-5", + "redblue-6", + "redblue-7", + "redblue-8", + "redblue-9", + "redblue-10", + "redblue-11", + "redgrey", + "redgrey-3", + "redgrey-4", + "redgrey-5", + "redgrey-6", + "redgrey-7", + "redgrey-8", + "redgrey-9", + "redgrey-10", + "redgrey-11", + "redyellowblue", + "redyellowblue-3", + "redyellowblue-4", + "redyellowblue-5", + "redyellowblue-6", + "redyellowblue-7", + "redyellowblue-8", + "redyellowblue-9", + "redyellowblue-10", + "redyellowblue-11", + "redyellowgreen", + "redyellowgreen-3", + "redyellowgreen-4", + "redyellowgreen-5", + "redyellowgreen-6", + "redyellowgreen-7", + "redyellowgreen-8", + "redyellowgreen-9", + "redyellowgreen-10", + "redyellowgreen-11", + "spectral", + "spectral-3", + "spectral-4", + "spectral-5", + "spectral-6", + "spectral-7", + "spectral-8", + "spectral-9", + "spectral-10", + "spectral-11" + ], + "type": "string" + }, + "DomainUnionWith": { + "additionalProperties": false, + "properties": { + "unionWith": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ], + "description": "Customized domain values to be union with the field's values or explicitly defined domain. Should be an array of valid scale domain values." + } + }, + "required": [ + "unionWith" + ], + "type": "object" + }, + "DsvDataFormat": { + "additionalProperties": false, + "properties": { + "delimiter": { + "description": "The delimiter between records. The delimiter must be a single character (i.e., a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not.", + "maxLength": 1, + "minLength": 1, + "type": "string" + }, + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using JavaScript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: \"utc:'%m%d%Y'\"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)" + }, + "type": { + "const": "dsv", + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `\"json\"` will be used by default.", + "type": "string" + } + }, + "required": [ + "delimiter" + ], + "type": "object" + }, + "Element": { + "type": "string" + }, + "EncodingSortField": { + "additionalProperties": false, + "description": "A sort definition for sorting a discrete scale in an encoding field definition.", + "properties": { + "field": { + "$ref": "#/definitions/Field", + "description": "The data [field](https://vega.github.io/vega-lite/docs/field.html) to sort by.\n\n__Default value:__ If unspecified, defaults to the field specified in the outer data reference." + }, + "op": { + "$ref": "#/definitions/NonArgAggregateOp", + "description": "An [aggregate operation](https://vega.github.io/vega-lite/docs/aggregate.html#ops) to perform on the field prior to sorting (e.g., `\"count\"`, `\"mean\"` and `\"median\"`). An aggregation is required when there are multiple values of the sort field for each encoded data field. The input data objects will be aggregated, grouped by the encoded data field.\n\nFor a full list of operations, please see the documentation for [aggregate](https://vega.github.io/vega-lite/docs/aggregate.html#ops).\n\n__Default value:__ `\"sum\"` for stacked plots. Otherwise, `\"min\"`." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "type": "null" + } + ], + "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "type": "object" + }, + "ErrorBand": { + "const": "errorband", + "type": "string" + }, + "ErrorBandConfig": { + "additionalProperties": false, + "properties": { + "band": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "borders": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "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\"`." + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes at the midpoint of each pair of adjacent x-values.\n- `\"step-before\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes before the x-value.\n- `\"step-after\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes after the x-value.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "tension": { + "description": "The tension parameter for the interpolation type of the error band.", + "maximum": 1, + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ErrorBandDef": { + "additionalProperties": false, + "properties": { + "band": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "borders": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "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\"`." + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes at the midpoint of each pair of adjacent x-values.\n- `\"step-before\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes before the x-value.\n- `\"step-after\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes after the x-value.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "Orientation of the error band. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." + }, + "tension": { + "description": "The tension parameter for the interpolation type of the error band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "type": { + "$ref": "#/definitions/ErrorBand", + "description": "The mark type. This could a primitive mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`) or a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ErrorBar": { + "const": "errorbar", + "type": "string" + }, + "ErrorBarConfig": { + "additionalProperties": false, + "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\"`." + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "size": { + "description": "Size of the ticks of an error bar", + "type": "number" + }, + "thickness": { + "description": "Thickness of the ticks and the bar of an error bar", + "type": "number" + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + } + }, + "type": "object" + }, + "ErrorBarDef": { + "additionalProperties": false, + "properties": { + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "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\"`." + }, + "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "Orientation of the error bar. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "size": { + "description": "Size of the ticks of an error bar", + "type": "number" + }, + "thickness": { + "description": "Thickness of the ticks and the bar of an error bar", + "type": "number" + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "type": { + "$ref": "#/definitions/ErrorBar", + "description": "The mark type. This could a primitive mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`) or a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ErrorBarExtent": { + "enum": [ + "ci", + "iqr", + "stderr", + "stdev" + ], + "type": "string" + }, + "EventStream": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "between": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" + }, + "consume": { + "type": "boolean" + }, + "debounce": { + "type": "number" + }, + "filter": { + "anyOf": [ + { + "$ref": "#/definitions/Expr" + }, + { + "items": { + "$ref": "#/definitions/Expr" + }, + "type": "array" + } + ] + }, + "markname": { + "type": "string" + }, + "marktype": { + "$ref": "#/definitions/MarkType" + }, + "source": { + "enum": [ + "view", + "scope" + ], + "type": "string" + }, + "throttle": { + "type": "number" + }, + "type": { + "$ref": "#/definitions/EventType" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "between": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" + }, + "consume": { + "type": "boolean" + }, + "debounce": { + "type": "number" + }, + "filter": { + "anyOf": [ + { + "$ref": "#/definitions/Expr" + }, + { + "items": { + "$ref": "#/definitions/Expr" + }, + "type": "array" + } + ] + }, + "markname": { + "type": "string" + }, + "marktype": { + "$ref": "#/definitions/MarkType" + }, + "source": { + "const": "window", + "type": "string" + }, + "throttle": { + "type": "number" + }, + "type": { + "$ref": "#/definitions/WindowEventType" + } + }, + "required": [ + "source", + "type" + ], + "type": "object" + } + ] + }, + "EventType": { + "enum": [ + "click", + "dblclick", + "dragenter", + "dragleave", + "dragover", + "keydown", + "keypress", + "keyup", + "mousedown", + "mousemove", + "mouseout", + "mouseover", + "mouseup", + "mousewheel", + "timer", + "touchend", + "touchmove", + "touchstart", + "wheel" + ], + "type": "string" + }, + "Expr": { + "type": "string" + }, + "ExprRef": { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "expr" + ], + "type": "object" + }, + "FacetEncodingFieldDef": { + "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." + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "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#params), 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) 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." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "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`." + }, + "header": { + "anyOf": [ + { + "$ref": "#/definitions/Header" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of a facet's header." + }, + "sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "type": "null" + } + ], + "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 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` is not supported for `row` and `column`." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "FacetFieldDef": { + "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#params), 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) 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`." + }, + "header": { + "anyOf": [ + { + "$ref": "#/definitions/Header" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of a facet's header." + }, + "sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "type": "null" + } + ], + "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 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` is not supported for `row` and `column`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "FacetMapping": { + "additionalProperties": false, + "properties": { + "column": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the horizontal facet of trellis plots." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the vertical facet of trellis plots." + } + }, + "type": "object" + }, + "FacetedEncoding": { + "additionalProperties": false, + "properties": { + "angle": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Rotation angle of point and text marks." + }, + "color": { + "$ref": "#/definitions/ColorDef", + "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition. By default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`, `\"text\"`, `\"trail\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ 1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. The `fill` or `stroke` encodings have higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified. 2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "column": { + "$ref": "#/definitions/RowColumnEncodingFieldDef", + "description": "A field definition for the horizontal facet of trellis plots." + }, + "description": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "A text description of this mark for ARIA accessibility (SVG output only). For SVG output the `\"aria-label\"` attribute will be set to this description." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + { + "items": { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + "type": "array" + } + ], + "description": "Additional levels of detail for grouping data in aggregate views and in line, trail, and area marks without mapping data to a specific visual channel." + }, + "facet": { + "$ref": "#/definitions/FacetEncodingFieldDef", + "description": "A field definition for the (flexible) facet of trellis plots.\n\nIf either `row` or `column` is specified, this channel will be ignored." + }, + "fill": { + "$ref": "#/definitions/ColorDef", + "description": "Fill color of the marks. __Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ The `fill` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." + }, + "fillOpacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Fill opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `fillOpacity` property." + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "A URL to load upon mouse click." + }, + "key": { + "$ref": "#/definitions/FieldDefWithoutScale", + "description": "A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data." + }, + "latitude": { + "$ref": "#/definitions/LatLongDef", + "description": "Latitude position of geographically projected marks." + }, + "latitude2": { + "$ref": "#/definitions/Position2Def", + "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "longitude": { + "$ref": "#/definitions/LatLongDef", + "description": "Longitude position of geographically projected marks." + }, + "longitude2": { + "$ref": "#/definitions/Position2Def", + "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "opacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `opacity` property." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/OrderValueDef" + } + ], + "description": "Order of the marks.\n- For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#order).\n- For line and trail marks, this `order` channel encodes order of data points in the lines. This can be useful for creating [a connected scatterplot](https://vega.github.io/vega-lite/examples/connected_scatterplot.html). Setting `order` to `{\"value\": null}` makes the line marks use the original order in the data sources.\n- Otherwise, this `order` channel encodes layer order of the marks.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." + }, + "radius": { + "$ref": "#/definitions/PolarDef", + "description": "The outer radius in pixels of arc marks." + }, + "radius2": { + "$ref": "#/definitions/Position2Def", + "description": "The inner radius in pixels of arc marks." + }, + "row": { + "$ref": "#/definitions/RowColumnEncodingFieldDef", + "description": "A field definition for the vertical facet of trellis plots." + }, + "shape": { + "$ref": "#/definitions/ShapeDef", + "description": "Shape of the mark.\n\n1. For `point` marks the supported values include: - plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`. - the line symbol `\"stroke\"` - centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"` - a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n2. For `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#point-config)'s `shape` property. (`\"circle\"` if unset.)" + }, + "size": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" + }, + "stroke": { + "$ref": "#/definitions/ColorDef", + "description": "Stroke color of the marks. __Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ The `stroke` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." + }, + "strokeDash": { + "$ref": "#/definitions/NumericArrayMarkPropDef", + "description": "Stroke dash of the marks.\n\n__Default value:__ `[1,0]` (No dash)." + }, + "strokeOpacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Stroke opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `strokeOpacity` property." + }, + "strokeWidth": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Stroke width of the marks.\n\n__Default value:__ If undefined, the default stroke width depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `strokeWidth` property." + }, + "text": { + "$ref": "#/definitions/TextDef", + "description": "Text of the `text` mark." + }, + "theta": { + "$ref": "#/definitions/PolarDef", + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians." + }, + "theta2": { + "$ref": "#/definitions/Position2Def", + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/StringFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "The tooltip text to show upon mouse hover. Specifying `tooltip` encoding overrides [the `tooltip` property in the mark definition](https://vega.github.io/vega-lite/docs/mark.html#mark-def).\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite." + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "The URL of an image mark." + }, + "x": { + "$ref": "#/definitions/PositionDef", + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "$ref": "#/definitions/Position2Def", + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xOffset": { + "$ref": "#/definitions/OffsetDef", + "description": "Offset of x-position of the marks" + }, + "y": { + "$ref": "#/definitions/PositionDef", + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "$ref": "#/definitions/Position2Def", + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yOffset": { + "$ref": "#/definitions/OffsetDef", + "description": "Offset of y-position of the marks" + } + }, + "type": "object" + }, + "FacetedUnitSpec": { + "additionalProperties": false, + "description": "Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec).", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/FacetedEncoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number.\n- For a plot with either a discrete y-field or no y-field, height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step. (No y-field is equivalent to having one discrete step.)\n- To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "params": { + "description": "An array of parameters that may either be simple variables, or more complex selections that map user input to data queries.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/SelectionParameter" + } + ] + }, + "type": "array" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks and to `latitude` and `\"longitude\"` channels for other marks." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number.\n- For a plot with either a discrete x-field or no x-field, width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step. (No x-field is equivalent to having one discrete step.)\n- To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "Field": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ] + }, + "FieldDefWithoutScale": { + "$ref": "#/definitions/TypedFieldDef", + "description": "Field Def without scale (and without bin: \"binned\" support)." + }, + "FieldEqualPredicate": { + "additionalProperties": false, + "properties": { + "equal": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The value that the field should be equal to." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "equal", + "field" + ], + "type": "object" + }, + "FieldGTEPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "gte": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The value that the field should be greater than or equals to." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "gte" + ], + "type": "object" + }, + "FieldGTPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "gt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The value that the field should be greater than." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "gt" + ], + "type": "object" + }, + "FieldLTEPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "lte": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The value that the field should be less than or equals to." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "lte" + ], + "type": "object" + }, + "FieldLTPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "lt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The value that the field should be less than." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "lt" + ], + "type": "object" + }, + "FieldName": { + "type": "string" + }, + "FieldOneOfPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "oneOf": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ], + "description": "A set of values that the `field`'s value should be a member of, for a data item included in the filtered data." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "oneOf" + ], + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "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" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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/Type", + "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" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "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" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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/Type", + "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" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "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" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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/Type", + "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" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "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" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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/Type", + "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" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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" + }, + "FieldOrDatumDefWithCondition,(string|null)>": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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/TypeForShape", + "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" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "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" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "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." + }, + "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`.", + "type": "string" + }, + "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/Type", + "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" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "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`." + }, + "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." + }, + "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`.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "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`." + }, + "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." + }, + "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`.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "FieldRange": { + "additionalProperties": false, + "properties": { + "field": { + "type": "string" + } + }, + "required": [ + "field" + ], + "type": "object" + }, + "FieldRangePredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "range": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "An array of inclusive minimum and maximum values for a field value of a data item to be included in the filtered data.", + "maxItems": 2, + "minItems": 2 + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "range" + ], + "type": "object" + }, + "FieldValidPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + }, + "valid": { + "description": "If set to true the field's value has to be valid, meaning both not `null` and not [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN).", + "type": "boolean" + } + }, + "required": [ + "field", + "valid" + ], + "type": "object" + }, + "FilterTransform": { + "additionalProperties": false, + "properties": { + "filter": { + "$ref": "#/definitions/PredicateComposition", + "description": "The `filter` property must be a predication definition, which can take one of the following forms:\n\n1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string, where `datum` can be used to refer to the current data object. For example, `{filter: \"datum.b2 > 60\"}` would make the output data includes only items that have values in the field `b2` over 60.\n\n2) one of the [field predicates](https://vega.github.io/vega-lite/docs/predicate.html#field-predicate): [`equal`](https://vega.github.io/vega-lite/docs/predicate.html#field-equal-predicate), [`lt`](https://vega.github.io/vega-lite/docs/predicate.html#lt-predicate), [`lte`](https://vega.github.io/vega-lite/docs/predicate.html#lte-predicate), [`gt`](https://vega.github.io/vega-lite/docs/predicate.html#gt-predicate), [`gte`](https://vega.github.io/vega-lite/docs/predicate.html#gte-predicate), [`range`](https://vega.github.io/vega-lite/docs/predicate.html#range-predicate), [`oneOf`](https://vega.github.io/vega-lite/docs/predicate.html#one-of-predicate), or [`valid`](https://vega.github.io/vega-lite/docs/predicate.html#valid-predicate),\n\n3) a [selection predicate](https://vega.github.io/vega-lite/docs/predicate.html#selection-predicate), which define the names of a selection that the data point should belong to (or a logical composition of selections).\n\n4) a [logical composition](https://vega.github.io/vega-lite/docs/predicate.html#composition) of (1), (2), or (3)." + } + }, + "required": [ + "filter" + ], + "type": "object" + }, + "Fit": { + "anyOf": [ + { + "$ref": "#/definitions/GeoJsonFeature" + }, + { + "$ref": "#/definitions/GeoJsonFeatureCollection" + }, + { + "items": { + "$ref": "#/definitions/GeoJsonFeature" + }, + "type": "array" + } + ] + }, + "FlattenTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for extracted array values.\n\n__Default value:__ The field name of the corresponding array field", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "flatten": { + "description": "An array of one or more data fields containing arrays to flatten. If multiple fields are specified, their array values should have a parallel structure, ideally with the same length. If the lengths of parallel arrays do not match, the longest array will be used with `null` values added for missing entries.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + }, + "required": [ + "flatten" + ], + "type": "object" + }, + "FoldTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for the key and value properties produced by the fold transform. __Default value:__ `[\"key\", \"value\"]`", + "items": { + "$ref": "#/definitions/FieldName" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "fold": { + "description": "An array of data fields indicating the properties to fold.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + }, + "required": [ + "fold" + ], + "type": "object" + }, + "FontStyle": { + "type": "string" + }, + "FontWeight": { + "enum": [ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ], + "type": [ + "string", + "number" + ] + }, + "Generator": { + "anyOf": [ + { + "$ref": "#/definitions/SequenceGenerator" + }, + { + "$ref": "#/definitions/SphereGenerator" + }, + { + "$ref": "#/definitions/GraticuleGenerator" + } + ] + }, + "ConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a generalized concatenation specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "concat": { + "description": "A list of views to be concatenated.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "concat" + ], + "type": "object" + }, + "FacetSpec": { + "additionalProperties": false, + "description": "Base interface for a facet specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "facet": { + "anyOf": [ + { + "$ref": "#/definitions/FacetFieldDef" + }, + { + "$ref": "#/definitions/FacetMapping" + } + ], + "description": "Definition for how to facet the data. One of: 1) [a field definition for faceting the plot by one field](https://vega.github.io/vega-lite/docs/facet.html#field-def) 2) [An object that maps `row` and `column` channels to their field definitions](https://vega.github.io/vega-lite/docs/facet.html#mapping)" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/FacetedUnitSpec" + } + ], + "description": "A specification of the view that gets faceted." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "facet", + "spec" + ], + "type": "object" + }, + "HConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a horizontal concatenation specification.", + "properties": { + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "hconcat": { + "description": "A list of views to be concatenated and put into a row.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "hconcat" + ], + "type": "object" + }, + "Spec": { + "anyOf": [ + { + "$ref": "#/definitions/FacetedUnitSpec" + }, + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/RepeatSpec" + }, + { + "$ref": "#/definitions/FacetSpec" + }, + { + "$ref": "#/definitions/ConcatSpec" + }, + { + "$ref": "#/definitions/VConcatSpec" + }, + { + "$ref": "#/definitions/HConcatSpec" + } + ], + "description": "Any specification in Vega-Lite." + }, + "GenericUnitSpec": { + "additionalProperties": false, + "description": "Base interface for a unit (single-view) specification.", + "properties": { + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/Encoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "params": { + "description": "An array of parameters that may either be simple variables, or more complex selections that map user input to data queries.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/SelectionParameter" + } + ] + }, + "type": "array" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks and to `latitude` and `\"longitude\"` channels for other marks." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "VConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a vertical concatenation specification.", + "properties": { + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "vconcat": { + "description": "A list of views to be concatenated and put into a column.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + } + }, + "required": [ + "vconcat" + ], + "type": "object" + }, + "GeoJsonFeature": {}, + "GeoJsonFeatureCollection": {}, + "Gradient": { + "anyOf": [ + { + "$ref": "#/definitions/LinearGradient" + }, + { + "$ref": "#/definitions/RadialGradient" + } + ] + }, + "GradientStop": { + "additionalProperties": false, + "properties": { + "color": { + "$ref": "#/definitions/Color", + "description": "The color value at this point in the gradient." + }, + "offset": { + "description": "The offset fraction for the color stop, indicating its position within the gradient.", + "type": "number" + } + }, + "required": [ + "offset", + "color" + ], + "type": "object" + }, + "GraticuleGenerator": { + "additionalProperties": false, + "properties": { + "graticule": { + "anyOf": [ + { + "const": true, + "type": "boolean" + }, + { + "$ref": "#/definitions/GraticuleParams" + } + ], + "description": "Generate graticule GeoJSON data for geographic reference lines." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + } + }, + "required": [ + "graticule" + ], + "type": "object" + }, + "GraticuleParams": { + "additionalProperties": false, + "properties": { + "extent": { + "$ref": "#/definitions/Vector2>", + "description": "Sets both the major and minor extents to the same values." + }, + "extentMajor": { + "$ref": "#/definitions/Vector2>", + "description": "The major extent of the graticule as a two-element array of coordinates." + }, + "extentMinor": { + "$ref": "#/definitions/Vector2>", + "description": "The minor extent of the graticule as a two-element array of coordinates." + }, + "precision": { + "description": "The precision of the graticule in degrees.\n\n__Default value:__ `2.5`", + "type": "number" + }, + "step": { + "$ref": "#/definitions/Vector2", + "description": "Sets both the major and minor step angles to the same values." + }, + "stepMajor": { + "$ref": "#/definitions/Vector2", + "description": "The major step angles of the graticule.\n\n\n__Default value:__ `[90, 360]`" + }, + "stepMinor": { + "$ref": "#/definitions/Vector2", + "description": "The minor step angles of the graticule.\n\n__Default value:__ `[10, 10]`" + } + }, + "type": "object" + }, + "Header": { + "additionalProperties": false, + "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." + }, + "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`.", + "type": "string" + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Horizontal text alignment of header labels. One of `\"left\"`, `\"center\"`, or `\"right\"`." + }, + "labelAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "The anchor position for placing the labels. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with a label orientation of top these anchor positions map to a left-, center-, or right-aligned label." + }, + "labelAngle": { + "description": "The rotation angle of the header labels.\n\n__Default value:__ `0` for column header, `-90` for row header.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The vertical text baseline for the header labels. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone." + }, + "labelColor": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The color of the header label, can be in hex color code or regular color name." + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the header's backing `datum` object.", + "type": "string" + }, + "labelFont": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font of the header label." + }, + "labelFontSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font size of the header label, in pixels.", + "minimum": 0 + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font style of the header label." + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font weight of the header label." + }, + "labelLimit": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" + }, + "labelLineHeight": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Line height in pixels for multi-line header labels or title text with `\"line-top\"` or `\"line-bottom\"` baseline." + }, + "labelOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header label. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "labelPadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The padding, in pixel, between facet header's label and the plot.\n\n__Default value:__ `10`" + }, + "labels": { + "description": "A boolean flag indicating if labels should be included as part of the header.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "orient": { + "$ref": "#/definitions/Orient", + "description": "Shortcut for setting both labelOrient and titleOrient." + }, + "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." + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Horizontal text alignment (to the anchor) of header titles." + }, + "titleAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "The anchor position for placing the title. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title." + }, + "titleAngle": { + "description": "The rotation angle of the header title.\n\n__Default value:__ `0`.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The vertical text baseline for the header title. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone.\n\n__Default value:__ `\"middle\"`" + }, + "titleColor": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Color of the header title, can be in hex color code or regular color name." + }, + "titleFont": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Font of the header title. (e.g., `\"Helvetica Neue\"`)." + }, + "titleFontSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Font size of the header title.", + "minimum": 0 + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font style of the header title." + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Font weight of the header title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "titleLimit": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" + }, + "titleLineHeight": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Line height in pixels for multi-line header title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline." + }, + "titleOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header title. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "titlePadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The padding, in pixel, between facet header's title and the label.\n\n__Default value:__ `10`" + } + }, + "type": "object" + }, + "HeaderConfig": { + "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." + }, + "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`.", + "type": "string" + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Horizontal text alignment of header labels. One of `\"left\"`, `\"center\"`, or `\"right\"`." + }, + "labelAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "The anchor position for placing the labels. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with a label orientation of top these anchor positions map to a left-, center-, or right-aligned label." + }, + "labelAngle": { + "description": "The rotation angle of the header labels.\n\n__Default value:__ `0` for column header, `-90` for row header.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The vertical text baseline for the header labels. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone." + }, + "labelColor": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The color of the header label, can be in hex color code or regular color name." + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the header's backing `datum` object.", + "type": "string" + }, + "labelFont": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font of the header label." + }, + "labelFontSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font size of the header label, in pixels.", + "minimum": 0 + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font style of the header label." + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font weight of the header label." + }, + "labelLimit": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" + }, + "labelLineHeight": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Line height in pixels for multi-line header labels or title text with `\"line-top\"` or `\"line-bottom\"` baseline." + }, + "labelOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header label. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "labelPadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The padding, in pixel, between facet header's label and the plot.\n\n__Default value:__ `10`" + }, + "labels": { + "description": "A boolean flag indicating if labels should be included as part of the header.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "orient": { + "$ref": "#/definitions/Orient", + "description": "Shortcut for setting both labelOrient and titleOrient." + }, + "title": { + "description": "Set to null to disable title for the axis, legend, or header.", + "type": "null" + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Horizontal text alignment (to the anchor) of header titles." + }, + "titleAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "The anchor position for placing the title. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title." + }, + "titleAngle": { + "description": "The rotation angle of the header title.\n\n__Default value:__ `0`.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The vertical text baseline for the header title. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone.\n\n__Default value:__ `\"middle\"`" + }, + "titleColor": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Color of the header title, can be in hex color code or regular color name." + }, + "titleFont": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Font of the header title. (e.g., `\"Helvetica Neue\"`)." + }, + "titleFontSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Font size of the header title.", + "minimum": 0 + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font style of the header title." + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Font weight of the header title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "titleLimit": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" + }, + "titleLineHeight": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Line height in pixels for multi-line header title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline." + }, + "titleOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header title. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "titlePadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The padding, in pixel, between facet header's title and the label.\n\n__Default value:__ `10`" + } + }, + "type": "object" + }, + "HexColor": { + "format": "color-hex", + "type": "string" + }, + "ImputeMethod": { + "enum": [ + "value", + "median", + "max", + "min", + "mean" + ], + "type": "string" + }, + "ImputeParams": { + "additionalProperties": false, + "properties": { + "frame": { + "description": "A frame specification as a two-element array used to control the window over which the specified method is applied. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded rows preceding or following the current data object. For example, the value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object.\n\n__Default value:__: `[null, null]` indicating that the window includes all objects.", + "items": { + "type": [ + "null", + "number" + ] + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "keyvals": { + "anyOf": [ + { + "items": {}, + "type": "array" + }, + { + "$ref": "#/definitions/ImputeSequence" + } + ], + "description": "Defines the key values that should be considered for imputation. An array of key values or an object defining a [number sequence](https://vega.github.io/vega-lite/docs/impute.html#sequence-def).\n\nIf provided, this will be used in addition to the key values observed within the input data. If not provided, the values will be derived from all unique values of the `key` field. For `impute` in `encoding`, the key field is the x-field if the y-field is imputed, or vice versa.\n\nIf there is no impute grouping, this property _must_ be specified." + }, + "method": { + "$ref": "#/definitions/ImputeMethod", + "description": "The imputation method to use for the field value of imputed data objects. One of `\"value\"`, `\"mean\"`, `\"median\"`, `\"max\"` or `\"min\"`.\n\n__Default value:__ `\"value\"`" + }, + "value": { + "description": "The field value to use when the imputation `method` is `\"value\"`." + } + }, + "type": "object" + }, + "ImputeSequence": { + "additionalProperties": false, + "properties": { + "start": { + "description": "The starting value of the sequence. __Default value:__ `0`", + "type": "number" + }, + "step": { + "description": "The step value between sequence entries. __Default value:__ `1` or `-1` if `stop < start`", + "type": "number" + }, + "stop": { + "description": "The ending value(exclusive) of the sequence.", + "type": "number" + } + }, + "required": [ + "stop" + ], + "type": "object" + }, + "ImputeTransform": { + "additionalProperties": false, + "properties": { + "frame": { + "description": "A frame specification as a two-element array used to control the window over which the specified method is applied. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded rows preceding or following the current data object. For example, the value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object.\n\n__Default value:__: `[null, null]` indicating that the window includes all objects.", + "items": { + "type": [ + "null", + "number" + ] + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "groupby": { + "description": "An optional array of fields by which to group the values. Imputation will then be performed on a per-group basis.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "impute": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which the missing values should be imputed." + }, + "key": { + "$ref": "#/definitions/FieldName", + "description": "A key field that uniquely identifies data objects within a group. Missing key values (those occurring in the data but not in the current group) will be imputed." + }, + "keyvals": { + "anyOf": [ + { + "items": {}, + "type": "array" + }, + { + "$ref": "#/definitions/ImputeSequence" + } + ], + "description": "Defines the key values that should be considered for imputation. An array of key values or an object defining a [number sequence](https://vega.github.io/vega-lite/docs/impute.html#sequence-def).\n\nIf provided, this will be used in addition to the key values observed within the input data. If not provided, the values will be derived from all unique values of the `key` field. For `impute` in `encoding`, the key field is the x-field if the y-field is imputed, or vice versa.\n\nIf there is no impute grouping, this property _must_ be specified." + }, + "method": { + "$ref": "#/definitions/ImputeMethod", + "description": "The imputation method to use for the field value of imputed data objects. One of `\"value\"`, `\"mean\"`, `\"median\"`, `\"max\"` or `\"min\"`.\n\n__Default value:__ `\"value\"`" + }, + "value": { + "description": "The field value to use when the imputation `method` is `\"value\"`." + } + }, + "required": [ + "impute", + "key" + ], + "type": "object" + }, + "InlineData": { + "additionalProperties": false, + "properties": { + "format": { + "$ref": "#/definitions/DataFormat", + "description": "An object that specifies the format for parsing the data." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "values": { + "$ref": "#/definitions/InlineDataset", + "description": "The full data set, included inline. This can be an array of objects or primitive values, an object, or a string. Arrays of primitive values are ingested as objects with a `data` property. Strings are parsed according to the specified format type." + } + }, + "required": [ + "values" + ], + "type": "object" + }, + "InlineDataset": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "object" + } + ] + }, + "Interpolate": { + "enum": [ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after" + ], + "type": "string" + }, + "IntervalSelectionConfig": { + "additionalProperties": false, + "properties": { + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. This property can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable clear.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear` examples ](https://vega.github.io/vega-lite/docs/selection.html#clear) in the documentation." + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "mark": { + "$ref": "#/definitions/BrushConfig", + "description": "An interval selection also adds a rectangle mark to depict the extents of the interval. The `mark` property can be used to customize the appearance of the mark.\n\n__See also:__ [`mark` examples](https://vega.github.io/vega-lite/docs/selection.html#mark) in the documentation." + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + } + ], + "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection. For interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters).\n\n__See also:__ [`on` examples](https://vega.github.io/vega-lite/docs/selection.html#on) in the documentation." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain.\n\nOne of:\n- `\"global\"` -- only one brush exists for the entire SPLOM. When the user begins to drag, any previous brushes are cleared, and a new one is constructed.\n- `\"union\"` -- each cell contains its own brush, and points are highlighted if they lie within _any_ of these individual brushes.\n- `\"intersect\"` -- each cell contains its own brush, and points are highlighted only if they fall within _all_ of these individual brushes.\n\n__Default value:__ `global`.\n\n__See also:__ [`resolve` examples](https://vega.github.io/vega-lite/docs/selection.html#resolve) in the documentation." + }, + "translate": { + "description": "When truthy, allows a user to interactively move an interval selection back-and-forth. Can be `true`, `false` (to disable panning), or a [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/) which must include a start and end event to trigger continuous panning. Discrete panning (e.g., pressing the left/right arrow keys) will be supported in future versions.\n\n__Default value:__ `true`, which corresponds to `[mousedown, window:mouseup] > window:mousemove!`. This default allows users to clicks and drags within an interval selection to reposition it.\n\n__See also:__ [`translate` examples](https://vega.github.io/vega-lite/docs/selection.html#translate) in the documentation.", + "type": [ + "string", + "boolean" + ] + }, + "type": { + "const": "interval", + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types:\n\n- `\"point\"` -- to select multiple discrete data values; the first value is selected on `click` and additional values toggled on shift-click.\n- `\"interval\"` -- to select a continuous range of data values on `drag`.", + "type": "string" + }, + "zoom": { + "description": "When truthy, allows a user to interactively resize an interval selection. Can be `true`, `false` (to disable zooming), or a [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/). Currently, only `wheel` events are supported, but custom event streams can still be used to specify filters, debouncing, and throttling. Future versions will expand the set of events that can trigger this transformation.\n\n__Default value:__ `true`, which corresponds to `wheel!`. This default allows users to use the mouse wheel to resize an interval selection.\n\n__See also:__ [`zoom` examples](https://vega.github.io/vega-lite/docs/selection.html#zoom) in the documentation.", + "type": [ + "string", + "boolean" + ] + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "IntervalSelectionConfigWithoutType": { + "additionalProperties": false, + "properties": { + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. This property can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable clear.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear` examples ](https://vega.github.io/vega-lite/docs/selection.html#clear) in the documentation." + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "mark": { + "$ref": "#/definitions/BrushConfig", + "description": "An interval selection also adds a rectangle mark to depict the extents of the interval. The `mark` property can be used to customize the appearance of the mark.\n\n__See also:__ [`mark` examples](https://vega.github.io/vega-lite/docs/selection.html#mark) in the documentation." + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + } + ], + "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection. For interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters).\n\n__See also:__ [`on` examples](https://vega.github.io/vega-lite/docs/selection.html#on) in the documentation." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain.\n\nOne of:\n- `\"global\"` -- only one brush exists for the entire SPLOM. When the user begins to drag, any previous brushes are cleared, and a new one is constructed.\n- `\"union\"` -- each cell contains its own brush, and points are highlighted if they lie within _any_ of these individual brushes.\n- `\"intersect\"` -- each cell contains its own brush, and points are highlighted only if they fall within _all_ of these individual brushes.\n\n__Default value:__ `global`.\n\n__See also:__ [`resolve` examples](https://vega.github.io/vega-lite/docs/selection.html#resolve) in the documentation." + }, + "translate": { + "description": "When truthy, allows a user to interactively move an interval selection back-and-forth. Can be `true`, `false` (to disable panning), or a [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/) which must include a start and end event to trigger continuous panning. Discrete panning (e.g., pressing the left/right arrow keys) will be supported in future versions.\n\n__Default value:__ `true`, which corresponds to `[mousedown, window:mouseup] > window:mousemove!`. This default allows users to clicks and drags within an interval selection to reposition it.\n\n__See also:__ [`translate` examples](https://vega.github.io/vega-lite/docs/selection.html#translate) in the documentation.", + "type": [ + "string", + "boolean" + ] + }, + "zoom": { + "description": "When truthy, allows a user to interactively resize an interval selection. Can be `true`, `false` (to disable zooming), or a [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/). Currently, only `wheel` events are supported, but custom event streams can still be used to specify filters, debouncing, and throttling. Future versions will expand the set of events that can trigger this transformation.\n\n__Default value:__ `true`, which corresponds to `wheel!`. This default allows users to use the mouse wheel to resize an interval selection.\n\n__See also:__ [`zoom` examples](https://vega.github.io/vega-lite/docs/selection.html#zoom) in the documentation.", + "type": [ + "string", + "boolean" + ] + } + }, + "type": "object" + }, + "JoinAggregateFieldDef": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output name for the join aggregate operation." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which to compute the aggregate function. This can be omitted for functions that do not operate over a field such as `\"count\"`." + }, + "op": { + "$ref": "#/definitions/AggregateOp", + "description": "The aggregation operation to apply (e.g., `\"sum\"`, `\"average\"` or `\"count\"`). See the list of all supported operations [here](https://vega.github.io/vega-lite/docs/aggregate.html#ops)." + } + }, + "required": [ + "op", + "as" + ], + "type": "object" + }, + "JoinAggregateTransform": { + "additionalProperties": false, + "properties": { + "groupby": { + "description": "The data fields for partitioning the data objects into separate groups. If unspecified, all data points will be in a single group.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "joinaggregate": { + "description": "The definition of the fields in the join aggregate, and what calculations to use.", + "items": { + "$ref": "#/definitions/JoinAggregateFieldDef" + }, + "type": "array" + } + }, + "required": [ + "joinaggregate" + ], + "type": "object" + }, + "JsonDataFormat": { + "additionalProperties": false, + "properties": { + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using JavaScript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: \"utc:'%m%d%Y'\"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)" + }, + "property": { + "description": "The JSON property containing the desired data. This parameter can be used when the loaded JSON file may have surrounding structure or meta-data. For example `\"property\": \"values.features\"` is equivalent to retrieving `json.values.features` from the loaded JSON object.", + "type": "string" + }, + "type": { + "const": "json", + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `\"json\"` will be used by default.", + "type": "string" + } + }, + "type": "object" + }, + "LabelOverlap": { + "anyOf": [ + { + "type": "boolean" + }, + { + "const": "parity", + "type": "string" + }, + { + "const": "greedy", + "type": "string" + } + ] + }, + "LatLongDef": { + "anyOf": [ + { + "$ref": "#/definitions/LatLongFieldDef" + }, + { + "$ref": "#/definitions/DatumDef" + } + ] + }, + "LatLongFieldDef": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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": { + "const": "quantitative", + "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": "string" + } + }, + "type": "object" + }, + "LayerRepeatMapping": { + "additionalProperties": false, + "properties": { + "column": { + "description": "An array of fields to be repeated horizontally.", + "items": { + "type": "string" + }, + "type": "array" + }, + "layer": { + "description": "An array of fields to be repeated as layers.", + "items": { + "type": "string" + }, + "type": "array" + }, + "row": { + "description": "An array of fields to be repeated vertically.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "layer" + ], + "type": "object" + }, + "LayerRepeatSpec": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "repeat": { + "$ref": "#/definitions/LayerRepeatMapping", + "description": "Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If `\"repeat\"` is an array, the field can be referred to as `{\"repeat\": \"repeat\"}`. The repeated views are laid out in a wrapped row. You can set the number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"column\"` to the listed fields to be repeated along the particular orientations. The objects `{\"repeat\": \"row\"}` and `{\"repeat\": \"column\"}` can be used to refer to the repeated field respectively." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ], + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + }, + "LayerSpec": { + "additionalProperties": false, + "description": "A full layered plot specification, which may contains `encoding` and `projection` properties that will be applied to underlying unit (single-view) specifications.", + "properties": { + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/SharedEncoding", + "description": "A shared key-value mapping between encoding channels and definition of fields in the underlying layers." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number.\n- For a plot with either a discrete y-field or no y-field, height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step. (No y-field is equivalent to having one discrete step.)\n- To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." + }, + "layer": { + "description": "Layer or single view specifications to be layered.\n\n__Note__: Specifications inside `layer` cannot use `row` and `column` channels as layering facet specifications is not allowed. Instead, use the [facet operator](https://vega.github.io/vega-lite/docs/facet.html) and place a layer inside a facet.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ] + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of the geographic projection shared by underlying layers." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number.\n- For a plot with either a discrete x-field or no x-field, width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step. (No x-field is equivalent to having one discrete step.)\n- To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." + } + }, + "required": [ + "layer" + ], + "type": "object" + }, + "LayoutAlign": { + "enum": [ + "all", + "each", + "none" + ], + "type": "string" + }, + "Legend": { + "additionalProperties": false, + "description": "Properties of a legend or boolean flag for determining whether to show it.", + "properties": { + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the legend from the ARIA accessibility tree.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "clipHeight": { + "anyOf": [ + { + "description": "The height in pixels to clip symbol legend entries and limit their size.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "columnPadding": { + "anyOf": [ + { + "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "columns": { + "anyOf": [ + { + "description": "The number of columns in which to arrange symbol legend entries. A value of `0` or lower indicates a single row with one column per entry.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadius": { + "anyOf": [ + { + "description": "Corner radius for the full legend.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of this legend for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If the `aria` property is true, for SVG output the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) will be set to this description. If the description is unspecified it will be automatically generated.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "direction": { + "$ref": "#/definitions/Orientation", + "description": "The direction of the legend, one of `\"vertical\"` or `\"horizontal\"`.\n\n__Default value:__\n- For top-/bottom-`orient`ed legends, `\"horizontal\"`\n- For left-/right-`orient`ed legends, `\"vertical\"`\n- For top/bottom-left/right-`orient`ed legends, `\"horizontal\"` for gradient legends and `\"vertical\"` for symbol legends." + }, + "fillColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Background fill color for the full legend." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "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." + }, + "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`.", + "type": "string" + }, + "gradientLength": { + "anyOf": [ + { + "description": "The length in pixels of the primary axis of a color gradient. This value corresponds to the height of a vertical gradient or the width of a horizontal gradient.\n\n__Default value:__ `200`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientOpacity": { + "anyOf": [ + { + "description": "Opacity of the color gradient.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientStrokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the gradient stroke, can be in hex color code or regular color name.\n\n__Default value:__ `\"lightGray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientStrokeWidth": { + "anyOf": [ + { + "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientThickness": { + "anyOf": [ + { + "description": "The thickness in pixels of the color gradient. This value corresponds to the width of a vertical gradient or the height of a horizontal gradient.\n\n__Default value:__ `16`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gridAlign": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign", + "description": "The alignment to apply to symbol legends rows and columns. The supported string values are `\"all\"`, `\"each\"` (the default), and `none`. For more information, see the [grid layout documentation](https://vega.github.io/vega/docs/layout).\n\n__Default value:__ `\"each\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "The alignment of the legend label, can be left, center, or right." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "The position of the baseline of legend label, can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`.\n\n__Default value:__ `\"middle\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend label, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the legend's backing `datum` object.", + "type": "string" + }, + "labelFont": { + "anyOf": [ + { + "description": "The font of the legend label.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontSize": { + "anyOf": [ + { + "description": "The font size of legend label.\n\n__Default value:__ `10`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOffset": { + "anyOf": [ + { + "description": "The offset of the legend label.\n\n__Default value:__ `4`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOpacity": { + "anyOf": [ + { + "description": "Opacity of labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOverlap": { + "anyOf": [ + { + "$ref": "#/definitions/LabelOverlap", + "description": "The strategy to use for resolving overlap of labels in gradient legends. If `false`, no overlap reduction is attempted. If set to `true` (default) 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:__ `true`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelPadding": { + "anyOf": [ + { + "description": "Padding in pixels between the legend and legend labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelSeparation": { + "anyOf": [ + { + "description": "The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default `0`). This property is ignored if *labelOverlap* resolution is not enabled.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "legendX": { + "anyOf": [ + { + "description": "Custom x-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "legendY": { + "anyOf": [ + { + "description": "Custom y-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "anyOf": [ + { + "description": "The offset in pixels by which to displace the legend from the data rectangle and axes.\n\n__Default value:__ `18`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "orient": { + "$ref": "#/definitions/LegendOrient", + "description": "The orientation of the legend, which determines how the legend is positioned within the scene. One of `\"left\"`, `\"right\"`, `\"top\"`, `\"bottom\"`, `\"top-left\"`, `\"top-right\"`, `\"bottom-left\"`, `\"bottom-right\"`, `\"none\"`.\n\n__Default value:__ `\"right\"`" + }, + "padding": { + "anyOf": [ + { + "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "rowPadding": { + "anyOf": [ + { + "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Border stroke color for the full legend." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolFillColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend symbol," + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolLimit": { + "anyOf": [ + { + "description": "The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolOffset": { + "anyOf": [ + { + "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolOpacity": { + "anyOf": [ + { + "description": "Opacity of the legend symbols.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolSize": { + "anyOf": [ + { + "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolStrokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Stroke color for legend symbols." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolStrokeWidth": { + "anyOf": [ + { + "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolType": { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape", + "description": "The symbol shape. One of the plotting shapes `circle` (default), `square`, `cross`, `diamond`, `triangle-up`, `triangle-down`, `triangle-right`, or `triangle-left`, the line symbol `stroke`, or one of the centered directional shapes `arrow`, `wedge`, or `triangle`. Alternatively, a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) can be provided. For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.\n\n__Default value:__ `\"circle\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickCount": { + "anyOf": [ + { + "$ref": "#/definitions/TickCount", + "description": "The desired number of tick values for quantitative legends." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickMinStep": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The minimum desired step between legend ticks, in terms of scale domain values. For example, a value of `1` indicates that ticks should not be less than 1 unit apart. If `tickMinStep` is specified, the `tickCount` value will be adjusted, if necessary, to enforce the minimum step value.\n\n__Default value__: `undefined`" + }, + "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." + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAnchor": { + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing legend titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for legend titles. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone.\n\n__Default value:__ `\"top\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend title, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFont": { + "anyOf": [ + { + "description": "The font of the legend title.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontSize": { + "anyOf": [ + { + "description": "The font size of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of the legend title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOpacity": { + "anyOf": [ + { + "description": "Opacity of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOrient": { + "anyOf": [ + { + "$ref": "#/definitions/Orient", + "description": "Orientation of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titlePadding": { + "anyOf": [ + { + "description": "The padding, in pixels, between title and legend.\n\n__Default value:__ `5`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "type": { + "description": "The type of the legend. Use `\"symbol\"` to create a discrete legend and `\"gradient\"` for a continuous color gradient.\n\n__Default value:__ `\"gradient\"` for non-binned quantitative fields and temporal fields; `\"symbol\"` otherwise.", + "enum": [ + "symbol", + "gradient" + ], + "type": "string" + }, + "values": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Explicitly set the visible legend values." + }, + "zindex": { + "description": "A non-negative integer indicating the z-index of the legend. If zindex is 0, legend should be drawn behind all chart elements. To put them in front, use zindex = 1.", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "LegendBinding": { + "anyOf": [ + { + "const": "legend", + "type": "string" + }, + { + "$ref": "#/definitions/LegendStreamBinding" + } + ] + }, + "LegendConfig": { + "additionalProperties": false, + "properties": { + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the legend from the ARIA accessibility tree.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "clipHeight": { + "anyOf": [ + { + "description": "The height in pixels to clip symbol legend entries and limit their size.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "columnPadding": { + "anyOf": [ + { + "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "columns": { + "anyOf": [ + { + "description": "The number of columns in which to arrange symbol legend entries. A value of `0` or lower indicates a single row with one column per entry.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadius": { + "anyOf": [ + { + "description": "Corner radius for the full legend.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of this legend for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If the `aria` property is true, for SVG output the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) will be set to this description. If the description is unspecified it will be automatically generated.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "direction": { + "$ref": "#/definitions/Orientation", + "description": "The direction of the legend, one of `\"vertical\"` or `\"horizontal\"`.\n\n__Default value:__\n- For top-/bottom-`orient`ed legends, `\"horizontal\"`\n- For left-/right-`orient`ed legends, `\"vertical\"`\n- For top/bottom-left/right-`orient`ed legends, `\"horizontal\"` for gradient legends and `\"vertical\"` for symbol legends." + }, + "disable": { + "description": "Disable legend by default", + "type": "boolean" + }, + "fillColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Background fill color for the full legend." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientDirection": { + "anyOf": [ + { + "$ref": "#/definitions/Orientation", + "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for gradient legends.\n\n__Default value:__ `\"vertical\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientHorizontalMaxLength": { + "description": "Max legend length for a horizontal gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `200`", + "type": "number" + }, + "gradientHorizontalMinLength": { + "description": "Min legend length for a horizontal gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `100`", + "type": "number" + }, + "gradientLabelLimit": { + "anyOf": [ + { + "description": "The maximum allowed length in pixels of color ramp gradient labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientLabelOffset": { + "anyOf": [ + { + "description": "Vertical offset in pixels for color ramp gradient labels.\n\n__Default value:__ `2`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientLength": { + "anyOf": [ + { + "description": "The length in pixels of the primary axis of a color gradient. This value corresponds to the height of a vertical gradient or the width of a horizontal gradient.\n\n__Default value:__ `200`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientOpacity": { + "anyOf": [ + { + "description": "Opacity of the color gradient.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientStrokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the gradient stroke, can be in hex color code or regular color name.\n\n__Default value:__ `\"lightGray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientStrokeWidth": { + "anyOf": [ + { + "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientThickness": { + "anyOf": [ + { + "description": "The thickness in pixels of the color gradient. This value corresponds to the width of a vertical gradient or the height of a horizontal gradient.\n\n__Default value:__ `16`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientVerticalMaxLength": { + "description": "Max legend length for a vertical gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `200`", + "type": "number" + }, + "gradientVerticalMinLength": { + "description": "Min legend length for a vertical gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `100`", + "type": "number" + }, + "gridAlign": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign", + "description": "The alignment to apply to symbol legends rows and columns. The supported string values are `\"all\"`, `\"each\"` (the default), and `none`. For more information, see the [grid layout documentation](https://vega.github.io/vega/docs/layout).\n\n__Default value:__ `\"each\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "The alignment of the legend label, can be left, center, or right." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "The position of the baseline of legend label, can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`.\n\n__Default value:__ `\"middle\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend label, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFont": { + "anyOf": [ + { + "description": "The font of the legend label.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontSize": { + "anyOf": [ + { + "description": "The font size of legend label.\n\n__Default value:__ `10`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOffset": { + "anyOf": [ + { + "description": "The offset of the legend label.\n\n__Default value:__ `4`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOpacity": { + "anyOf": [ + { + "description": "Opacity of labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOverlap": { + "anyOf": [ + { + "$ref": "#/definitions/LabelOverlap" + }, + { + "$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`." + }, + "labelPadding": { + "anyOf": [ + { + "description": "Padding in pixels between the legend and legend labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelSeparation": { + "anyOf": [ + { + "description": "The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default `0`). This property is ignored if *labelOverlap* resolution is not enabled.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "layout": { + "$ref": "#/definitions/ExprRef" + }, + "legendX": { + "anyOf": [ + { + "description": "Custom x-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "legendY": { + "anyOf": [ + { + "description": "Custom y-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "anyOf": [ + { + "description": "The offset in pixels by which to displace the legend from the data rectangle and axes.\n\n__Default value:__ `18`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "orient": { + "$ref": "#/definitions/LegendOrient", + "description": "The orientation of the legend, which determines how the legend is positioned within the scene. One of `\"left\"`, `\"right\"`, `\"top\"`, `\"bottom\"`, `\"top-left\"`, `\"top-right\"`, `\"bottom-left\"`, `\"bottom-right\"`, `\"none\"`.\n\n__Default value:__ `\"right\"`" + }, + "padding": { + "anyOf": [ + { + "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "rowPadding": { + "anyOf": [ + { + "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Border stroke color for the full legend." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "Border stroke dash pattern for the full legend.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "Border stroke width for the full legend.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolBaseFillColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Default fill color for legend symbols. Only applied if there is no `\"fill\"` scale color encoding for the legend.\n\n__Default value:__ `\"transparent\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolBaseStrokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Default stroke color for legend symbols. Only applied if there is no `\"fill\"` scale color encoding for the legend.\n\n__Default value:__ `\"gray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolDirection": { + "anyOf": [ + { + "$ref": "#/definitions/Orientation", + "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for symbol legends.\n\n__Default value:__ `\"vertical\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolFillColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend symbol," + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolLimit": { + "anyOf": [ + { + "description": "The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolOffset": { + "anyOf": [ + { + "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolOpacity": { + "anyOf": [ + { + "description": "Opacity of the legend symbols.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolSize": { + "anyOf": [ + { + "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolStrokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Stroke color for legend symbols." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolStrokeWidth": { + "anyOf": [ + { + "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolType": { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape", + "description": "The symbol shape. One of the plotting shapes `circle` (default), `square`, `cross`, `diamond`, `triangle-up`, `triangle-down`, `triangle-right`, or `triangle-left`, the line symbol `stroke`, or one of the centered directional shapes `arrow`, `wedge`, or `triangle`. Alternatively, a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) can be provided. For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.\n\n__Default value:__ `\"circle\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickCount": { + "anyOf": [ + { + "$ref": "#/definitions/TickCount", + "description": "The desired number of tick values for quantitative legends." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "title": { + "description": "Set to null to disable title for the axis, legend, or header.", + "type": "null" + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAnchor": { + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing legend titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for legend titles. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone.\n\n__Default value:__ `\"top\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend title, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFont": { + "anyOf": [ + { + "description": "The font of the legend title.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontSize": { + "anyOf": [ + { + "description": "The font size of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of the legend title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOpacity": { + "anyOf": [ + { + "description": "Opacity of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOrient": { + "anyOf": [ + { + "$ref": "#/definitions/Orient", + "description": "Orientation of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titlePadding": { + "anyOf": [ + { + "description": "The padding, in pixels, between title and legend.\n\n__Default value:__ `5`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "unselectedOpacity": { + "description": "The opacity of unselected legend entries.\n\n__Default value:__ 0.35.", + "type": "number" + }, + "zindex": { + "anyOf": [ + { + "description": "The integer z-index indicating the layering of the legend group relative to other axis, mark, and legend groups.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + } + }, + "type": "object" + }, + "LegendOrient": { + "enum": [ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ], + "type": "string" + }, + "LegendResolveMap": { + "additionalProperties": false, + "properties": { + "angle": { + "$ref": "#/definitions/ResolveMode" + }, + "color": { + "$ref": "#/definitions/ResolveMode" + }, + "fill": { + "$ref": "#/definitions/ResolveMode" + }, + "fillOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "opacity": { + "$ref": "#/definitions/ResolveMode" + }, + "shape": { + "$ref": "#/definitions/ResolveMode" + }, + "size": { + "$ref": "#/definitions/ResolveMode" + }, + "stroke": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeDash": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeWidth": { + "$ref": "#/definitions/ResolveMode" + } + }, + "type": "object" + }, + "LegendStreamBinding": { + "additionalProperties": false, + "properties": { + "legend": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Stream" + } + ] + } + }, + "required": [ + "legend" + ], + "type": "object" + }, + "LineConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." + }, + "outerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "point": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + }, + { + "const": "transparent", + "type": "string" + } + ], + "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", + "minimum": 0 + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "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" + }, + "timeUnitBandSize": { + "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "LinearGradient": { + "additionalProperties": false, + "properties": { + "gradient": { + "const": "linear", + "description": "The type of gradient. Use `\"linear\"` for a linear gradient.", + "type": "string" + }, + "id": { + "type": "string" + }, + "stops": { + "description": "An array of gradient stops defining the gradient color sequence.", + "items": { + "$ref": "#/definitions/GradientStop" + }, + "type": "array" + }, + "x1": { + "description": "The starting x-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `0`", + "type": "number" + }, + "x2": { + "description": "The ending x-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `1`", + "type": "number" + }, + "y1": { + "description": "The starting y-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `0`", + "type": "number" + }, + "y2": { + "description": "The ending y-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `0`", + "type": "number" + } + }, + "required": [ + "gradient", + "stops" + ], + "type": "object" + }, + "LocalMultiTimeUnit": { + "enum": [ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds" + ], + "type": "string" + }, + "LocalSingleTimeUnit": { + "enum": [ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds" + ], + "type": "string" + }, + "Locale": { + "additionalProperties": false, + "properties": { + "number": { + "$ref": "#/definitions/NumberLocale" + }, + "time": { + "$ref": "#/definitions/TimeLocale" + } + }, + "type": "object" + }, + "LoessTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for the smoothed points generated by the loess transform.\n\n__Default value:__ The field names of the input x and y values.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "bandwidth": { + "description": "A bandwidth parameter in the range `[0, 1]` that determines the amount of smoothing.\n\n__Default value:__ `0.3`", + "type": "number" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "loess": { + "$ref": "#/definitions/FieldName", + "description": "The data field of the dependent variable to smooth." + }, + "on": { + "$ref": "#/definitions/FieldName", + "description": "The data field of the independent variable to use a predictor." + } + }, + "required": [ + "loess", + "on" + ], + "type": "object" + }, + "LogicalAnd": { + "additionalProperties": false, + "properties": { + "and": { + "items": { + "$ref": "#/definitions/PredicateComposition" + }, + "type": "array" + } + }, + "required": [ + "and" + ], + "type": "object" + }, + "PredicateComposition": { + "anyOf": [ + { + "$ref": "#/definitions/LogicalNot" + }, + { + "$ref": "#/definitions/LogicalAnd" + }, + { + "$ref": "#/definitions/LogicalOr" + }, + { + "$ref": "#/definitions/Predicate" + } + ] + }, + "LogicalNot": { + "additionalProperties": false, + "properties": { + "not": { + "$ref": "#/definitions/PredicateComposition" + } + }, + "required": [ + "not" + ], + "type": "object" + }, + "LogicalOr": { + "additionalProperties": false, + "properties": { + "or": { + "items": { + "$ref": "#/definitions/PredicateComposition" + }, + "type": "array" + } + }, + "required": [ + "or" + ], + "type": "object" + }, + "LookupData": { + "additionalProperties": false, + "properties": { + "data": { + "$ref": "#/definitions/Data", + "description": "Secondary data source to lookup in." + }, + "fields": { + "description": "Fields in foreign data or selection to lookup. If not specified, the entire object is queried.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "key": { + "$ref": "#/definitions/FieldName", + "description": "Key in data to lookup." + } + }, + "required": [ + "data", + "key" + ], + "type": "object" + }, + "LookupSelection": { + "additionalProperties": false, + "properties": { + "fields": { + "description": "Fields in foreign data or selection to lookup. If not specified, the entire object is queried.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "key": { + "$ref": "#/definitions/FieldName", + "description": "Key in data to lookup." + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Selection parameter name to look up." + } + }, + "required": [ + "key", + "param" + ], + "type": "object" + }, + "LookupTransform": { + "additionalProperties": false, + "properties": { + "as": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + ], + "description": "The output fields on which to store the looked up data values.\n\nFor data lookups, this property may be left blank if `from.fields` has been specified (those field names will be used); if `from.fields` has not been specified, `as` must be a string.\n\nFor selection lookups, this property is optional: if unspecified, looked up values will be stored under a property named for the selection; and if specified, it must correspond to `from.fields`." + }, + "default": { + "description": "The default value to use if lookup fails.\n\n__Default value:__ `null`" + }, + "from": { + "anyOf": [ + { + "$ref": "#/definitions/LookupData" + }, + { + "$ref": "#/definitions/LookupSelection" + } + ], + "description": "Data source or selection for secondary data reference." + }, + "lookup": { + "description": "Key in primary data source.", + "type": "string" + } + }, + "required": [ + "lookup", + "from" + ], + "type": "object" + }, + "Mark": { + "description": "All types of primitive marks.", + "enum": [ + "arc", + "area", + "bar", + "image", + "line", + "point", + "rect", + "rule", + "text", + "tick", + "trail", + "circle", + "square", + "geoshape" + ], + "type": "string" + }, + "MarkConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." + }, + "outerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", + "minimum": 0 + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "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" + }, + "timeUnitBandSize": { + "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "MarkDef": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "bandSize": { + "description": "The width of the ticks.\n\n__Default value:__ 3/4 of step (width step for horizontal ticks and height step for vertical ticks).", + "minimum": 0, + "type": "number" + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "binSpacing": { + "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "clip": { + "description": "Whether a mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "continuousBandSize": { + "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusEnd": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For vertical bars, top-left and top-right corner radius.\n\n- For horizontal bars, top-right and bottom-right corner radius." + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "discreteBandSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RelativeBandSize" + } + ], + "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.", + "minimum": 0 + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RelativeBandSize" + } + ], + "description": "Height of the marks. One of:\n\n- A number representing a fixed pixel height.\n\n- A relative band size definition. For example, `{band: 0.5}` represents half of the band" + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "line": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + } + ], + "description": "A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines.\n\n- If this value is an empty object (`{}`) or `true`, lines with default properties will be used.\n\n- If this value is `false`, no lines would be automatically added to area marks.\n\n__Default value:__ `false`." + }, + "lineBreak": { + "anyOf": [ + { + "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." + }, + "outerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "point": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + }, + { + "const": "transparent", + "type": "string" + } + ], + "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", + "minimum": 0 + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "radius2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for radius2." + }, + "radiusOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for radius." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "A string or array of strings indicating the name of custom styles to apply to the mark. A style is a named collection of mark property defaults defined within the [style configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles. Any [mark properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly defined within the `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by default. __Note:__ Any specified style will augment the default style. For example, a bar mark with `\"style\": \"foo\"` will receive from `config.style.bar` and `config.style.foo` (the specified style `\"foo\"` has higher precedence)." + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "theta2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for theta2." + }, + "thetaOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for theta." + }, + "thickness": { + "description": "Thickness of the tick mark.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "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" + }, + "timeUnitBandSize": { + "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "type": { + "$ref": "#/definitions/Mark", + "description": "The mark type. This could a primitive mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`) or a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RelativeBandSize" + } + ], + "description": "Width of the marks. One of:\n\n- A number representing a fixed pixel width.\n\n- A relative band size definition. For example, `{band: 0.5}` represents half of the band." + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for x2-position." + }, + "xOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for x-position." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for y2-position." + }, + "yOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for y-position." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "MarkPropDef<(Gradient|string|null)>": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" + } + ] + }, + "MarkPropDef<(string|null),TypeForShape>": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition,(string|null)>" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition,(string|null)>" + } + ] + }, + "MarkPropDef": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" + } + ] + }, + "MarkPropDef": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" + } + ] + }, + "MarkType": { + "enum": [ + "arc", + "area", + "image", + "group", + "line", + "path", + "rect", + "rule", + "shape", + "symbol", + "text", + "trail" + ], + "type": "string" + }, + "MergedStream": { + "additionalProperties": false, + "properties": { + "between": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" + }, + "consume": { + "type": "boolean" + }, + "debounce": { + "type": "number" + }, + "filter": { + "anyOf": [ + { + "$ref": "#/definitions/Expr" + }, + { + "items": { + "$ref": "#/definitions/Expr" + }, + "type": "array" + } + ] + }, + "markname": { + "type": "string" + }, + "marktype": { + "$ref": "#/definitions/MarkType" + }, + "merge": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" + }, + "throttle": { + "type": "number" + } + }, + "required": [ + "merge" + ], + "type": "object" + }, + "Month": { + "maximum": 12, + "minimum": 1, + "type": "number" + }, + "MultiTimeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/LocalMultiTimeUnit" + }, + { + "$ref": "#/definitions/UtcMultiTimeUnit" + } + ] + }, + "NamedData": { + "additionalProperties": false, + "properties": { + "format": { + "$ref": "#/definitions/DataFormat", + "description": "An object that specifies the format for parsing the data." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "NonArgAggregateOp": { + "enum": [ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep" + ], + "type": "string" + }, + "NonLayerRepeatSpec": { + "additionalProperties": false, + "description": "Base interface for a repeat specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "repeat": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/RepeatMapping" + } + ], + "description": "Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If `\"repeat\"` is an array, the field can be referred to as `{\"repeat\": \"repeat\"}`. The repeated views are laid out in a wrapped row. You can set the number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"column\"` to the listed fields to be repeated along the particular orientations. The objects `{\"repeat\": \"row\"}` and `{\"repeat\": \"column\"}` can be used to refer to the repeated field respectively." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "spec": { + "$ref": "#/definitions/NonNormalizedSpec", + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + }, + "NonNormalizedSpec": { + "$ref": "#/definitions/Spec" + }, + "NumberLocale": { + "additionalProperties": false, + "description": "Locale definition for formatting numbers.", + "properties": { + "currency": { + "$ref": "#/definitions/Vector2", + "description": "The currency prefix and suffix (e.g., [\"$\", \"\"])." + }, + "decimal": { + "description": "The decimal point (e.g., \".\").", + "type": "string" + }, + "grouping": { + "description": "The array of group sizes (e.g., [3]), cycled as needed.", + "items": { + "type": "number" + }, + "type": "array" + }, + "minus": { + "description": "The minus sign (defaults to hyphen-minus, \"-\").", + "type": "string" + }, + "nan": { + "description": "The not-a-number value (defaults to \"NaN\").", + "type": "string" + }, + "numerals": { + "$ref": "#/definitions/Vector10", + "description": "An array of ten strings to replace the numerals 0-9." + }, + "percent": { + "description": "The percent sign (defaults to \"%\").", + "type": "string" + }, + "thousands": { + "description": "The group separator (e.g., \",\").", + "type": "string" + } + }, + "required": [ + "decimal", + "thousands", + "grouping", + "currency" + ], + "type": "object" + }, + "NumericArrayMarkPropDef": { + "$ref": "#/definitions/MarkPropDef" + }, + "NumericMarkPropDef": { + "$ref": "#/definitions/MarkPropDef" + }, + "OffsetDef": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleFieldDef" + }, + { + "$ref": "#/definitions/ScaleDatumDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ] + }, + "OrderFieldDef": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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`." + }, + "sort": { + "$ref": "#/definitions/SortOrder", + "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "OrderValueDef": { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "Orient": { + "enum": [ + "left", + "right", + "top", + "bottom" + ], + "type": "string" + }, + "Orientation": { + "enum": [ + "horizontal", + "vertical" + ], + "type": "string" + }, + "OverlayMarkDef": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "clip": { + "description": "Whether a mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." + }, + "outerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", + "minimum": 0 + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "radius2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for radius2." + }, + "radiusOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for radius." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "A string or array of strings indicating the name of custom styles to apply to the mark. A style is a named collection of mark property defaults defined within the [style configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles. Any [mark properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly defined within the `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by default. __Note:__ Any specified style will augment the default style. For example, a bar mark with `\"style\": \"foo\"` will receive from `config.style.bar` and `config.style.foo` (the specified style `\"foo\"` has higher precedence)." + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "theta2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for theta2." + }, + "thetaOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for theta." + }, + "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" + }, + "timeUnitBandSize": { + "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for x2-position." + }, + "xOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for x-position." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for y2-position." + }, + "yOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for y-position." + } + }, + "type": "object" + }, + "Padding": { + "anyOf": [ + { + "type": "number" + }, + { + "additionalProperties": false, + "properties": { + "bottom": { + "type": "number" + }, + "left": { + "type": "number" + }, + "right": { + "type": "number" + }, + "top": { + "type": "number" + } + }, + "type": "object" + } + ], + "minimum": 0 + }, + "ParameterExtent": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "If a selection parameter is specified, the field name to extract selected values for when the selection is [projected](https://vega.github.io/vega-lite/docs/selection.html#project) over multiple fields or encodings." + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "The name of a parameter." + } + }, + "required": [ + "param" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "encoding": { + "$ref": "#/definitions/SingleDefUnitChannel", + "description": "If a selection parameter is specified, the encoding channel to extract selected values for when a selection is [projected](https://vega.github.io/vega-lite/docs/selection.html#project) over multiple fields or encodings." + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "The name of a parameter." + } + }, + "required": [ + "param" + ], + "type": "object" + } + ] + }, + "ParameterName": { + "type": "string" + }, + "ParameterPredicate": { + "additionalProperties": false, + "properties": { + "empty": { + "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", + "type": "boolean" + }, + "param": { + "$ref": "#/definitions/ParameterName", + "description": "Filter using a parameter name." + } + }, + "required": [ + "param" + ], + "type": "object" + }, + "Parse": { + "additionalProperties": { + "$ref": "#/definitions/ParseValue" + }, + "type": "object" + }, + "ParseValue": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "const": "string", + "type": "string" + }, + { + "const": "boolean", + "type": "string" + }, + { + "const": "date", + "type": "string" + }, + { + "const": "number", + "type": "string" + } + ] + }, + "PivotTransform": { + "additionalProperties": false, + "properties": { + "groupby": { + "description": "The optional data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "limit": { + "description": "An optional parameter indicating the maximum number of pivoted fields to generate. The default (`0`) applies no limit. The pivoted `pivot` names are sorted in ascending order prior to enforcing the limit. __Default value:__ `0`", + "type": "number" + }, + "op": { + "$ref": "#/definitions/AggregateOp", + "description": "The aggregation operation to apply to grouped `value` field values. __Default value:__ `sum`" + }, + "pivot": { + "$ref": "#/definitions/FieldName", + "description": "The data field to pivot on. The unique values of this field become new field names in the output stream." + }, + "value": { + "$ref": "#/definitions/FieldName", + "description": "The data field to populate pivoted fields. The aggregate values of this field become the values of the new pivoted fields." + } + }, + "required": [ + "pivot", + "value" + ], + "type": "object" + }, + "PointSelectionConfig": { + "additionalProperties": false, + "properties": { + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. This property can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable clear.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear` examples ](https://vega.github.io/vega-lite/docs/selection.html#clear) in the documentation." + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "nearest": { + "description": "When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__Default value:__ `false`, which means that data values must be interacted with directly (e.g., clicked on) to be added to the selection.\n\n__See also:__ [`nearest` examples](https://vega.github.io/vega-lite/docs/selection.html#nearest) documentation.", + "type": "boolean" + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + } + ], + "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection. For interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters).\n\n__See also:__ [`on` examples](https://vega.github.io/vega-lite/docs/selection.html#on) in the documentation." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain.\n\nOne of:\n- `\"global\"` -- only one brush exists for the entire SPLOM. When the user begins to drag, any previous brushes are cleared, and a new one is constructed.\n- `\"union\"` -- each cell contains its own brush, and points are highlighted if they lie within _any_ of these individual brushes.\n- `\"intersect\"` -- each cell contains its own brush, and points are highlighted only if they fall within _all_ of these individual brushes.\n\n__Default value:__ `global`.\n\n__See also:__ [`resolve` examples](https://vega.github.io/vega-lite/docs/selection.html#resolve) in the documentation." + }, + "toggle": { + "description": "Controls whether data values should be toggled (inserted or removed from a point selection) or only ever inserted into multi selections.\n\nOne of:\n- `true` -- the default behavior, which corresponds to `\"event.shiftKey\"`. As a result, data values are toggled when the user interacts with the shift-key pressed.\n- `false` -- disables toggling behaviour; as the user interacts, data values are only inserted into the multi selection and never removed.\n- A [Vega expression](https://vega.github.io/vega/docs/expressions/) which is re-evaluated as the user interacts. If the expression evaluates to `true`, the data value is toggled into or out of the multi selection. If the expression evaluates to `false`, the multi selection is first clear, and the data value is then inserted. For example, setting the value to the Vega expression `\"true\"` will toggle data values without the user pressing the shift-key.\n\n__Default value:__ `true`\n\n__See also:__ [`toggle` examples](https://vega.github.io/vega-lite/docs/selection.html#toggle) in the documentation.", + "type": [ + "string", + "boolean" + ] + }, + "type": { + "const": "point", + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types:\n\n- `\"point\"` -- to select multiple discrete data values; the first value is selected on `click` and additional values toggled on shift-click.\n- `\"interval\"` -- to select a continuous range of data values on `drag`.", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "PointSelectionConfigWithoutType": { + "additionalProperties": false, + "properties": { + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. This property can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable clear.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear` examples ](https://vega.github.io/vega-lite/docs/selection.html#clear) in the documentation." + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "nearest": { + "description": "When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__Default value:__ `false`, which means that data values must be interacted with directly (e.g., clicked on) to be added to the selection.\n\n__See also:__ [`nearest` examples](https://vega.github.io/vega-lite/docs/selection.html#nearest) documentation.", + "type": "boolean" + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + } + ], + "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection. For interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters).\n\n__See also:__ [`on` examples](https://vega.github.io/vega-lite/docs/selection.html#on) in the documentation." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain.\n\nOne of:\n- `\"global\"` -- only one brush exists for the entire SPLOM. When the user begins to drag, any previous brushes are cleared, and a new one is constructed.\n- `\"union\"` -- each cell contains its own brush, and points are highlighted if they lie within _any_ of these individual brushes.\n- `\"intersect\"` -- each cell contains its own brush, and points are highlighted only if they fall within _all_ of these individual brushes.\n\n__Default value:__ `global`.\n\n__See also:__ [`resolve` examples](https://vega.github.io/vega-lite/docs/selection.html#resolve) in the documentation." + }, + "toggle": { + "description": "Controls whether data values should be toggled (inserted or removed from a point selection) or only ever inserted into multi selections.\n\nOne of:\n- `true` -- the default behavior, which corresponds to `\"event.shiftKey\"`. As a result, data values are toggled when the user interacts with the shift-key pressed.\n- `false` -- disables toggling behaviour; as the user interacts, data values are only inserted into the multi selection and never removed.\n- A [Vega expression](https://vega.github.io/vega/docs/expressions/) which is re-evaluated as the user interacts. If the expression evaluates to `true`, the data value is toggled into or out of the multi selection. If the expression evaluates to `false`, the multi selection is first clear, and the data value is then inserted. For example, setting the value to the Vega expression `\"true\"` will toggle data values without the user pressing the shift-key.\n\n__Default value:__ `true`\n\n__See also:__ [`toggle` examples](https://vega.github.io/vega-lite/docs/selection.html#toggle) in the documentation.", + "type": [ + "string", + "boolean" + ] + } + }, + "type": "object" + }, + "PolarDef": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDefBase" + }, + { + "$ref": "#/definitions/PositionDatumDefBase" + }, + { + "$ref": "#/definitions/PositionValueDef" + } + ] + }, + "Position2Def": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/DatumDef" + }, + { + "$ref": "#/definitions/PositionValueDef" + } + ] + }, + "PositionDatumDef": { + "additionalProperties": false, + "properties": { + "axis": { + "anyOf": [ + { + "$ref": "#/definitions/Axis" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.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" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "impute": { + "anyOf": [ + { + "$ref": "#/definitions/ImputeParams" + }, + { + "type": "null" + } + ], + "description": "An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as `key` of the `Impute` Operation. The field of the `color` channel if specified is used as `groupby` of the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." + }, + "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." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.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/Type", + "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" + }, + "PositionDatumDefBase": { + "additionalProperties": false, + "properties": { + "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" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.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/Type", + "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" + }, + "PositionDef": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/PositionDatumDef" + }, + { + "$ref": "#/definitions/PositionValueDef" + } + ] + }, + "PositionFieldDef": { + "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." + }, + "axis": { + "anyOf": [ + { + "$ref": "#/definitions/Axis" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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`." + }, + "impute": { + "anyOf": [ + { + "$ref": "#/definitions/ImputeParams" + }, + { + "type": "null" + } + ], + "description": "An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as `key` of the `Impute` Operation. The field of the `color` channel if specified is used as `groupby` of the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." + }, + "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." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "PositionFieldDefBase": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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`." + }, + "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." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "PositionValueDef": { + "$ref": "#/definitions/ValueDef<(number|\"width\"|\"height\"|ExprRef)>" + }, + "Predicate": { + "anyOf": [ + { + "$ref": "#/definitions/FieldEqualPredicate" + }, + { + "$ref": "#/definitions/FieldRangePredicate" + }, + { + "$ref": "#/definitions/FieldOneOfPredicate" + }, + { + "$ref": "#/definitions/FieldLTPredicate" + }, + { + "$ref": "#/definitions/FieldGTPredicate" + }, + { + "$ref": "#/definitions/FieldLTEPredicate" + }, + { + "$ref": "#/definitions/FieldGTEPredicate" + }, + { + "$ref": "#/definitions/FieldValidPredicate" + }, + { + "$ref": "#/definitions/ParameterPredicate" + }, + { + "type": "string" + } + ] + }, + "PrimitiveValue": { + "type": [ + "number", + "string", + "boolean", + "null" + ] + }, + "Projection": { + "additionalProperties": false, + "properties": { + "center": { + "anyOf": [ + { + "$ref": "#/definitions/Vector2", + "description": "The projection's center, a two-element array of longitude and latitude in degrees.\n\n__Default value:__ `[0, 0]`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "clipAngle": { + "anyOf": [ + { + "description": "The projection's clipping circle radius to the specified angle in degrees. If `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather than small-circle clipping.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "clipExtent": { + "anyOf": [ + { + "$ref": "#/definitions/Vector2>", + "description": "The projection's viewport clip extent to the specified bounds in pixels. The extent bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no viewport clipping is performed." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "coefficient": { + "anyOf": [ + { + "description": "The coefficient parameter for the `hammer` projection.\n\n__Default value:__ `2`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "distance": { + "anyOf": [ + { + "description": "For the `satellite` projection, the distance from the center of the sphere to the point of view, as a proportion of the sphere’s radius. The recommended maximum clip angle for a given `distance` is acos(1 / distance) converted to degrees. If tilt is also applied, then more conservative clipping may be necessary.\n\n__Default value:__ `2.0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "extent": { + "anyOf": [ + { + "$ref": "#/definitions/Vector2>" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fit": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/GeoJsonFeature" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/Fit" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fraction": { + "anyOf": [ + { + "description": "The fraction parameter for the `bottomley` projection.\n\n__Default value:__ `0.5`, corresponding to a sin(ψ) where ψ = π/6.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lobes": { + "anyOf": [ + { + "description": "The number of lobes in projections that support multi-lobe views: `berghaus`, `gingery`, or `healpix`. The default value varies based on the projection type.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "parallel": { + "anyOf": [ + { + "description": "The parallel parameter for projections that support it: `armadillo`, `bonne`, `craig`, `cylindricalEqualArea`, `cylindricalStereographic`, `hammerRetroazimuthal`, `loximuthal`, or `rectangularPolyconic`. The default value varies based on the projection type.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "parallels": { + "anyOf": [ + { + "description": "For conic projections, the [two standard parallels](https://en.wikipedia.org/wiki/Map_projection#Conic) that define the map layout. The default depends on the specific conic projection used.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "pointRadius": { + "anyOf": [ + { + "description": "The default radius (in pixels) to use when drawing GeoJSON `Point` and `MultiPoint` geometries. This parameter sets a constant default value. To modify the point radius in response to data, see the corresponding parameter of the GeoPath and GeoShape transforms.\n\n__Default value:__ `4.5`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "precision": { + "anyOf": [ + { + "description": "The threshold for the projection's [adaptive resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This value corresponds to the [Douglas–Peucker distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm). If precision is not specified, returns the projection's current resampling precision which defaults to `√0.5 ≅ 0.70710…`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "description": "The radius parameter for the `airy` or `gingery` projection. The default value varies based on the projection type.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ratio": { + "anyOf": [ + { + "description": "The ratio parameter for the `hill`, `hufnagel`, or `wagner` projections. The default value varies based on the projection type.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "reflectX": { + "anyOf": [ + { + "description": "Sets whether or not the x-dimension is reflected (negated) in the output.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "reflectY": { + "anyOf": [ + { + "description": "Sets whether or not the y-dimension is reflected (negated) in the output.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "rotate": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/Vector2" + }, + { + "$ref": "#/definitions/Vector3" + } + ], + "description": "The projection's three-axis rotation to the specified angles, which must be a two- or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)\n\n__Default value:__ `[0, 0, 0]`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "scale": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The projection’s scale (zoom) factor, overriding automatic fitting. The default scale is projection-specific. The scale factor corresponds linearly to the distance between projected points; however, scale factor values are not equivalent across projections." + }, + "size": { + "anyOf": [ + { + "$ref": "#/definitions/Vector2", + "description": "Used in conjunction with fit, provides the width and height in pixels of the area to which the projection should be automatically fit." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "spacing": { + "anyOf": [ + { + "description": "The spacing parameter for the `lagrange` projection.\n\n__Default value:__ `0.5`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tilt": { + "anyOf": [ + { + "description": "The tilt angle (in degrees) for the `satellite` projection.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "translate": { + "anyOf": [ + { + "$ref": "#/definitions/Vector2" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The projection’s translation offset as a two-element array `[tx, ty]`." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/ProjectionType" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The cartographic projection to use. This value is case-insensitive, for example `\"albers\"` and `\"Albers\"` indicate the same projection type. You can find all valid projection types [in the documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `equalEarth`" + } + }, + "type": "object" + }, + "ProjectionConfig": { + "$ref": "#/definitions/Projection", + "description": "Any property of Projection can be in config" + }, + "ProjectionType": { + "enum": [ + "albers", + "albersUsa", + "azimuthalEqualArea", + "azimuthalEquidistant", + "conicConformal", + "conicEqualArea", + "conicEquidistant", + "equalEarth", + "equirectangular", + "gnomonic", + "identity", + "mercator", + "naturalEarth1", + "orthographic", + "stereographic", + "transverseMercator" + ], + "type": "string" + }, + "QuantileTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for the probability and quantile values.\n\n__Default value:__ `[\"prob\", \"value\"]`", + "items": { + "$ref": "#/definitions/FieldName" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "probs": { + "description": "An array of probabilities in the range (0, 1) for which to compute quantile values. If not specified, the *step* parameter will be used.", + "items": { + "type": "number" + }, + "type": "array" + }, + "quantile": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which to perform quantile estimation." + }, + "step": { + "description": "A probability step size (default 0.01) for sampling quantile values. All values from one-half the step size up to 1 (exclusive) will be sampled. This parameter is only used if the *probs* parameter is not provided.", + "type": "number" + } + }, + "required": [ + "quantile" + ], + "type": "object" + }, + "RadialGradient": { + "additionalProperties": false, + "properties": { + "gradient": { + "const": "radial", + "description": "The type of gradient. Use `\"radial\"` for a radial gradient.", + "type": "string" + }, + "id": { + "type": "string" + }, + "r1": { + "description": "The radius length, in normalized [0, 1] coordinates, of the inner circle for the gradient.\n\n__Default value:__ `0`", + "type": "number" + }, + "r2": { + "description": "The radius length, in normalized [0, 1] coordinates, of the outer circle for the gradient.\n\n__Default value:__ `0.5`", + "type": "number" + }, + "stops": { + "description": "An array of gradient stops defining the gradient color sequence.", + "items": { + "$ref": "#/definitions/GradientStop" + }, + "type": "array" + }, + "x1": { + "description": "The x-coordinate, in normalized [0, 1] coordinates, for the center of the inner circle for the gradient.\n\n__Default value:__ `0.5`", + "type": "number" + }, + "x2": { + "description": "The x-coordinate, in normalized [0, 1] coordinates, for the center of the outer circle for the gradient.\n\n__Default value:__ `0.5`", + "type": "number" + }, + "y1": { + "description": "The y-coordinate, in normalized [0, 1] coordinates, for the center of the inner circle for the gradient.\n\n__Default value:__ `0.5`", + "type": "number" + }, + "y2": { + "description": "The y-coordinate, in normalized [0, 1] coordinates, for the center of the outer circle for the gradient.\n\n__Default value:__ `0.5`", + "type": "number" + } + }, + "required": [ + "gradient", + "stops" + ], + "type": "object" + }, + "RangeConfig": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "type": "array" + } + ] + }, + "properties": { + "category": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "items": { + "$ref": "#/definitions/Color" + }, + "type": "array" + } + ], + "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for categorical data." + }, + "diverging": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "items": { + "$ref": "#/definitions/Color" + }, + "type": "array" + } + ], + "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for diverging quantitative ramps." + }, + "heatmap": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "items": { + "$ref": "#/definitions/Color" + }, + "type": "array" + } + ], + "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for quantitative heatmaps." + }, + "ordinal": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "items": { + "$ref": "#/definitions/Color" + }, + "type": "array" + } + ], + "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for rank-ordered data." + }, + "ramp": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "items": { + "$ref": "#/definitions/Color" + }, + "type": "array" + } + ], + "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for sequential quantitative ramps." + }, + "symbol": { + "description": "Array of [symbol](https://vega.github.io/vega/docs/marks/symbol/) names or paths for the default shape palette.", + "items": { + "$ref": "#/definitions/SymbolShape" + }, + "type": "array" + } + }, + "type": "object" + }, + "RangeEnum": { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ], + "type": "string" + }, + "RangeRaw": { + "items": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/RangeRawArray" + } + ] + }, + "type": "array" + }, + "RangeRawArray": { + "items": { + "type": "number" + }, + "type": "array" + }, + "RangeScheme": { + "anyOf": [ + { + "$ref": "#/definitions/RangeEnum" + }, + { + "$ref": "#/definitions/RangeRaw" + }, + { + "additionalProperties": false, + "properties": { + "count": { + "type": "number" + }, + "extent": { + "items": { + "type": "number" + }, + "type": "array" + }, + "scheme": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ColorScheme" + } + ] + } + }, + "required": [ + "scheme" + ], + "type": "object" + } + ] + }, + "RectConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "binSpacing": { + "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "continuousBandSize": { + "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "discreteBandSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RelativeBandSize" + } + ], + "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.", + "minimum": 0 + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." + }, + "outerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", + "minimum": 0 + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "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" + }, + "timeUnitBandSize": { + "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "RegressionTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for the smoothed points generated by the regression transform.\n\n__Default value:__ The field names of the input x and y values.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "extent": { + "description": "A [min, max] domain over the independent (x) field for the starting and ending points of the generated trend line.", + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "method": { + "description": "The functional form of the regression model. One of `\"linear\"`, `\"log\"`, `\"exp\"`, `\"pow\"`, `\"quad\"`, or `\"poly\"`.\n\n__Default value:__ `\"linear\"`", + "enum": [ + "linear", + "log", + "exp", + "pow", + "quad", + "poly" + ], + "type": "string" + }, + "on": { + "$ref": "#/definitions/FieldName", + "description": "The data field of the independent variable to use a predictor." + }, + "order": { + "description": "The polynomial order (number of coefficients) for the 'poly' method.\n\n__Default value:__ `3`", + "type": "number" + }, + "params": { + "description": "A boolean flag indicating if the transform should return the regression model parameters (one object per group), rather than trend line points. The resulting objects include a `coef` array of fitted coefficient values (starting with the intercept term and then including terms of increasing order) and an `rSquared` value (indicating the total variance explained by the model).\n\n__Default value:__ `false`", + "type": "boolean" + }, + "regression": { + "$ref": "#/definitions/FieldName", + "description": "The data field of the dependent variable to predict." + } + }, + "required": [ + "regression", + "on" + ], + "type": "object" + }, + "RelativeBandSize": { + "additionalProperties": false, + "properties": { + "band": { + "description": "The relative band size. For example `0.5` means half of the band scale's band width.", + "type": "number" + } + }, + "required": [ + "band" + ], + "type": "object" + }, + "RepeatMapping": { + "additionalProperties": false, + "properties": { + "column": { + "description": "An array of fields to be repeated horizontally.", + "items": { + "type": "string" + }, + "type": "array" + }, + "row": { + "description": "An array of fields to be repeated vertically.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "RepeatRef": { + "additionalProperties": false, + "description": "Reference to a repeated value.", + "properties": { + "repeat": { + "enum": [ + "row", + "column", + "repeat", + "layer" + ], + "type": "string" + } + }, + "required": [ + "repeat" + ], + "type": "object" + }, + "RepeatSpec": { + "anyOf": [ + { + "$ref": "#/definitions/NonLayerRepeatSpec" + }, + { + "$ref": "#/definitions/LayerRepeatSpec" + } + ] + }, + "Resolve": { + "additionalProperties": false, + "description": "Defines how scales, axes, and legends from different specs should be combined. Resolve is a mapping from `scale`, `axis`, and `legend` to a mapping from channels to resolutions. Scales and guides can be resolved to be `\"independent\"` or `\"shared\"`.", + "properties": { + "axis": { + "$ref": "#/definitions/AxisResolveMap" + }, + "legend": { + "$ref": "#/definitions/LegendResolveMap" + }, + "scale": { + "$ref": "#/definitions/ScaleResolveMap" + } + }, + "type": "object" + }, + "ResolveMode": { + "enum": [ + "independent", + "shared" + ], + "type": "string" + }, + "RowCol": { + "additionalProperties": false, + "properties": { + "column": { + "$ref": "#/definitions/LayoutAlign" + }, + "row": { + "$ref": "#/definitions/LayoutAlign" + } + }, + "type": "object" + }, + "RowCol": { + "additionalProperties": false, + "properties": { + "column": { + "type": "boolean" + }, + "row": { + "type": "boolean" + } + }, + "type": "object" + }, + "RowCol": { + "additionalProperties": false, + "properties": { + "column": { + "type": "number" + }, + "row": { + "type": "number" + } + }, + "type": "object" + }, + "RowColumnEncodingFieldDef": { + "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." + }, + "align": { + "$ref": "#/definitions/LayoutAlign", + "description": "The alignment to apply to row/column facet's subplot. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "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#params), 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) 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." + }, + "center": { + "description": "Boolean flag indicating if facet's subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "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`." + }, + "header": { + "anyOf": [ + { + "$ref": "#/definitions/Header" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of a facet's header." + }, + "sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "type": "null" + } + ], + "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 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` is not supported for `row` and `column`." + }, + "spacing": { + "description": "The spacing in pixels between facet's sub-views.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)", + "type": "number" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "SampleTransform": { + "additionalProperties": false, + "properties": { + "sample": { + "description": "The maximum number of data objects to include in the sample.\n\n__Default value:__ `1000`", + "type": "number" + } + }, + "required": [ + "sample" + ], + "type": "object" + }, + "Scale": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The alignment of the steps within the scale range.\n\nThis value must lie in the range `[0,1]`. A value of `0.5` indicates that the steps should be centered within the range. A value of `0` or `1` may be used to shift the bands to one side, say to position them adjacent to an axis.\n\n__Default value:__ `0.5`" + }, + "base": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The logarithm base of the `log` scale (default `10`)." + }, + "bins": { + "$ref": "#/definitions/ScaleBins", + "description": "Bin boundaries can be provided to scales as either an explicit array of bin boundaries or as a bin specification object. The legal values are:\n- An [array](../types/#Array) literal of bin boundary values. For example, `[0, 5, 10, 15, 20]`. The array must include both starting and ending boundaries. The previous example uses five values to indicate a total of four bin intervals: [0-5), [5-10), [10-15), [15-20]. Array literals may include signal references as elements.\n- A [bin specification object](https://vega.github.io/vega-lite/docs/scale.html#bins) that indicates the bin _step_ size, and optionally the _start_ and _stop_ boundaries.\n- An array of bin boundaries over the scale domain. If provided, axes and legends will use the bin boundaries to inform the choice of tick marks and text labels." + }, + "clamp": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If `true`, values that exceed the data domain are clamped to either the minimum or maximum range value\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/config.html#scale-config)'s `clamp` (`true` by default)." + }, + "constant": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant determining the slope of the symlog function around zero. Only used for `symlog` scales.\n\n__Default value:__ `1`" + }, + "domain": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "type": "array" + }, + { + "const": "unaggregated", + "type": "string" + }, + { + "$ref": "#/definitions/ParameterExtent" + }, + { + "$ref": "#/definitions/DomainUnionWith" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Customized domain values in the form of constant values or dynamic values driven by a parameter.\n\n1) Constant `domain` for _quantitative_ fields can take one of the following forms:\n\n- A two-element array with minimum and maximum values. To create a diverging scale, this two-element array can be combined with the `domainMid` property.\n- An array with more than two entries, for [Piecewise quantitative scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise).\n- A string value `\"unaggregated\"`, if the input field is aggregated, to indicate that the domain should include the raw data values prior to the aggregation.\n\n2) Constant `domain` for _temporal_ fields can be a two-element array with minimum and maximum values, in the form of either timestamps or the [DateTime definition objects](https://vega.github.io/vega-lite/docs/types.html#datetime).\n\n3) Constant `domain` for _ordinal_ and _nominal_ fields can be an array that lists valid input values.\n\n4) To combine (union) specified constant domain with the field's values, `domain` can be an object with a `unionWith` property that specify constant domain to be combined. For example, `domain: {unionWith: [0, 100]}` for a quantitative scale means that the scale domain always includes `[0, 100]`, but will include other values in the fields beyond `[0, 100]`.\n\n5) Domain can also takes an object defining a field or encoding of a parameter that [interactively determines](https://vega.github.io/vega-lite/docs/selection.html#scale-domains) the scale domain." + }, + "domainMax": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Sets the maximum value in the scale domain, overriding the `domain` property. This property is only intended for use with scales having continuous domains." + }, + "domainMid": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Inserts a single mid-point value into a two-element domain. The mid-point value must lie between the domain minimum and maximum values. This property can be useful for setting a midpoint for [diverging color scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise). The domainMid property is only intended for use with scales supporting continuous, piecewise domains." + }, + "domainMin": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Sets the minimum value in the scale domain, overriding the domain property. This property is only intended for use with scales having continuous domains." + }, + "exponent": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The exponent of the `pow` scale." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInterpolateEnum" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ScaleInterpolateParams" + } + ], + "description": "The interpolation method for range values. By default, a general interpolator for numbers, dates, strings and colors (in HCL space) is used. For color ranges, this property allows interpolation in alternative color spaces. Legal values include `rgb`, `hsl`, `hsl-long`, `lab`, `hcl`, `hcl-long`, `cubehelix` and `cubehelix-long` ('-long' variants use longer paths in polar coordinate spaces). If object-valued, this property accepts an object with a string-valued _type_ property and an optional numeric _gamma_ property applicable to rgb and cubehelix interpolators. For more, see the [d3-interpolate documentation](https://github.com/d3/d3-interpolate).\n\n* __Default value:__ `hcl`" + }, + "nice": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/TimeInterval" + }, + { + "$ref": "#/definitions/TimeIntervalStep" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Extending the domain so that it starts and ends on nice round values. This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. Nicing is useful if the domain is computed from data and may be irregular. For example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2, 1.0]_.\n\nFor quantitative scales such as linear, `nice` can be either a boolean flag or a number. If `nice` is a number, it will represent a desired tick count. This allows greater control over the step size used to extend the bounds, guaranteeing that the returned ticks will exactly cover the domain.\n\nFor temporal fields with time and utc scales, the `nice` value can be a string indicating the desired time interval. Legal values are `\"millisecond\"`, `\"second\"`, `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, `time` and `utc` scales can accept an object-valued interval specifier of the form `{\"interval\": \"month\", \"step\": 3}`, which includes a desired number of interval steps. Here, the domain would snap to quarter (Jan, Apr, Jul, Oct) boundaries.\n\n__Default value:__ `true` for unbinned _quantitative_ fields without explicit domain bounds; `false` otherwise." + }, + "padding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For _[continuous](https://vega.github.io/vega-lite/docs/scale.html#continuous)_ scales, expands the scale domain to accommodate the specified number of pixels on each of the scale range. The scale range must represent pixels for this parameter to function as intended. Padding adjustment is performed prior to all other adjustments, including the effects of the `zero`, `nice`, `domainMin`, and `domainMax` properties.\n\nFor _[band](https://vega.github.io/vega-lite/docs/scale.html#band)_ scales, shortcut for setting `paddingInner` and `paddingOuter` to the same value.\n\nFor _[point](https://vega.github.io/vega-lite/docs/scale.html#point)_ scales, alias for `paddingOuter`.\n\n__Default value:__ For _continuous_ scales, derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `continuousPadding`. For _band and point_ scales, see `paddingInner` and `paddingOuter`. By default, Vega-Lite sets padding such that _width/height = number of unique values * step_.", + "minimum": 0 + }, + "paddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner padding (spacing) within each band step of band scales, as a fraction of the step size. This value must lie in the range [0,1].\n\nFor point scale, this property is invalid as point scales do not have internal band widths (only step sizes between bands).\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingInner`.", + "maximum": 1, + "minimum": 0 + }, + "paddingOuter": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer padding (spacing) at the ends of the range of band and point scales, as a fraction of the step size. This value must lie in the range [0,1].\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingOuter` for band scales and `pointPadding` for point scales. By default, Vega-Lite sets outer padding such that _width/height = number of unique values * step_.", + "maximum": 1, + "minimum": 0 + }, + "range": { + "anyOf": [ + { + "$ref": "#/definitions/RangeEnum" + }, + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/definitions/FieldRange" + } + ], + "description": "The range of the scale. One of:\n\n- A string indicating a [pre-defined named scale range](https://vega.github.io/vega-lite/docs/scale.html#range-config) (e.g., example, `\"symbol\"`, or `\"diverging\"`).\n\n- For [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous), two-element array indicating minimum and maximum values, or an array with more than two entries for specifying a [piecewise scale](https://vega.github.io/vega-lite/docs/scale.html#piecewise).\n\n- For [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) and [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales, an array of desired output values or an object with a `field` property representing the range values. For example, if a field `color` contains CSS color names, we can set `range` to `{field: \"color\"}`.\n\n__Notes:__\n\n1) For color scales you can also specify a color [`scheme`](https://vega.github.io/vega-lite/docs/scale.html#scheme) instead of `range`.\n\n2) Any directly specified `range` for `x` and `y` channels will be ignored. Range can be customized via the view's corresponding [size](https://vega.github.io/vega-lite/docs/size.html) (`width` and `height`)." + }, + "rangeMax": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Sets the maximum value in the scale range, overriding the `range` property or the default range. This property is only intended for use with scales having continuous ranges." + }, + "rangeMin": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Sets the minimum value in the scale range, overriding the `range` property or the default range. This property is only intended for use with scales having continuous ranges." + }, + "reverse": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If true, reverses the order of the scale range. __Default value:__ `false`." + }, + "round": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If `true`, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid.\n\n__Default value:__ `false`." + }, + "scheme": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/SchemeParams" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A string indicating a color [scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme) name (e.g., `\"category10\"` or `\"blues\"`) or a [scheme parameter object](https://vega.github.io/vega-lite/docs/scale.html#scheme-params).\n\nDiscrete color schemes may be used with [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales. Continuous color schemes are intended for use with color scales.\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference." + }, + "type": { + "$ref": "#/definitions/ScaleType", + "description": "The type of scale. Vega-Lite supports the following categories of scale types:\n\n1) [**Continuous Scales**](https://vega.github.io/vega-lite/docs/scale.html#continuous) -- mapping continuous domains to continuous output ranges ([`\"linear\"`](https://vega.github.io/vega-lite/docs/scale.html#linear), [`\"pow\"`](https://vega.github.io/vega-lite/docs/scale.html#pow), [`\"sqrt\"`](https://vega.github.io/vega-lite/docs/scale.html#sqrt), [`\"symlog\"`](https://vega.github.io/vega-lite/docs/scale.html#symlog), [`\"log\"`](https://vega.github.io/vega-lite/docs/scale.html#log), [`\"time\"`](https://vega.github.io/vega-lite/docs/scale.html#time), [`\"utc\"`](https://vega.github.io/vega-lite/docs/scale.html#utc).\n\n2) [**Discrete Scales**](https://vega.github.io/vega-lite/docs/scale.html#discrete) -- mapping discrete domains to discrete ([`\"ordinal\"`](https://vega.github.io/vega-lite/docs/scale.html#ordinal)) or continuous ([`\"band\"`](https://vega.github.io/vega-lite/docs/scale.html#band) and [`\"point\"`](https://vega.github.io/vega-lite/docs/scale.html#point)) output ranges.\n\n3) [**Discretizing Scales**](https://vega.github.io/vega-lite/docs/scale.html#discretizing) -- mapping continuous domains to discrete output ranges [`\"bin-ordinal\"`](https://vega.github.io/vega-lite/docs/scale.html#bin-ordinal), [`\"quantile\"`](https://vega.github.io/vega-lite/docs/scale.html#quantile), [`\"quantize\"`](https://vega.github.io/vega-lite/docs/scale.html#quantize) and [`\"threshold\"`](https://vega.github.io/vega-lite/docs/scale.html#threshold).\n\n__Default value:__ please see the [scale type table](https://vega.github.io/vega-lite/docs/scale.html#type)." + }, + "zero": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If `true`, ensures that a zero baseline value is included in the scale domain.\n\n__Default value:__ `true` for x and y channels if the quantitative field is not binned and no custom `domain` is provided; `false` otherwise.\n\n__Note:__ Log, time, and utc scales do not support `zero`." + } + }, + "type": "object" + }, + "ScaleBinParams": { + "additionalProperties": false, + "properties": { + "start": { + "description": "The starting (lowest-valued) bin boundary.\n\n__Default value:__ The lowest value of the scale domain will be used.", + "type": "number" + }, + "step": { + "description": "The step size defining the bin interval width.", + "type": "number" + }, + "stop": { + "description": "The stopping (highest-valued) bin boundary.\n\n__Default value:__ The highest value of the scale domain will be used.", + "type": "number" + } + }, + "required": [ + "step" + ], + "type": "object" + }, + "ScaleBins": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ScaleBinParams" + } + ] + }, + "ScaleConfig": { + "additionalProperties": false, + "properties": { + "bandPaddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default inner padding for `x` and `y` band scales.\n\n__Default value:__\n- `nestedOffsetPaddingInner` for x/y scales with nested x/y offset scales.\n- `barBandPaddingInner` for bar marks (`0.1` by default)\n- `rectBandPaddingInner` for rect and other marks (`0` by default)", + "maximum": 1, + "minimum": 0 + }, + "bandPaddingOuter": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default outer padding for `x` and `y` band scales.\n\n__Default value:__ `paddingInner/2` (which makes _width/height = number of unique values * step_)", + "maximum": 1, + "minimum": 0 + }, + "bandWithNestedOffsetPaddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default inner padding for `x` and `y` band scales with nested `xOffset` and `yOffset` encoding.\n\n__Default value:__ `0.2`", + "maximum": 1, + "minimum": 0 + }, + "bandWithNestedOffsetPaddingOuter": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default outer padding for `x` and `y` band scales with nested `xOffset` and `yOffset` encoding.\n\n__Default value:__ `0.2`", + "maximum": 1, + "minimum": 0 + }, + "barBandPaddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"bar\"` marks.\n\n__Default value:__ `0.1`", + "maximum": 1, + "minimum": 0 + }, + "clamp": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If true, values that exceed the data domain are clamped to either the minimum or maximum range value" + }, + "continuousPadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "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 + }, + "maxBandSize": { + "description": "The default max value for mapping quantitative fields to bar's size/bandSize.\n\nIf undefined (default), we will use the axis's size (width or height) - 1.", + "minimum": 0, + "type": "number" + }, + "maxFontSize": { + "description": "The default max value for mapping quantitative fields to text's size/fontSize.\n\n__Default value:__ `40`", + "minimum": 0, + "type": "number" + }, + "maxOpacity": { + "description": "Default max opacity for mapping a field to opacity.\n\n__Default value:__ `0.8`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "maxSize": { + "description": "Default max value for point size scale.", + "minimum": 0, + "type": "number" + }, + "maxStrokeWidth": { + "description": "Default max strokeWidth for the scale of strokeWidth for rule and line marks and of size for trail marks.\n\n__Default value:__ `4`", + "minimum": 0, + "type": "number" + }, + "minBandSize": { + "description": "The default min value for mapping quantitative fields to bar and tick's size/bandSize scale with zero=false.\n\n__Default value:__ `2`", + "minimum": 0, + "type": "number" + }, + "minFontSize": { + "description": "The default min value for mapping quantitative fields to tick's size/fontSize scale with zero=false\n\n__Default value:__ `8`", + "minimum": 0, + "type": "number" + }, + "minOpacity": { + "description": "Default minimum opacity for mapping a field to opacity.\n\n__Default value:__ `0.3`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "minSize": { + "description": "Default minimum value for point size scale with zero=false.\n\n__Default value:__ `9`", + "minimum": 0, + "type": "number" + }, + "minStrokeWidth": { + "description": "Default minimum strokeWidth for the scale of strokeWidth for rule and line marks and of size for trail marks with zero=false.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "offsetBandPaddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default padding inner for xOffset/yOffset's band scales.\n\n__Default Value:__ `0`" + }, + "offsetBandPaddingOuter": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default padding outer for xOffset/yOffset's band scales.\n\n__Default Value:__ `0`" + }, + "pointPadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default outer padding for `x` and `y` point-ordinal scales.\n\n__Default value:__ `0.5` (which makes _width/height = number of unique values * step_)", + "maximum": 1, + "minimum": 0 + }, + "quantileCount": { + "description": "Default range cardinality for [`quantile`](https://vega.github.io/vega-lite/docs/scale.html#quantile) scale.\n\n__Default value:__ `4`", + "minimum": 0, + "type": "number" + }, + "quantizeCount": { + "description": "Default range cardinality for [`quantize`](https://vega.github.io/vega-lite/docs/scale.html#quantize) scale.\n\n__Default value:__ `4`", + "minimum": 0, + "type": "number" + }, + "rectBandPaddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"rect\"` marks.\n\n__Default value:__ `0`", + "maximum": 1, + "minimum": 0 + }, + "round": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If true, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid. (Only available for `x`, `y`, and `size` scales.)" + }, + "useUnaggregatedDomain": { + "description": "Use the source data range before aggregation as scale domain instead of aggregated data for aggregate axis.\n\nThis is equivalent to setting `domain` to `\"unaggregate\"` for aggregated _quantitative_ fields by default.\n\nThis property only works with aggregate functions that produce values within the raw data domain (`\"mean\"`, `\"average\"`, `\"median\"`, `\"q1\"`, `\"q3\"`, `\"min\"`, `\"max\"`). For other aggregations that produce values outside of the raw data domain (e.g. `\"count\"`, `\"sum\"`), this property is ignored.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "xReverse": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Reverse x-scale by default (useful for right-to-left charts)." + } + }, + "type": "object" + }, + "ScaleDatumDef": { + "additionalProperties": false, + "properties": { + "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" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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." + }, + "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/Type", + "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" + }, + "ScaleFieldDef": { + "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#params), 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) 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`." + }, + "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/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" + }, + "ScaleInterpolateEnum": { + "enum": [ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long" + ], + "type": "string" + }, + "ScaleInterpolateParams": { + "additionalProperties": false, + "properties": { + "gamma": { + "type": "number" + }, + "type": { + "enum": [ + "rgb", + "cubehelix", + "cubehelix-long" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ScaleResolveMap": { + "additionalProperties": false, + "properties": { + "angle": { + "$ref": "#/definitions/ResolveMode" + }, + "color": { + "$ref": "#/definitions/ResolveMode" + }, + "fill": { + "$ref": "#/definitions/ResolveMode" + }, + "fillOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "opacity": { + "$ref": "#/definitions/ResolveMode" + }, + "radius": { + "$ref": "#/definitions/ResolveMode" + }, + "shape": { + "$ref": "#/definitions/ResolveMode" + }, + "size": { + "$ref": "#/definitions/ResolveMode" + }, + "stroke": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeDash": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeWidth": { + "$ref": "#/definitions/ResolveMode" + }, + "theta": { + "$ref": "#/definitions/ResolveMode" + }, + "x": { + "$ref": "#/definitions/ResolveMode" + }, + "xOffset": { + "$ref": "#/definitions/ResolveMode" + }, + "y": { + "$ref": "#/definitions/ResolveMode" + }, + "yOffset": { + "$ref": "#/definitions/ResolveMode" + } + }, + "type": "object" + }, + "ScaleType": { + "enum": [ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band" + ], + "type": "string" + }, + "SchemeParams": { + "additionalProperties": false, + "properties": { + "count": { + "description": "The number of colors to use in the scheme. This can be useful for scale types such as `\"quantize\"`, which use the length of the scale range to determine the number of discrete bins for the scale domain.", + "type": "number" + }, + "extent": { + "description": "The extent of the color range to use. For example `[0.2, 1]` will rescale the color scheme such that color values in the range _[0, 0.2)_ are excluded from the scheme.", + "items": { + "type": "number" + }, + "type": "array" + }, + "name": { + "description": "A color scheme name for ordinal scales (e.g., `\"category10\"` or `\"blues\"`).\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "SecondaryFieldDef": { + "additionalProperties": false, + "description": "A field definition of a secondary channel that shares a scale with another primary channel. For example, `x2`, `xError` and `xError2` share the same scale with `x`.", + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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": "object" + }, + "SelectionConfig": { + "additionalProperties": false, + "properties": { + "interval": { + "$ref": "#/definitions/IntervalSelectionConfigWithoutType", + "description": "The default definition for an [`interval`](https://vega.github.io/vega-lite/docs/parameter.html#select) selection. All properties and transformations for an interval selection definition (except `type`) may be specified here.\n\nFor instance, setting `interval` to `{\"translate\": false}` disables the ability to move interval selections by default." + }, + "point": { + "$ref": "#/definitions/PointSelectionConfigWithoutType", + "description": "The default definition for a [`point`](https://vega.github.io/vega-lite/docs/parameter.html#select) selection. All properties and transformations for a point selection definition (except `type`) may be specified here.\n\nFor instance, setting `point` to `{\"on\": \"dblclick\"}` populates point selections on double-click by default." + } + }, + "type": "object" + }, + "SelectionInit": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + } + ] + }, + "SelectionInitInterval": { + "anyOf": [ + { + "$ref": "#/definitions/Vector2" + }, + { + "$ref": "#/definitions/Vector2" + }, + { + "$ref": "#/definitions/Vector2" + }, + { + "$ref": "#/definitions/Vector2" + } + ] + }, + "SelectionInitIntervalMapping": { + "$ref": "#/definitions/Dict" + }, + "SelectionInitMapping": { + "$ref": "#/definitions/Dict" + }, + "SelectionParameter": { + "additionalProperties": false, + "properties": { + "bind": { + "anyOf": [ + { + "$ref": "#/definitions/Binding" + }, + { + "additionalProperties": { + "$ref": "#/definitions/Binding" + }, + "type": "object" + }, + { + "$ref": "#/definitions/LegendBinding" + }, + { + "const": "scales", + "type": "string" + } + ], + "description": "When set, a selection is populated by input elements (also known as dynamic query widgets) or by interacting with the corresponding legend. Direct manipulation interaction is disabled by default; to re-enable it, set the selection's [`on`](https://vega.github.io/vega-lite/docs/selection.html#common-selection-properties) property.\n\nLegend bindings are restricted to selections that only specify a single field or encoding.\n\nQuery widget binding takes the form of Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind) or can be a mapping between projected field/encodings and binding definitions.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation." + }, + "name": { + "$ref": "#/definitions/ParameterName", + "description": "Required. A unique name for the selection parameter. Selection names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or \"$\", or \"_\") and may not start with a digit. Reserved keywords that may not be used as parameter names are \"datum\", \"event\", \"item\", and \"parent\"." + }, + "select": { + "anyOf": [ + { + "$ref": "#/definitions/SelectionType" + }, + { + "$ref": "#/definitions/PointSelectionConfig" + }, + { + "$ref": "#/definitions/IntervalSelectionConfig" + } + ], + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types:\n\n- `\"point\"` -- to select multiple discrete data values; the first value is selected on `click` and additional values toggled on shift-click.\n- `\"interval\"` -- to select a continuous range of data values on `drag`." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/SelectionInit" + }, + { + "items": { + "$ref": "#/definitions/SelectionInitMapping" + }, + "type": "array" + }, + { + "$ref": "#/definitions/SelectionInitIntervalMapping" + } + ], + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/selection.html#project) and initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/value.html) documentation." + } + }, + "required": [ + "name", + "select" + ], + "type": "object" + }, + "SelectionResolution": { + "enum": [ + "global", + "union", + "intersect" + ], + "type": "string" + }, + "SelectionType": { + "enum": [ + "point", + "interval" + ], + "type": "string" + }, + "SequenceGenerator": { + "additionalProperties": false, + "properties": { + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "sequence": { + "$ref": "#/definitions/SequenceParams", + "description": "Generate a sequence of numbers." + } + }, + "required": [ + "sequence" + ], + "type": "object" + }, + "SequenceParams": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The name of the generated sequence field.\n\n__Default value:__ `\"data\"`" + }, + "start": { + "description": "The starting value of the sequence (inclusive).", + "type": "number" + }, + "step": { + "description": "The step value between sequence entries.\n\n__Default value:__ `1`", + "type": "number" + }, + "stop": { + "description": "The ending value of the sequence (exclusive).", + "type": "number" + } + }, + "required": [ + "start", + "stop" + ], + "type": "object" + }, + "SequentialMultiHue": { + "enum": [ + "turbo", + "viridis", + "inferno", + "magma", + "plasma", + "cividis", + "bluegreen", + "bluegreen-3", + "bluegreen-4", + "bluegreen-5", + "bluegreen-6", + "bluegreen-7", + "bluegreen-8", + "bluegreen-9", + "bluepurple", + "bluepurple-3", + "bluepurple-4", + "bluepurple-5", + "bluepurple-6", + "bluepurple-7", + "bluepurple-8", + "bluepurple-9", + "goldgreen", + "goldgreen-3", + "goldgreen-4", + "goldgreen-5", + "goldgreen-6", + "goldgreen-7", + "goldgreen-8", + "goldgreen-9", + "goldorange", + "goldorange-3", + "goldorange-4", + "goldorange-5", + "goldorange-6", + "goldorange-7", + "goldorange-8", + "goldorange-9", + "goldred", + "goldred-3", + "goldred-4", + "goldred-5", + "goldred-6", + "goldred-7", + "goldred-8", + "goldred-9", + "greenblue", + "greenblue-3", + "greenblue-4", + "greenblue-5", + "greenblue-6", + "greenblue-7", + "greenblue-8", + "greenblue-9", + "orangered", + "orangered-3", + "orangered-4", + "orangered-5", + "orangered-6", + "orangered-7", + "orangered-8", + "orangered-9", + "purplebluegreen", + "purplebluegreen-3", + "purplebluegreen-4", + "purplebluegreen-5", + "purplebluegreen-6", + "purplebluegreen-7", + "purplebluegreen-8", + "purplebluegreen-9", + "purpleblue", + "purpleblue-3", + "purpleblue-4", + "purpleblue-5", + "purpleblue-6", + "purpleblue-7", + "purpleblue-8", + "purpleblue-9", + "purplered", + "purplered-3", + "purplered-4", + "purplered-5", + "purplered-6", + "purplered-7", + "purplered-8", + "purplered-9", + "redpurple", + "redpurple-3", + "redpurple-4", + "redpurple-5", + "redpurple-6", + "redpurple-7", + "redpurple-8", + "redpurple-9", + "yellowgreenblue", + "yellowgreenblue-3", + "yellowgreenblue-4", + "yellowgreenblue-5", + "yellowgreenblue-6", + "yellowgreenblue-7", + "yellowgreenblue-8", + "yellowgreenblue-9", + "yellowgreen", + "yellowgreen-3", + "yellowgreen-4", + "yellowgreen-5", + "yellowgreen-6", + "yellowgreen-7", + "yellowgreen-8", + "yellowgreen-9", + "yelloworangebrown", + "yelloworangebrown-3", + "yelloworangebrown-4", + "yelloworangebrown-5", + "yelloworangebrown-6", + "yelloworangebrown-7", + "yelloworangebrown-8", + "yelloworangebrown-9", + "yelloworangered", + "yelloworangered-3", + "yelloworangered-4", + "yelloworangered-5", + "yelloworangered-6", + "yelloworangered-7", + "yelloworangered-8", + "yelloworangered-9", + "darkblue", + "darkblue-3", + "darkblue-4", + "darkblue-5", + "darkblue-6", + "darkblue-7", + "darkblue-8", + "darkblue-9", + "darkgold", + "darkgold-3", + "darkgold-4", + "darkgold-5", + "darkgold-6", + "darkgold-7", + "darkgold-8", + "darkgold-9", + "darkgreen", + "darkgreen-3", + "darkgreen-4", + "darkgreen-5", + "darkgreen-6", + "darkgreen-7", + "darkgreen-8", + "darkgreen-9", + "darkmulti", + "darkmulti-3", + "darkmulti-4", + "darkmulti-5", + "darkmulti-6", + "darkmulti-7", + "darkmulti-8", + "darkmulti-9", + "darkred", + "darkred-3", + "darkred-4", + "darkred-5", + "darkred-6", + "darkred-7", + "darkred-8", + "darkred-9", + "lightgreyred", + "lightgreyred-3", + "lightgreyred-4", + "lightgreyred-5", + "lightgreyred-6", + "lightgreyred-7", + "lightgreyred-8", + "lightgreyred-9", + "lightgreyteal", + "lightgreyteal-3", + "lightgreyteal-4", + "lightgreyteal-5", + "lightgreyteal-6", + "lightgreyteal-7", + "lightgreyteal-8", + "lightgreyteal-9", + "lightmulti", + "lightmulti-3", + "lightmulti-4", + "lightmulti-5", + "lightmulti-6", + "lightmulti-7", + "lightmulti-8", + "lightmulti-9", + "lightorange", + "lightorange-3", + "lightorange-4", + "lightorange-5", + "lightorange-6", + "lightorange-7", + "lightorange-8", + "lightorange-9", + "lighttealblue", + "lighttealblue-3", + "lighttealblue-4", + "lighttealblue-5", + "lighttealblue-6", + "lighttealblue-7", + "lighttealblue-8", + "lighttealblue-9" + ], + "type": "string" + }, + "SequentialSingleHue": { + "enum": [ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges" + ], + "type": "string" + }, + "ShapeDef": { + "$ref": "#/definitions/MarkPropDef<(string|null),TypeForShape>" + }, + "SharedEncoding": { + "additionalProperties": false, + "properties": { + "angle": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "color": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "description": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "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`." + }, + "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." + }, + "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`.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + { + "items": { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + "type": "array" + } + ], + "description": "Additional levels of detail for grouping data in aggregate views and in line, trail, and area marks without mapping data to a specific visual channel." + }, + "fill": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "fillOpacity": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "href": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "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`." + }, + "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." + }, + "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`.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "key": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "latitude": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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": { + "anyOf": [ + { + "const": "quantitative", + "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": "string" + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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" + }, + "latitude2": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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/Type", + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "longitude": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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": { + "anyOf": [ + { + "const": "quantitative", + "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": "string" + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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" + }, + "longitude2": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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/Type", + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "opacity": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/OrderValueDef" + } + ], + "description": "Order of the marks.\n- For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#order).\n- For line and trail marks, this `order` channel encodes order of data points in the lines. This can be useful for creating [a connected scatterplot](https://vega.github.io/vega-lite/examples/connected_scatterplot.html). Setting `order` to `{\"value\": null}` makes the line marks use the original order in the data sources.\n- Otherwise, this `order` channel encodes layer order of the marks.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." + }, + "radius": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "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." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "radius2": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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/Type", + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "shape": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$ref": "#/definitions/TypeForShape", + "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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "size": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "stroke": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "strokeDash": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "strokeOpacity": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "strokeWidth": { + "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#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "text": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalStringFieldDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "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." + }, + "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`.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "theta": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "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." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "theta2": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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/Type", + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/StringFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "The tooltip text to show upon mouse hover. Specifying `tooltip` encoding overrides [the `tooltip` property in the mark definition](https://vega.github.io/vega-lite/docs/mark.html#mark-def).\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite." + }, + "url": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + } + ], + "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." + }, + "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`." + }, + "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." + }, + "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`.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "x": { + "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." + }, + "axis": { + "anyOf": [ + { + "$ref": "#/definitions/Axis" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "impute": { + "anyOf": [ + { + "$ref": "#/definitions/ImputeParams" + }, + { + "type": "null" + } + ], + "description": "An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as `key` of the `Impute` Operation. The field of the `color` channel if specified is used as `groupby` of the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." + }, + "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." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "x2": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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/Type", + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "xError": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "type": "object" + }, + "xError2": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "type": "object" + }, + "xOffset": { + "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#params), 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) 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." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "type": "object" + }, + "y": { + "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." + }, + "axis": { + "anyOf": [ + { + "$ref": "#/definitions/Axis" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "impute": { + "anyOf": [ + { + "$ref": "#/definitions/ImputeParams" + }, + { + "type": "null" + } + ], + "description": "An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as `key` of the `Impute` Operation. The field of the `color` channel if specified is used as `groupby` of the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." + }, + "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." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "y2": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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/Type", + "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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "yError": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "type": "object" + }, + "yError2": { + "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": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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.", + "type": "null" + }, + "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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "type": "object" + }, + "yOffset": { + "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#params), 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) 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." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "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`." + }, + "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/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": { + "anyOf": [ + { + "$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." + }, + { + "$ref": "#/definitions/Type", + "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." + } + ], + "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." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "SingleDefUnitChannel": { + "enum": [ + "x", + "y", + "xOffset", + "yOffset", + "x2", + "y2", + "longitude", + "latitude", + "longitude2", + "latitude2", + "theta", + "theta2", + "radius", + "radius2", + "color", + "fill", + "stroke", + "opacity", + "fillOpacity", + "strokeOpacity", + "strokeWidth", + "strokeDash", + "size", + "angle", + "shape", + "key", + "text", + "href", + "url", + "description" + ], + "type": "string" + }, + "SingleTimeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/LocalSingleTimeUnit" + }, + { + "$ref": "#/definitions/UtcSingleTimeUnit" + } + ] + }, + "Sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/AllSortString" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "$ref": "#/definitions/SortByEncoding" + }, + { + "type": "null" + } + ] + }, + "SortArray": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ] + }, + "SortByChannel": { + "enum": [ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text" + ], + "type": "string" + }, + "SortByChannelDesc": { + "enum": [ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text" + ], + "type": "string" + }, + "SortByEncoding": { + "additionalProperties": false, + "properties": { + "encoding": { + "$ref": "#/definitions/SortByChannel", + "description": "The [encoding channel](https://vega.github.io/vega-lite/docs/encoding.html#channels) to sort by (e.g., `\"x\"`, `\"y\"`)" + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "type": "null" + } + ], + "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "required": [ + "encoding" + ], + "type": "object" + }, + "SortField": { + "additionalProperties": false, + "description": "A sort definition for transform", + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "The name of the field to sort." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "type": "null" + } + ], + "description": "Whether to sort the field in ascending or descending order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "required": [ + "field" + ], + "type": "object" + }, + "SortOrder": { + "enum": [ + "ascending", + "descending" + ], + "type": "string" + }, + "SphereGenerator": { + "additionalProperties": false, + "properties": { + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "sphere": { + "anyOf": [ + { + "const": true, + "type": "boolean" + }, + { + "additionalProperties": false, + "type": "object" + } + ], + "description": "Generate sphere GeoJSON data for the full globe." + } + }, + "required": [ + "sphere" + ], + "type": "object" + }, + "StackOffset": { + "enum": [ + "zero", + "center", + "normalize" + ], + "type": "string" + }, + "StackTransform": { + "additionalProperties": false, + "properties": { + "as": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "items": { + "$ref": "#/definitions/FieldName" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + } + ], + "description": "Output field names. This can be either a string or an array of strings with two elements denoting the name for the fields for stack start and stack end respectively. If a single string(e.g., `\"val\"`) is provided, the end field will be `\"val_end\"`." + }, + "groupby": { + "description": "The data fields to group by.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "offset": { + "description": "Mode for stacking marks. One of `\"zero\"` (default), `\"center\"`, or `\"normalize\"`. The `\"zero\"` offset will stack starting at `0`. The `\"center\"` offset will center the stacks. The `\"normalize\"` offset will compute percentage values for each stack point, with output values in the range `[0,1]`.\n\n__Default value:__ `\"zero\"`", + "enum": [ + "zero", + "center", + "normalize" + ], + "type": "string" + }, + "sort": { + "description": "Field that determines the order of leaves in the stacked charts.", + "items": { + "$ref": "#/definitions/SortField" + }, + "type": "array" + }, + "stack": { + "$ref": "#/definitions/FieldName", + "description": "The field which is stacked." + } + }, + "required": [ + "stack", + "groupby", + "as" + ], + "type": "object" + }, + "StandardType": { + "enum": [ + "quantitative", + "ordinal", + "temporal", + "nominal" + ], + "type": "string" + }, + "Step": { + "additionalProperties": false, + "properties": { + "for": { + "$ref": "#/definitions/StepFor", + "description": "Whether to apply the step to position scale or offset scale when there are both `x` and `xOffset` or both `y` and `yOffset` encodings." + }, + "step": { + "description": "The size (width/height) per discrete step.", + "type": "number" + } + }, + "required": [ + "step" + ], + "type": "object" + }, + "StepFor": { + "enum": [ + "position", + "offset" + ], + "type": "string" + }, + "Stream": { + "anyOf": [ + { + "$ref": "#/definitions/EventStream" + }, + { + "$ref": "#/definitions/DerivedStream" + }, + { + "$ref": "#/definitions/MergedStream" + } + ] + }, + "StringFieldDef": { + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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`." + }, + "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." + }, + "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`.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "StringFieldDefWithCondition": { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + "StringValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition" + }, + "StrokeCap": { + "enum": [ + "butt", + "round", + "square" + ], + "type": "string" + }, + "StrokeJoin": { + "enum": [ + "miter", + "round", + "bevel" + ], + "type": "string" + }, + "StyleConfigIndex": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/AnyMarkConfig" + }, + { + "$ref": "#/definitions/Axis" + } + ] + }, + "properties": { + "arc": { + "$ref": "#/definitions/RectConfig", + "description": "Arc-specific Config" + }, + "area": { + "$ref": "#/definitions/AreaConfig", + "description": "Area-Specific Config" + }, + "bar": { + "$ref": "#/definitions/BarConfig", + "description": "Bar-Specific Config" + }, + "circle": { + "$ref": "#/definitions/MarkConfig", + "description": "Circle-Specific Config" + }, + "geoshape": { + "$ref": "#/definitions/MarkConfig", + "description": "Geoshape-Specific Config" + }, + "group-subtitle": { + "$ref": "#/definitions/MarkConfig", + "description": "Default style for chart subtitles" + }, + "group-title": { + "$ref": "#/definitions/MarkConfig", + "description": "Default style for chart titles" + }, + "guide-label": { + "$ref": "#/definitions/MarkConfig", + "description": "Default style for axis, legend, and header labels." + }, + "guide-title": { + "$ref": "#/definitions/MarkConfig", + "description": "Default style for axis, legend, and header titles." + }, + "image": { + "$ref": "#/definitions/RectConfig", + "description": "Image-specific Config" + }, + "line": { + "$ref": "#/definitions/LineConfig", + "description": "Line-Specific Config" + }, + "mark": { + "$ref": "#/definitions/MarkConfig", + "description": "Mark Config" + }, + "point": { + "$ref": "#/definitions/MarkConfig", + "description": "Point-Specific Config" + }, + "rect": { + "$ref": "#/definitions/RectConfig", + "description": "Rect-Specific Config" + }, + "rule": { + "$ref": "#/definitions/MarkConfig", + "description": "Rule-Specific Config" + }, + "square": { + "$ref": "#/definitions/MarkConfig", + "description": "Square-Specific Config" + }, + "text": { + "$ref": "#/definitions/MarkConfig", + "description": "Text-Specific Config" + }, + "tick": { + "$ref": "#/definitions/TickConfig", + "description": "Tick-Specific Config" + }, + "trail": { + "$ref": "#/definitions/LineConfig", + "description": "Trail-Specific Config" + } + }, + "type": "object" + }, + "SymbolShape": { + "type": "string" + }, + "Text": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ] + }, + "TextBaseline": { + "anyOf": [ + { + "const": "alphabetic", + "type": "string" + }, + { + "$ref": "#/definitions/Baseline" + }, + { + "const": "line-top", + "type": "string" + }, + { + "const": "line-bottom", + "type": "string" + } + ] + }, + "TextDef": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" + } + ] + }, + "TextDirection": { + "enum": [ + "ltr", + "rtl" + ], + "type": "string" + }, + "TickConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "bandSize": { + "description": "The width of the ticks.\n\n__Default value:__ 3/4 of step (width step for horizontal ticks and height step for vertical ticks).", + "minimum": 0, + "type": "number" + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." + }, + "outerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", + "minimum": 0 + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", + "minimum": 0 + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "thickness": { + "description": "Thickness of the tick mark.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "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" + }, + "timeUnitBandSize": { + "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "TickCount": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/TimeInterval" + }, + { + "$ref": "#/definitions/TimeIntervalStep" + } + ] + }, + "TimeInterval": { + "enum": [ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year" + ], + "type": "string" + }, + "TimeIntervalStep": { + "additionalProperties": false, + "properties": { + "interval": { + "$ref": "#/definitions/TimeInterval" + }, + "step": { + "type": "number" + } + }, + "required": [ + "interval", + "step" + ], + "type": "object" + }, + "TimeLocale": { + "additionalProperties": false, + "description": "Locale definition for formatting dates and times.", + "properties": { + "date": { + "description": "The date (%x) format specifier (e.g., \"%m/%d/%Y\").", + "type": "string" + }, + "dateTime": { + "description": "The date and time (%c) format specifier (e.g., \"%a %b %e %X %Y\").", + "type": "string" + }, + "days": { + "$ref": "#/definitions/Vector7", + "description": "The full names of the weekdays, starting with Sunday." + }, + "months": { + "$ref": "#/definitions/Vector12", + "description": "The full names of the months (starting with January)." + }, + "periods": { + "$ref": "#/definitions/Vector2", + "description": "The A.M. and P.M. equivalents (e.g., [\"AM\", \"PM\"])." + }, + "shortDays": { + "$ref": "#/definitions/Vector7", + "description": "The abbreviated names of the weekdays, starting with Sunday." + }, + "shortMonths": { + "$ref": "#/definitions/Vector12", + "description": "The abbreviated names of the months (starting with January)." + }, + "time": { + "description": "The time (%X) format specifier (e.g., \"%H:%M:%S\").", + "type": "string" + } + }, + "required": [ + "dateTime", + "date", + "time", + "periods", + "days", + "shortDays", + "months", + "shortMonths" + ], + "type": "object" + }, + "TimeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/SingleTimeUnit" + }, + { + "$ref": "#/definitions/MultiTimeUnit" + } + ] + }, + "TimeUnitParams": { + "additionalProperties": false, + "properties": { + "maxbins": { + "description": "If no `unit` is specified, maxbins is used to infer time units.", + "type": "number" + }, + "step": { + "description": "The number of steps between bins, in terms of the least significant unit provided.", + "type": "number" + }, + "unit": { + "$ref": "#/definitions/TimeUnit", + "description": "Defines how date-time values should be binned." + }, + "utc": { + "description": "True to use UTC timezone. Equivalent to using a `utc` prefixed `TimeUnit`.", + "type": "boolean" + } + }, + "type": "object" + }, + "TimeUnitTransform": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output field to write the timeUnit value." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field to apply time unit." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "The timeUnit." + } + }, + "required": [ + "timeUnit", + "field", + "as" + ], + "type": "object" + }, + "TitleAnchor": { + "enum": [ + null, + "start", + "middle", + "end" + ], + "type": [ + "null", + "string" + ] + }, + "TitleConfig": { + "$ref": "#/definitions/BaseTitleNoValueRefs" + }, + "TitleFrame": { + "enum": [ + "bounds", + "group" + ], + "type": "string" + }, + "TitleOrient": { + "enum": [ + "none", + "left", + "right", + "top", + "bottom" + ], + "type": "string" + }, + "TitleParams": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for title text. One of `\"left\"`, `\"center\"`, or `\"right\"`." + }, + "anchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "The anchor position for placing the title. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title.\n\n__Default value:__ `\"middle\"` for [single](https://vega.github.io/vega-lite/docs/spec.html) and [layered](https://vega.github.io/vega-lite/docs/layer.html) views. `\"start\"` for other composite views.\n\n__Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only customizable only for [single](https://vega.github.io/vega-lite/docs/spec.html) and [layered](https://vega.github.io/vega-lite/docs/layer.html) views. For other composite views, `anchor` is always `\"start\"`." + }, + "angle": { + "anyOf": [ + { + "description": "Angle in degrees of title and subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the title from the ARIA accessibility tree.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for title and subtitle text. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." + }, + "color": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Text color for title text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "Delta offset for title and subtitle text x-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "Delta offset for title and subtitle text y-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "font": { + "anyOf": [ + { + "description": "Font name for title text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "Font size in pixels for title text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for title text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "Font weight for title text. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "frame": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/TitleFrame" + }, + { + "type": "string" + } + ], + "description": "The reference frame for the anchor position, one of `\"bounds\"` (to anchor relative to the full bounding box) or `\"group\"` (to anchor relative to the group width or height)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum allowed length in pixels of title and subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "anyOf": [ + { + "description": "The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "orient": { + "anyOf": [ + { + "$ref": "#/definitions/TitleOrient", + "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "A [mark style property](https://vega.github.io/vega-lite/docs/config.html#style) to apply to the title text mark.\n\n__Default value:__ `\"group-title\"`." + }, + "subtitle": { + "$ref": "#/definitions/Text", + "description": "The subtitle Text." + }, + "subtitleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Text color for subtitle text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFont": { + "anyOf": [ + { + "description": "Font name for subtitle text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontSize": { + "anyOf": [ + { + "description": "Font size in pixels for subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for subtitle text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "Font weight for subtitle text. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitlePadding": { + "anyOf": [ + { + "description": "The padding in pixels between title and subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The title text." + }, + "zindex": { + "description": "The integer z-index indicating the layering of the title group relative to other axis, mark and legend groups.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + } + }, + "required": [ + "text" + ], + "type": "object" + }, + "TooltipContent": { + "additionalProperties": false, + "properties": { + "content": { + "enum": [ + "encoding", + "data" + ], + "type": "string" + } + }, + "required": [ + "content" + ], + "type": "object" + }, + "TopLevelConcatSpec": { + "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.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "concat": { + "description": "A list of views to be concatenated.", + "items": { + "$ref": "#/definitions/NonNormalizedSpec" + }, + "type": "array" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "datasets": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables or selections that parameterize a visualization.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/TopLevelSelectionParameter" + } + ] + }, + "type": "array" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." + } + }, + "required": [ + "concat" + ], + "type": "object" + }, + "TopLevelHConcatSpec": { + "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.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "datasets": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "hconcat": { + "description": "A list of views to be concatenated and put into a row.", + "items": { + "$ref": "#/definitions/NonNormalizedSpec" + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables or selections that parameterize a visualization.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/TopLevelSelectionParameter" + } + ] + }, + "type": "array" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." + } + }, + "required": [ + "hconcat" + ], + "type": "object" + }, + "TopLevelVConcatSpec": { + "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.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "datasets": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables or selections that parameterize a visualization.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/TopLevelSelectionParameter" + } + ] + }, + "type": "array" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." + }, + "vconcat": { + "description": "A list of views to be concatenated and put into a column.", + "items": { + "$ref": "#/definitions/NonNormalizedSpec" + }, + "type": "array" + } + }, + "required": [ + "vconcat" + ], + "type": "object" + }, + "TopLevelLayerSpec": { + "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.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "datasets": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/SharedEncoding", + "description": "A shared key-value mapping between encoding channels and definition of fields in the underlying layers." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number.\n- For a plot with either a discrete y-field or no y-field, height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step. (No y-field is equivalent to having one discrete step.)\n- To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." + }, + "layer": { + "description": "Layer or single view specifications to be layered.\n\n__Note__: Specifications inside `layer` cannot use `row` and `column` channels as layering facet specifications is not allowed. Instead, use the [facet operator](https://vega.github.io/vega-lite/docs/facet.html) and place a layer inside a facet.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ] + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables or selections that parameterize a visualization.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/TopLevelSelectionParameter" + } + ] + }, + "type": "array" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of the geographic projection shared by underlying layers." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number.\n- For a plot with either a discrete x-field or no x-field, width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step. (No x-field is equivalent to having one discrete step.)\n- To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." + } + }, + "required": [ + "layer" + ], + "type": "object" + }, + "TopLevelRepeatSpec": { + "anyOf": [ + { + "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.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "datasets": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables or selections that parameterize a visualization.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/TopLevelSelectionParameter" + } + ] + }, + "type": "array" + }, + "repeat": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/RepeatMapping" + } + ], + "description": "Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If `\"repeat\"` is an array, the field can be referred to as `{\"repeat\": \"repeat\"}`. The repeated views are laid out in a wrapped row. You can set the number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"column\"` to the listed fields to be repeated along the particular orientations. The objects `{\"repeat\": \"row\"}` and `{\"repeat\": \"column\"}` can be used to refer to the repeated field respectively." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "spec": { + "$ref": "#/definitions/NonNormalizedSpec", + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + }, + { + "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.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "datasets": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables or selections that parameterize a visualization.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/TopLevelSelectionParameter" + } + ] + }, + "type": "array" + }, + "repeat": { + "$ref": "#/definitions/LayerRepeatMapping", + "description": "Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If `\"repeat\"` is an array, the field can be referred to as `{\"repeat\": \"repeat\"}`. The repeated views are laid out in a wrapped row. You can set the number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"column\"` to the listed fields to be repeated along the particular orientations. The objects `{\"repeat\": \"row\"}` and `{\"repeat\": \"column\"}` can be used to refer to the repeated field respectively." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ], + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + } + ] + }, + "TopLevelFacetSpec": { + "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.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "datasets": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "facet": { + "anyOf": [ + { + "$ref": "#/definitions/FacetFieldDef" + }, + { + "$ref": "#/definitions/FacetMapping" + } + ], + "description": "Definition for how to facet the data. One of: 1) [a field definition for faceting the plot by one field](https://vega.github.io/vega-lite/docs/facet.html#field-def) 2) [An object that maps `row` and `column` channels to their field definitions](https://vega.github.io/vega-lite/docs/facet.html#mapping)" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables or selections that parameterize a visualization.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/TopLevelSelectionParameter" + } + ] + }, + "type": "array" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpecWithFrame" + } + ], + "description": "A specification of the view that gets faceted." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." + } + }, + "required": [ + "data", + "facet", + "spec" + ], + "type": "object" + }, + "TopLevelSelectionParameter": { + "additionalProperties": false, + "properties": { + "bind": { + "anyOf": [ + { + "$ref": "#/definitions/Binding" + }, + { + "additionalProperties": { + "$ref": "#/definitions/Binding" + }, + "type": "object" + }, + { + "$ref": "#/definitions/LegendBinding" + }, + { + "const": "scales", + "type": "string" + } + ], + "description": "When set, a selection is populated by input elements (also known as dynamic query widgets) or by interacting with the corresponding legend. Direct manipulation interaction is disabled by default; to re-enable it, set the selection's [`on`](https://vega.github.io/vega-lite/docs/selection.html#common-selection-properties) property.\n\nLegend bindings are restricted to selections that only specify a single field or encoding.\n\nQuery widget binding takes the form of Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind) or can be a mapping between projected field/encodings and binding definitions.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation." + }, + "name": { + "$ref": "#/definitions/ParameterName", + "description": "Required. A unique name for the selection parameter. Selection names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or \"$\", or \"_\") and may not start with a digit. Reserved keywords that may not be used as parameter names are \"datum\", \"event\", \"item\", and \"parent\"." + }, + "select": { + "anyOf": [ + { + "$ref": "#/definitions/SelectionType" + }, + { + "$ref": "#/definitions/PointSelectionConfig" + }, + { + "$ref": "#/definitions/IntervalSelectionConfig" + } + ], + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types:\n\n- `\"point\"` -- to select multiple discrete data values; the first value is selected on `click` and additional values toggled on shift-click.\n- `\"interval\"` -- to select a continuous range of data values on `drag`." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/SelectionInit" + }, + { + "items": { + "$ref": "#/definitions/SelectionInitMapping" + }, + "type": "array" + }, + { + "$ref": "#/definitions/SelectionInitIntervalMapping" + } + ], + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/selection.html#project) and initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/value.html) documentation." + }, + "views": { + "description": "By default, top-level selections are applied to every view in the visualization. If this property is specified, selections will only be applied to views with the given names.", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ] + }, + "type": "array" + } + }, + "required": [ + "name", + "select" + ], + "type": "object" + }, + "TopLevelSpec": { + "anyOf": [ + { + "$ref": "#/definitions/TopLevelUnitSpec" + }, + { + "$ref": "#/definitions/TopLevelFacetSpec" + }, + { + "$ref": "#/definitions/TopLevelLayerSpec" + }, + { + "$ref": "#/definitions/TopLevelRepeatSpec" + }, + { + "$ref": "#/definitions/TopLevelConcatSpec" + }, + { + "$ref": "#/definitions/TopLevelVConcatSpec" + }, + { + "$ref": "#/definitions/TopLevelHConcatSpec" + } + ], + "description": "A Vega-Lite top-level specification. This is the root class for all Vega-Lite specifications. (The json schema is generated from this type.)" + }, + "TopLevelUnitSpec": { + "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.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "datasets": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/FacetedEncoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number.\n- For a plot with either a discrete y-field or no y-field, height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step. (No y-field is equivalent to having one discrete step.)\n- To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" + }, + "params": { + "description": "An array of parameters that may either be simple variables, or more complex selections that map user input to data queries.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/SelectionParameter" + } + ] + }, + "type": "array" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks and to `latitude` and `\"longitude\"` channels for other marks." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number.\n- For a plot with either a discrete x-field or no x-field, width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step. (No x-field is equivalent to having one discrete step.)\n- To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." + } + }, + "required": [ + "data", + "mark" + ], + "type": "object" + }, + "TopoDataFormat": { + "additionalProperties": false, + "properties": { + "feature": { + "description": "The name of the TopoJSON object set to convert to a GeoJSON feature collection. For example, in a map of the world, there may be an object set named `\"countries\"`. Using the feature property, we can extract this set and generate a GeoJSON feature object for each country.", + "type": "string" + }, + "mesh": { + "description": "The name of the TopoJSON object set to convert to mesh. Similar to the `feature` option, `mesh` extracts a named TopoJSON object set. Unlike the `feature` option, the corresponding geo data is returned as a single, unified mesh instance, not as individual GeoJSON features. Extracting a mesh is useful for more efficiently drawing borders or other geographic elements that you do not need to associate with specific regions such as individual countries, states or counties.", + "type": "string" + }, + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using JavaScript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: \"utc:'%m%d%Y'\"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)" + }, + "type": { + "const": "topojson", + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `\"json\"` will be used by default.", + "type": "string" + } + }, + "type": "object" + }, + "Transform": { + "anyOf": [ + { + "$ref": "#/definitions/AggregateTransform" + }, + { + "$ref": "#/definitions/BinTransform" + }, + { + "$ref": "#/definitions/CalculateTransform" + }, + { + "$ref": "#/definitions/DensityTransform" + }, + { + "$ref": "#/definitions/FilterTransform" + }, + { + "$ref": "#/definitions/FlattenTransform" + }, + { + "$ref": "#/definitions/FoldTransform" + }, + { + "$ref": "#/definitions/ImputeTransform" + }, + { + "$ref": "#/definitions/JoinAggregateTransform" + }, + { + "$ref": "#/definitions/LoessTransform" + }, + { + "$ref": "#/definitions/LookupTransform" + }, + { + "$ref": "#/definitions/QuantileTransform" + }, + { + "$ref": "#/definitions/RegressionTransform" + }, + { + "$ref": "#/definitions/TimeUnitTransform" + }, + { + "$ref": "#/definitions/SampleTransform" + }, + { + "$ref": "#/definitions/StackTransform" + }, + { + "$ref": "#/definitions/WindowTransform" + }, + { + "$ref": "#/definitions/PivotTransform" + } + ] + }, + "Type": { + "description": "Data type based on level of measurement", + "enum": [ + "quantitative", + "ordinal", + "temporal", + "nominal", + "geojson" + ], + "type": "string" + }, + "TypeForShape": { + "enum": [ + "nominal", + "ordinal", + "geojson" + ], + "type": "string" + }, + "TypedFieldDef": { + "additionalProperties": false, + "description": "Definition object for a data field, its type and transformation of an encoding channel.", + "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" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), 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) 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`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$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" + }, + "URI": { + "format": "uri-reference", + "type": "string" + }, + "UnitSpec": { + "$ref": "#/definitions/GenericUnitSpec", + "description": "A unit specification, which can contain either [primitive marks or composite marks](https://vega.github.io/vega-lite/docs/mark.html#types)." + }, + "UnitSpecWithFrame": { + "additionalProperties": false, + "properties": { + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/Encoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number.\n- For a plot with either a discrete y-field or no y-field, height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step. (No y-field is equivalent to having one discrete step.)\n- To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "params": { + "description": "An array of parameters that may either be simple variables, or more complex selections that map user input to data queries.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/VariableParameter" + }, + { + "$ref": "#/definitions/SelectionParameter" + } + ] + }, + "type": "array" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks and to `latitude` and `\"longitude\"` channels for other marks." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number.\n- For a plot with either a discrete x-field or no x-field, width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step. (No x-field is equivalent to having one discrete step.)\n- To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "UrlData": { + "additionalProperties": false, + "properties": { + "format": { + "$ref": "#/definitions/DataFormat", + "description": "An object that specifies the format for parsing the data." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "url": { + "description": "An URL from which to load the data set. Use the `format.type` property to ensure the loaded data is correctly parsed.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "UtcMultiTimeUnit": { + "enum": [ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds" + ], + "type": "string" + }, + "UtcSingleTimeUnit": { + "enum": [ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds" + ], + "type": "string" + }, + "ValueDef<(number|\"width\"|\"height\"|ExprRef)>": { + "additionalProperties": false, + "description": "Definition object for a constant value (primitive value or gradient definition) of an encoding channel.", + "properties": { + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ValueDef": { + "additionalProperties": false, + "description": "Definition object for a constant value (primitive value or gradient definition) of an encoding channel.", + "properties": { + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "ValueDefWithCondition,(string|null)>": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalStringFieldDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a parameter predicate." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "VariableParameter": { + "additionalProperties": false, + "properties": { + "bind": { + "$ref": "#/definitions/Binding", + "description": "Binds the parameter to an external input element such as a slider, selection list or radio button group." + }, + "expr": { + "$ref": "#/definitions/Expr", + "description": "An expression for the value of the parameter. This expression may include other parameters, in which case the parameter will automatically update in response to upstream parameter changes." + }, + "name": { + "$ref": "#/definitions/ParameterName", + "description": "A unique name for the variable parameter. Parameter names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or \"$\", or \"_\") and may not start with a digit. Reserved keywords that may not be used as parameter names are \"datum\", \"event\", \"item\", and \"parent\"." + }, + "value": { + "description": "The [initial value](http://vega.github.io/vega-lite/docs/value.html) of the parameter.\n\n__Default value:__ `undefined`" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "Vector10": { + "items": { + "type": "string" + }, + "maxItems": 10, + "minItems": 10, + "type": "array" + }, + "Vector12": { + "items": { + "type": "string" + }, + "maxItems": 12, + "minItems": 12, + "type": "array" + }, + "Vector2": { + "items": { + "$ref": "#/definitions/DateTime" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "Vector2>": { + "items": { + "$ref": "#/definitions/Vector2" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "Vector2": { + "items": { + "type": "boolean" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "Vector2": { + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "Vector2": { + "items": { + "type": "string" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "Vector3": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "type": "array" + }, + "Vector7": { + "items": { + "type": "string" + }, + "maxItems": 7, + "minItems": 7, + "type": "array" + }, + "ViewBackground": { + "additionalProperties": false, + "properties": { + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the view. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The fill color.\n\n__Default value:__ `undefined`" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The stroke color.\n\n__Default value:__ `\"#ddd\"`" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "A string or array of strings indicating the name of custom styles to apply to the view background. A style is a named collection of mark property defaults defined within the [style configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles.\n\n__Default value:__ `\"cell\"` __Note:__ Any specified view background properties will augment the default style." + } + }, + "type": "object" + }, + "ViewConfig": { + "additionalProperties": false, + "properties": { + "clip": { + "description": "Whether the view should be clipped.", + "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`", + "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`", + "type": "number" + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "The mouse cursor used over the view. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." + }, + "discreteHeight": { + "anyOf": [ + { + "type": "number" + }, + { + "additionalProperties": false, + "properties": { + "step": { + "type": "number" + } + }, + "required": [ + "step" + ], + "type": "object" + } + ], + "description": "The default height when the plot has non arc marks and either a discrete y-field or no y-field. The height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step.\n\n__Default value:__ a step size based on `config.view.step`." + }, + "discreteWidth": { + "anyOf": [ + { + "type": "number" + }, + { + "additionalProperties": false, + "properties": { + "step": { + "type": "number" + } + }, + "required": [ + "step" + ], + "type": "object" + } + ], + "description": "The default width when the plot has non-arc marks and either a discrete x-field or no x-field. The width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step.\n\n__Default value:__ a step size based on `config.view.step`." + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The fill color.\n\n__Default value:__ `undefined`" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "step": { + "description": "Default step size for x-/y- discrete fields.", + "type": "number" + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The stroke color.\n\n__Default value:__ `\"#ddd\"`" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + } + }, + "type": "object" + }, + "WindowEventType": { + "anyOf": [ + { + "$ref": "#/definitions/EventType" + }, + { + "type": "string" + } + ] + }, + "WindowFieldDef": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output name for the window operation." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which to compute the aggregate or window function. This can be omitted for window functions that do not operate over a field such as `\"count\"`, `\"rank\"`, `\"dense_rank\"`." + }, + "op": { + "anyOf": [ + { + "$ref": "#/definitions/AggregateOp" + }, + { + "$ref": "#/definitions/WindowOnlyOp" + } + ], + "description": "The window or aggregation operation to apply within a window (e.g., `\"rank\"`, `\"lead\"`, `\"sum\"`, `\"average\"` or `\"count\"`). See the list of all supported operations [here](https://vega.github.io/vega-lite/docs/window.html#ops)." + }, + "param": { + "description": "Parameter values for the window functions. Parameter values can be omitted for operations that do not accept a parameter.\n\nSee the list of all supported operations and their parameters [here](https://vega.github.io/vega-lite/docs/transforms/window.html).", + "type": "number" + } + }, + "required": [ + "op", + "as" + ], + "type": "object" + }, + "WindowOnlyOp": { + "enum": [ + "row_number", + "rank", + "dense_rank", + "percent_rank", + "cume_dist", + "ntile", + "lag", + "lead", + "first_value", + "last_value", + "nth_value" + ], + "type": "string" + }, + "WindowTransform": { + "additionalProperties": false, + "properties": { + "frame": { + "description": "A frame specification as a two-element array indicating how the sliding window should proceed. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded rows preceding or following the current data object. The default value is `[null, 0]`, indicating that the sliding window includes the current object and all preceding objects. The value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object. Finally, `[null, null]` indicates that the window frame should always include all data objects. If you this frame and want to assign the same value to add objects, you can use the simpler [join aggregate transform](https://vega.github.io/vega-lite/docs/joinaggregate.html). The only operators affected are the aggregation operations and the `first_value`, `last_value`, and `nth_value` window operations. The other window operations are not affected by this.\n\n__Default value:__: `[null, 0]` (includes the current object and all preceding objects)", + "items": { + "type": [ + "null", + "number" + ] + }, + "type": "array" + }, + "groupby": { + "description": "The data fields for partitioning the data objects into separate windows. If unspecified, all data points will be in a single window.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "ignorePeers": { + "description": "Indicates if the sliding window frame should ignore peer values (data that are considered identical by the sort criteria). The default is false, causing the window frame to expand to include all peer values. If set to true, the window frame will be defined by offset values only. This setting only affects those operations that depend on the window frame, namely aggregation operations and the first_value, last_value, and nth_value window operations.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "sort": { + "description": "A sort field definition for sorting data objects within a window. If two data objects are considered equal by the comparator, they are considered \"peer\" values of equal rank. If sort is not specified, the order is undefined: data objects are processed in the order they are observed and none are considered peers (the ignorePeers parameter is ignored and treated as if set to `true`).", + "items": { + "$ref": "#/definitions/SortField" + }, + "type": "array" + }, + "window": { + "description": "The definition of the fields in the window, and what calculations to use.", + "items": { + "$ref": "#/definitions/WindowFieldDef" + }, + "type": "array" + } + }, + "required": [ + "window" + ], + "type": "object" + } + } +} diff --git a/altair/vegalite/v5/tests/__init__.py b/altair/vegalite/v5/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/altair/vegalite/v5/tests/test_api.py b/altair/vegalite/v5/tests/test_api.py new file mode 100644 index 000000000..450553f3c --- /dev/null +++ b/altair/vegalite/v5/tests/test_api.py @@ -0,0 +1,958 @@ +"""Unit tests for altair API""" + +import io +import json +import operator +import os +import pathlib +import tempfile + +import jsonschema +import pytest +import pandas as pd + +import altair.vegalite.v4 as alt + +try: + import altair_saver # noqa: F401 +except ImportError: + altair_saver = None + + +def getargs(*args, **kwargs): + return args, kwargs + + +OP_DICT = { + "layer": operator.add, + "hconcat": operator.or_, + "vconcat": operator.and_, +} + + +def _make_chart_type(chart_type): + data = pd.DataFrame( + { + "x": [28, 55, 43, 91, 81, 53, 19, 87], + "y": [43, 91, 81, 53, 19, 87, 52, 28], + "color": list("AAAABBBB"), + } + ) + base = ( + alt.Chart(data) + .mark_point() + .encode( + x="x", + y="y", + color="color", + ) + ) + + if chart_type in ["layer", "hconcat", "vconcat", "concat"]: + func = getattr(alt, chart_type) + return func(base.mark_square(), base.mark_circle()) + elif chart_type == "facet": + return base.facet("color") + elif chart_type == "facet_encoding": + return base.encode(facet="color") + elif chart_type == "repeat": + return base.encode(alt.X(alt.repeat(), type="quantitative")).repeat(["x", "y"]) + elif chart_type == "chart": + return base + else: + raise ValueError("chart_type='{}' is not recognized".format(chart_type)) + + +@pytest.fixture +def basic_chart(): + data = pd.DataFrame( + { + "a": ["A", "B", "C", "D", "E", "F", "G", "H", "I"], + "b": [28, 55, 43, 91, 81, 53, 19, 87, 52], + } + ) + + return alt.Chart(data).mark_bar().encode(x="a", y="b") + + +def test_chart_data_types(): + def Chart(data): + return alt.Chart(data).mark_point().encode(x="x:Q", y="y:Q") + + # Url Data + data = "/path/to/my/data.csv" + dct = Chart(data).to_dict() + assert dct["data"] == {"url": data} + + # Dict Data + data = {"values": [{"x": 1, "y": 2}, {"x": 2, "y": 3}]} + with alt.data_transformers.enable(consolidate_datasets=False): + dct = Chart(data).to_dict() + assert dct["data"] == data + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = Chart(data).to_dict() + name = dct["data"]["name"] + assert dct["datasets"][name] == data["values"] + + # DataFrame data + data = pd.DataFrame({"x": range(5), "y": range(5)}) + with alt.data_transformers.enable(consolidate_datasets=False): + dct = Chart(data).to_dict() + assert dct["data"]["values"] == data.to_dict(orient="records") + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = Chart(data).to_dict() + name = dct["data"]["name"] + assert dct["datasets"][name] == data.to_dict(orient="records") + + # Named data object + data = alt.NamedData(name="Foo") + dct = Chart(data).to_dict() + assert dct["data"] == {"name": "Foo"} + + +def test_chart_infer_types(): + data = pd.DataFrame( + { + "x": pd.date_range("2012", periods=10, freq="Y"), + "y": range(10), + "c": list("abcabcabca"), + } + ) + + def _check_encodings(chart): + dct = chart.to_dict() + assert dct["encoding"]["x"]["type"] == "temporal" + assert dct["encoding"]["x"]["field"] == "x" + assert dct["encoding"]["y"]["type"] == "quantitative" + assert dct["encoding"]["y"]["field"] == "y" + assert dct["encoding"]["color"]["type"] == "nominal" + assert dct["encoding"]["color"]["field"] == "c" + + # Pass field names by keyword + chart = alt.Chart(data).mark_point().encode(x="x", y="y", color="c") + _check_encodings(chart) + + # pass Channel objects by keyword + chart = ( + alt.Chart(data) + .mark_point() + .encode(x=alt.X("x"), y=alt.Y("y"), color=alt.Color("c")) + ) + _check_encodings(chart) + + # pass Channel objects by value + chart = alt.Chart(data).mark_point().encode(alt.X("x"), alt.Y("y"), alt.Color("c")) + _check_encodings(chart) + + # override default types + chart = ( + alt.Chart(data) + .mark_point() + .encode(alt.X("x", type="nominal"), alt.Y("y", type="ordinal")) + ) + dct = chart.to_dict() + assert dct["encoding"]["x"]["type"] == "nominal" + assert dct["encoding"]["y"]["type"] == "ordinal" + + +@pytest.mark.parametrize( + "args, kwargs", + [ + getargs(detail=["value:Q", "name:N"], tooltip=["value:Q", "name:N"]), + getargs(detail=["value", "name"], tooltip=["value", "name"]), + getargs(alt.Detail(["value:Q", "name:N"]), alt.Tooltip(["value:Q", "name:N"])), + getargs(alt.Detail(["value", "name"]), alt.Tooltip(["value", "name"])), + getargs( + [alt.Detail("value:Q"), alt.Detail("name:N")], + [alt.Tooltip("value:Q"), alt.Tooltip("name:N")], + ), + getargs( + [alt.Detail("value"), alt.Detail("name")], + [alt.Tooltip("value"), alt.Tooltip("name")], + ), + ], +) +def test_multiple_encodings(args, kwargs): + df = pd.DataFrame({"value": [1, 2, 3], "name": ["A", "B", "C"]}) + encoding_dct = [ + {"field": "value", "type": "quantitative"}, + {"field": "name", "type": "nominal"}, + ] + chart = alt.Chart(df).mark_point().encode(*args, **kwargs) + dct = chart.to_dict() + assert dct["encoding"]["detail"] == encoding_dct + assert dct["encoding"]["tooltip"] == encoding_dct + + +def test_chart_operations(): + data = pd.DataFrame( + { + "x": pd.date_range("2012", periods=10, freq="Y"), + "y": range(10), + "c": list("abcabcabca"), + } + ) + chart1 = alt.Chart(data).mark_line().encode(x="x", y="y", color="c") + chart2 = chart1.mark_point() + chart3 = chart1.mark_circle() + chart4 = chart1.mark_square() + + chart = chart1 + chart2 + chart3 + assert isinstance(chart, alt.LayerChart) + assert len(chart.layer) == 3 + chart += chart4 + assert len(chart.layer) == 4 + + chart = chart1 | chart2 | chart3 + assert isinstance(chart, alt.HConcatChart) + assert len(chart.hconcat) == 3 + chart |= chart4 + assert len(chart.hconcat) == 4 + + chart = chart1 & chart2 & chart3 + assert isinstance(chart, alt.VConcatChart) + assert len(chart.vconcat) == 3 + chart &= chart4 + assert len(chart.vconcat) == 4 + + +def test_selection_to_dict(): + brush = alt.selection(type="interval") + + # test some value selections + # Note: X and Y cannot have conditions + alt.Chart("path/to/data.json").mark_point().encode( + color=alt.condition(brush, alt.ColorValue("red"), alt.ColorValue("blue")), + opacity=alt.condition(brush, alt.value(0.5), alt.value(1.0)), + text=alt.condition(brush, alt.TextValue("foo"), alt.value("bar")), + ).to_dict() + + # test some field selections + # Note: X and Y cannot have conditions + # Conditions cannot both be fields + alt.Chart("path/to/data.json").mark_point().encode( + color=alt.condition(brush, alt.Color("col1:N"), alt.value("blue")), + opacity=alt.condition(brush, "col1:N", alt.value(0.5)), + text=alt.condition(brush, alt.value("abc"), alt.Text("col2:N")), + size=alt.condition(brush, alt.value(20), "col2:N"), + ).to_dict() + + +def test_selection_expression(): + selection = alt.selection_single(fields=["value"]) + + assert isinstance(selection.value, alt.expr.Expression) + assert selection.value.to_dict() == "{0}.value".format(selection.name) + + assert isinstance(selection["value"], alt.expr.Expression) + assert selection["value"].to_dict() == "{0}['value']".format(selection.name) + + with pytest.raises(AttributeError): + selection.__magic__ + + +@pytest.mark.parametrize("format", ["html", "json", "png", "svg", "pdf"]) +def test_save(format, basic_chart): + if format in ["pdf", "png"]: + out = io.BytesIO() + mode = "rb" + else: + out = io.StringIO() + mode = "r" + + if format in ["svg", "png", "pdf"]: + if not altair_saver: + with pytest.raises(ValueError) as err: + basic_chart.save(out, format=format) + assert "github.com/altair-viz/altair_saver" in str(err.value) + return + elif format not in altair_saver.available_formats(): + with pytest.raises(ValueError) as err: + basic_chart.save(out, format=format) + assert f"No enabled saver found that supports format='{format}'" in str( + err.value + ) + return + + basic_chart.save(out, format=format) + out.seek(0) + content = out.read() + + if format == "json": + assert "$schema" in json.loads(content) + if format == "html": + assert content.startswith("") + + fid, filename = tempfile.mkstemp(suffix="." + format) + os.close(fid) + + # test both string filenames and pathlib.Paths + for fp in [filename, pathlib.Path(filename)]: + try: + basic_chart.save(fp) + with open(fp, mode) as f: + assert f.read()[:1000] == content[:1000] + finally: + os.remove(fp) + + +def test_facet_basic(): + # wrapped facet + chart1 = ( + alt.Chart("data.csv") + .mark_point() + .encode( + x="x:Q", + y="y:Q", + ) + .facet("category:N", columns=2) + ) + + dct1 = chart1.to_dict() + + assert dct1["facet"] == alt.Facet("category:N").to_dict() + assert dct1["columns"] == 2 + assert dct1["data"] == alt.UrlData("data.csv").to_dict() + + # explicit row/col facet + chart2 = ( + alt.Chart("data.csv") + .mark_point() + .encode( + x="x:Q", + y="y:Q", + ) + .facet(row="category1:Q", column="category2:Q") + ) + + dct2 = chart2.to_dict() + + assert dct2["facet"]["row"] == alt.Facet("category1:Q").to_dict() + assert dct2["facet"]["column"] == alt.Facet("category2:Q").to_dict() + assert "columns" not in dct2 + assert dct2["data"] == alt.UrlData("data.csv").to_dict() + + +def test_facet_parse(): + chart = ( + alt.Chart("data.csv") + .mark_point() + .encode(x="x:Q", y="y:Q") + .facet(row="row:N", column="column:O") + ) + dct = chart.to_dict() + assert dct["data"] == {"url": "data.csv"} + assert "data" not in dct["spec"] + assert dct["facet"] == { + "column": {"field": "column", "type": "ordinal"}, + "row": {"field": "row", "type": "nominal"}, + } + + +def test_facet_parse_data(): + data = pd.DataFrame({"x": range(5), "y": range(5), "row": list("abcab")}) + chart = ( + alt.Chart(data) + .mark_point() + .encode(x="x", y="y:O") + .facet(row="row", column="column:O") + ) + with alt.data_transformers.enable(consolidate_datasets=False): + dct = chart.to_dict() + assert "values" in dct["data"] + assert "data" not in dct["spec"] + assert dct["facet"] == { + "column": {"field": "column", "type": "ordinal"}, + "row": {"field": "row", "type": "nominal"}, + } + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = chart.to_dict() + assert "datasets" in dct + assert "name" in dct["data"] + assert "data" not in dct["spec"] + assert dct["facet"] == { + "column": {"field": "column", "type": "ordinal"}, + "row": {"field": "row", "type": "nominal"}, + } + + +def test_selection(): + # test instantiation of selections + interval = alt.selection_interval(name="selec_1") + assert interval.selection.type == "interval" + assert interval.name == "selec_1" + + single = alt.selection_single(name="selec_2") + assert single.selection.type == "single" + assert single.name == "selec_2" + + multi = alt.selection_multi(name="selec_3") + assert multi.selection.type == "multi" + assert multi.name == "selec_3" + + # test adding to chart + chart = alt.Chart().add_selection(single) + chart = chart.add_selection(multi, interval) + assert set(chart.selection.keys()) == {"selec_1", "selec_2", "selec_3"} + + # test logical operations + assert isinstance(single & multi, alt.Selection) + assert isinstance(single | multi, alt.Selection) + assert isinstance(~single, alt.Selection) + assert isinstance((single & multi)[0].group, alt.SelectionAnd) + assert isinstance((single | multi)[0].group, alt.SelectionOr) + assert isinstance((~single)[0].group, alt.SelectionNot) + + # test that default names increment (regression for #1454) + sel1 = alt.selection_single() + sel2 = alt.selection_multi() + sel3 = alt.selection_interval() + names = {s.name for s in (sel1, sel2, sel3)} + assert len(names) == 3 + + +def test_transforms(): + # aggregate transform + agg1 = alt.AggregatedFieldDef(**{"as": "x1", "op": "mean", "field": "y"}) + agg2 = alt.AggregatedFieldDef(**{"as": "x2", "op": "median", "field": "z"}) + chart = alt.Chart().transform_aggregate([agg1], ["foo"], x2="median(z)") + kwds = dict(aggregate=[agg1, agg2], groupby=["foo"]) + assert chart.transform == [alt.AggregateTransform(**kwds)] + + # bin transform + chart = alt.Chart().transform_bin("binned", field="field", bin=True) + kwds = {"as": "binned", "field": "field", "bin": True} + assert chart.transform == [alt.BinTransform(**kwds)] + + # calcualte transform + chart = alt.Chart().transform_calculate("calc", "datum.a * 4") + kwds = {"as": "calc", "calculate": "datum.a * 4"} + assert chart.transform == [alt.CalculateTransform(**kwds)] + + # density transform + chart = alt.Chart().transform_density("x", as_=["value", "density"]) + kwds = {"as": ["value", "density"], "density": "x"} + assert chart.transform == [alt.DensityTransform(**kwds)] + + # filter transform + chart = alt.Chart().transform_filter("datum.a < 4") + assert chart.transform == [alt.FilterTransform(filter="datum.a < 4")] + + # flatten transform + chart = alt.Chart().transform_flatten(["A", "B"], ["X", "Y"]) + kwds = {"as": ["X", "Y"], "flatten": ["A", "B"]} + assert chart.transform == [alt.FlattenTransform(**kwds)] + + # fold transform + chart = alt.Chart().transform_fold(["A", "B", "C"], as_=["key", "val"]) + kwds = {"as": ["key", "val"], "fold": ["A", "B", "C"]} + assert chart.transform == [alt.FoldTransform(**kwds)] + + # impute transform + chart = alt.Chart().transform_impute("field", "key", groupby=["x"]) + kwds = {"impute": "field", "key": "key", "groupby": ["x"]} + assert chart.transform == [alt.ImputeTransform(**kwds)] + + # joinaggregate transform + chart = alt.Chart().transform_joinaggregate(min="min(x)", groupby=["key"]) + kwds = { + "joinaggregate": [ + alt.JoinAggregateFieldDef(field="x", op="min", **{"as": "min"}) + ], + "groupby": ["key"], + } + assert chart.transform == [alt.JoinAggregateTransform(**kwds)] + + # loess transform + chart = alt.Chart().transform_loess("x", "y", as_=["xx", "yy"]) + kwds = {"on": "x", "loess": "y", "as": ["xx", "yy"]} + assert chart.transform == [alt.LoessTransform(**kwds)] + + # lookup transform (data) + lookup_data = alt.LookupData(alt.UrlData("foo.csv"), "id", ["rate"]) + chart = alt.Chart().transform_lookup("a", from_=lookup_data, as_="a", default="b") + kwds = {"from": lookup_data, "as": "a", "lookup": "a", "default": "b"} + assert chart.transform == [alt.LookupTransform(**kwds)] + + # lookup transform (selection) + lookup_selection = alt.LookupSelection(key="key", selection="sel") + chart = alt.Chart().transform_lookup( + "a", from_=lookup_selection, as_="a", default="b" + ) + kwds = {"from": lookup_selection, "as": "a", "lookup": "a", "default": "b"} + assert chart.transform == [alt.LookupTransform(**kwds)] + + # pivot transform + chart = alt.Chart().transform_pivot("x", "y") + assert chart.transform == [alt.PivotTransform(pivot="x", value="y")] + + # quantile transform + chart = alt.Chart().transform_quantile("x", as_=["prob", "value"]) + kwds = {"quantile": "x", "as": ["prob", "value"]} + assert chart.transform == [alt.QuantileTransform(**kwds)] + + # regression transform + chart = alt.Chart().transform_regression("x", "y", as_=["xx", "yy"]) + kwds = {"on": "x", "regression": "y", "as": ["xx", "yy"]} + assert chart.transform == [alt.RegressionTransform(**kwds)] + + # sample transform + chart = alt.Chart().transform_sample() + assert chart.transform == [alt.SampleTransform(1000)] + + # stack transform + chart = alt.Chart().transform_stack("stacked", "x", groupby=["y"]) + assert chart.transform == [ + alt.StackTransform(stack="x", groupby=["y"], **{"as": "stacked"}) + ] + + # timeUnit transform + chart = alt.Chart().transform_timeunit("foo", field="x", timeUnit="date") + kwds = {"as": "foo", "field": "x", "timeUnit": "date"} + assert chart.transform == [alt.TimeUnitTransform(**kwds)] + + # window transform + chart = alt.Chart().transform_window(xsum="sum(x)", ymin="min(y)", frame=[None, 0]) + window = [ + alt.WindowFieldDef(**{"as": "xsum", "field": "x", "op": "sum"}), + alt.WindowFieldDef(**{"as": "ymin", "field": "y", "op": "min"}), + ] + + # kwargs don't maintain order in Python < 3.6, so window list can + # be reversed + assert chart.transform == [ + alt.WindowTransform(frame=[None, 0], window=window) + ] or chart.transform == [alt.WindowTransform(frame=[None, 0], window=window[::-1])] + + +def test_filter_transform_selection_predicates(): + selector1 = alt.selection_interval(name="s1") + selector2 = alt.selection_interval(name="s2") + base = alt.Chart("data.txt").mark_point() + + chart = base.transform_filter(selector1) + assert chart.to_dict()["transform"] == [{"filter": {"selection": "s1"}}] + + chart = base.transform_filter(~selector1) + assert chart.to_dict()["transform"] == [{"filter": {"selection": {"not": "s1"}}}] + + chart = base.transform_filter(selector1 & selector2) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"and": ["s1", "s2"]}}} + ] + + chart = base.transform_filter(selector1 | selector2) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"or": ["s1", "s2"]}}} + ] + + chart = base.transform_filter(selector1 | ~selector2) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"or": ["s1", {"not": "s2"}]}}} + ] + + chart = base.transform_filter(~selector1 | ~selector2) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"or": [{"not": "s1"}, {"not": "s2"}]}}} + ] + + chart = base.transform_filter(~(selector1 & selector2)) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"not": {"and": ["s1", "s2"]}}}} + ] + + +def test_resolve_methods(): + chart = alt.LayerChart().resolve_axis(x="shared", y="independent") + assert chart.resolve == alt.Resolve( + axis=alt.AxisResolveMap(x="shared", y="independent") + ) + + chart = alt.LayerChart().resolve_legend(color="shared", fill="independent") + assert chart.resolve == alt.Resolve( + legend=alt.LegendResolveMap(color="shared", fill="independent") + ) + + chart = alt.LayerChart().resolve_scale(x="shared", y="independent") + assert chart.resolve == alt.Resolve( + scale=alt.ScaleResolveMap(x="shared", y="independent") + ) + + +def test_layer_encodings(): + chart = alt.LayerChart().encode(x="column:Q") + assert chart.encoding.x == alt.X(shorthand="column:Q") + + +def test_add_selection(): + selections = [ + alt.selection_interval(), + alt.selection_single(), + alt.selection_multi(), + ] + chart = ( + alt.Chart() + .mark_point() + .add_selection(selections[0]) + .add_selection(selections[1], selections[2]) + ) + expected = {s.name: s.selection for s in selections} + assert chart.selection == expected + + +def test_repeat_add_selections(): + base = alt.Chart("data.csv").mark_point() + selection = alt.selection_single() + chart1 = base.add_selection(selection).repeat(list("ABC")) + chart2 = base.repeat(list("ABC")).add_selection(selection) + assert chart1.to_dict() == chart2.to_dict() + + +def test_facet_add_selections(): + base = alt.Chart("data.csv").mark_point() + selection = alt.selection_single() + chart1 = base.add_selection(selection).facet("val:Q") + chart2 = base.facet("val:Q").add_selection(selection) + assert chart1.to_dict() == chart2.to_dict() + + +def test_layer_add_selection(): + base = alt.Chart("data.csv").mark_point() + selection = alt.selection_single() + chart1 = alt.layer(base.add_selection(selection), base) + chart2 = alt.layer(base, base).add_selection(selection) + assert chart1.to_dict() == chart2.to_dict() + + +@pytest.mark.parametrize("charttype", [alt.concat, alt.hconcat, alt.vconcat]) +def test_compound_add_selections(charttype): + base = alt.Chart("data.csv").mark_point() + selection = alt.selection_single() + chart1 = charttype(base.add_selection(selection), base.add_selection(selection)) + chart2 = charttype(base, base).add_selection(selection) + assert chart1.to_dict() == chart2.to_dict() + + +def test_selection_property(): + sel = alt.selection_interval() + chart = alt.Chart("data.csv").mark_point().properties(selection=sel) + + assert list(chart["selection"].keys()) == [sel.name] + + +def test_LookupData(): + df = pd.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]}) + lookup = alt.LookupData(data=df, key="x") + + dct = lookup.to_dict() + assert dct["key"] == "x" + assert dct["data"] == { + "values": [{"x": 1, "y": 4}, {"x": 2, "y": 5}, {"x": 3, "y": 6}] + } + + +def test_themes(): + chart = alt.Chart("foo.txt").mark_point() + + with alt.themes.enable("default"): + assert chart.to_dict()["config"] == { + "view": {"continuousWidth": 400, "continuousHeight": 300} + } + + with alt.themes.enable("opaque"): + assert chart.to_dict()["config"] == { + "background": "white", + "view": {"continuousWidth": 400, "continuousHeight": 300}, + } + + with alt.themes.enable("none"): + assert "config" not in chart.to_dict() + + +def test_chart_from_dict(): + base = alt.Chart("data.csv").mark_point().encode(x="x:Q", y="y:Q") + + charts = [ + base, + base + base, + base | base, + base & base, + base.facet("c:N"), + (base + base).facet(row="c:N", data="data.csv"), + base.repeat(["c", "d"]), + (base + base).repeat(row=["c", "d"]), + ] + + for chart in charts: + chart_out = alt.Chart.from_dict(chart.to_dict()) + assert type(chart_out) is type(chart) + + # test that an invalid spec leads to a schema validation error + with pytest.raises(jsonschema.ValidationError): + alt.Chart.from_dict({"invalid": "spec"}) + + +def test_consolidate_datasets(basic_chart): + subchart1 = basic_chart + subchart2 = basic_chart.copy() + subchart2.data = basic_chart.data.copy() + chart = subchart1 | subchart2 + + with alt.data_transformers.enable(consolidate_datasets=True): + dct_consolidated = chart.to_dict() + + with alt.data_transformers.enable(consolidate_datasets=False): + dct_standard = chart.to_dict() + + assert "datasets" in dct_consolidated + assert "datasets" not in dct_standard + + datasets = dct_consolidated["datasets"] + + # two dataset copies should be recognized as duplicates + assert len(datasets) == 1 + + # make sure data matches original & names are correct + name, data = datasets.popitem() + + for spec in dct_standard["hconcat"]: + assert spec["data"]["values"] == data + + for spec in dct_consolidated["hconcat"]: + assert spec["data"] == {"name": name} + + +def test_consolidate_InlineData(): + data = alt.InlineData( + values=[{"a": 1, "b": 1}, {"a": 2, "b": 2}], format={"type": "csv"} + ) + chart = alt.Chart(data).mark_point() + + with alt.data_transformers.enable(consolidate_datasets=False): + dct = chart.to_dict() + assert dct["data"]["format"] == data.format + assert dct["data"]["values"] == data.values + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = chart.to_dict() + assert dct["data"]["format"] == data.format + assert list(dct["datasets"].values())[0] == data.values + + data = alt.InlineData(values=[], name="runtime_data") + chart = alt.Chart(data).mark_point() + + with alt.data_transformers.enable(consolidate_datasets=False): + dct = chart.to_dict() + assert dct["data"] == data.to_dict() + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = chart.to_dict() + assert dct["data"] == data.to_dict() + + +def test_repeat(): + # wrapped repeat + chart1 = ( + alt.Chart("data.csv") + .mark_point() + .encode( + x=alt.X(alt.repeat(), type="quantitative"), + y="y:Q", + ) + .repeat(["A", "B", "C", "D"], columns=2) + ) + + dct1 = chart1.to_dict() + + assert dct1["repeat"] == ["A", "B", "C", "D"] + assert dct1["columns"] == 2 + assert dct1["spec"]["encoding"]["x"]["field"] == {"repeat": "repeat"} + + # explicit row/col repeat + chart2 = ( + alt.Chart("data.csv") + .mark_point() + .encode( + x=alt.X(alt.repeat("row"), type="quantitative"), + y=alt.Y(alt.repeat("column"), type="quantitative"), + ) + .repeat(row=["A", "B", "C"], column=["C", "B", "A"]) + ) + + dct2 = chart2.to_dict() + + assert dct2["repeat"] == {"row": ["A", "B", "C"], "column": ["C", "B", "A"]} + assert "columns" not in dct2 + assert dct2["spec"]["encoding"]["x"]["field"] == {"repeat": "row"} + assert dct2["spec"]["encoding"]["y"]["field"] == {"repeat": "column"} + + +def test_data_property(): + data = pd.DataFrame({"x": [1, 2, 3], "y": list("ABC")}) + chart1 = alt.Chart(data).mark_point() + chart2 = alt.Chart().mark_point().properties(data=data) + + assert chart1.to_dict() == chart2.to_dict() + + +@pytest.mark.parametrize("method", ["layer", "hconcat", "vconcat", "concat"]) +@pytest.mark.parametrize( + "data", ["data.json", pd.DataFrame({"x": range(3), "y": list("abc")})] +) +def test_subcharts_with_same_data(method, data): + func = getattr(alt, method) + + point = alt.Chart(data).mark_point().encode(x="x:Q", y="y:Q") + line = point.mark_line() + text = point.mark_text() + + chart1 = func(point, line, text) + assert chart1.data is not alt.Undefined + assert all(c.data is alt.Undefined for c in getattr(chart1, method)) + + if method != "concat": + op = OP_DICT[method] + chart2 = op(op(point, line), text) + assert chart2.data is not alt.Undefined + assert all(c.data is alt.Undefined for c in getattr(chart2, method)) + + +@pytest.mark.parametrize("method", ["layer", "hconcat", "vconcat", "concat"]) +@pytest.mark.parametrize( + "data", ["data.json", pd.DataFrame({"x": range(3), "y": list("abc")})] +) +def test_subcharts_different_data(method, data): + func = getattr(alt, method) + + point = alt.Chart(data).mark_point().encode(x="x:Q", y="y:Q") + otherdata = alt.Chart("data.csv").mark_point().encode(x="x:Q", y="y:Q") + nodata = alt.Chart().mark_point().encode(x="x:Q", y="y:Q") + + chart1 = func(point, otherdata) + assert chart1.data is alt.Undefined + assert getattr(chart1, method)[0].data is data + + chart2 = func(point, nodata) + assert chart2.data is alt.Undefined + assert getattr(chart2, method)[0].data is data + + +def test_layer_facet(basic_chart): + chart = (basic_chart + basic_chart).facet(row="row:Q") + assert chart.data is not alt.Undefined + assert chart.spec.data is alt.Undefined + for layer in chart.spec.layer: + assert layer.data is alt.Undefined + + dct = chart.to_dict() + assert "data" in dct + + +def test_layer_errors(): + toplevel_chart = alt.Chart("data.txt").mark_point().configure_legend(columns=2) + + facet_chart1 = alt.Chart("data.txt").mark_point().encode(facet="row:Q") + + facet_chart2 = alt.Chart("data.txt").mark_point().facet("row:Q") + + repeat_chart = alt.Chart("data.txt").mark_point().repeat(["A", "B", "C"]) + + simple_chart = alt.Chart("data.txt").mark_point() + + with pytest.raises(ValueError) as err: + toplevel_chart + simple_chart + assert str(err.value).startswith( + 'Objects with "config" attribute cannot be used within LayerChart.' + ) + + with pytest.raises(ValueError) as err: + repeat_chart + simple_chart + assert str(err.value) == "Repeat charts cannot be layered." + + with pytest.raises(ValueError) as err: + facet_chart1 + simple_chart + assert str(err.value) == "Faceted charts cannot be layered." + + with pytest.raises(ValueError) as err: + alt.layer(simple_chart) + facet_chart2 + assert str(err.value) == "Faceted charts cannot be layered." + + +@pytest.mark.parametrize( + "chart_type", + ["layer", "hconcat", "vconcat", "concat", "facet", "facet_encoding", "repeat"], +) +def test_resolve(chart_type): + chart = _make_chart_type(chart_type) + chart = ( + chart.resolve_scale( + x="independent", + ) + .resolve_legend(color="independent") + .resolve_axis(y="independent") + ) + dct = chart.to_dict() + assert dct["resolve"] == { + "scale": {"x": "independent"}, + "legend": {"color": "independent"}, + "axis": {"y": "independent"}, + } + + +# TODO: test vconcat, hconcat, concat, facet_encoding when schema allows them. +# This is blocked by https://github.com/vega/vega-lite/issues/5261 +@pytest.mark.parametrize("chart_type", ["chart", "layer"]) +@pytest.mark.parametrize("facet_arg", [None, "facet", "row", "column"]) +def test_facet(chart_type, facet_arg): + chart = _make_chart_type(chart_type) + if facet_arg is None: + chart = chart.facet("color:N", columns=2) + else: + chart = chart.facet(**{facet_arg: "color:N", "columns": 2}) + dct = chart.to_dict() + + assert "spec" in dct + assert dct["columns"] == 2 + expected = {"field": "color", "type": "nominal"} + if facet_arg is None or facet_arg == "facet": + assert dct["facet"] == expected + else: + assert dct["facet"][facet_arg] == expected + + +def test_sequence(): + data = alt.sequence(100) + assert data.to_dict() == {"sequence": {"start": 0, "stop": 100}} + + data = alt.sequence(5, 10) + assert data.to_dict() == {"sequence": {"start": 5, "stop": 10}} + + data = alt.sequence(0, 1, 0.1, as_="x") + assert data.to_dict() == { + "sequence": {"start": 0, "stop": 1, "step": 0.1, "as": "x"} + } + + +def test_graticule(): + data = alt.graticule() + assert data.to_dict() == {"graticule": True} + + data = alt.graticule(step=[15, 15]) + assert data.to_dict() == {"graticule": {"step": [15, 15]}} + + +def test_sphere(): + data = alt.sphere() + assert data.to_dict() == {"sphere": True} + + +def test_validate_dataset(): + d = {"data": {"values": [{}]}, "mark": {"type": "point"}} + + chart = alt.Chart.from_dict(d) + jsn = chart.to_json() + + assert jsn diff --git a/altair/vegalite/v5/tests/test_data.py b/altair/vegalite/v5/tests/test_data.py new file mode 100644 index 000000000..8eae11c86 --- /dev/null +++ b/altair/vegalite/v5/tests/test_data.py @@ -0,0 +1,33 @@ +import os + +import pandas as pd +import pytest + +from .. import data as alt + + +@pytest.fixture +def sample_data(): + return pd.DataFrame({"x": range(10), "y": range(10)}) + + +def test_disable_max_rows(sample_data): + with alt.data_transformers.enable("default", max_rows=5): + # Ensure max rows error is raised. + with pytest.raises(alt.MaxRowsError): + alt.data_transformers.get()(sample_data) + + # Ensure that max rows error is properly disabled. + with alt.data_transformers.disable_max_rows(): + alt.data_transformers.get()(sample_data) + + try: + with alt.data_transformers.enable("json"): + # Ensure that there is no TypeError for non-max_rows transformers. + with alt.data_transformers.disable_max_rows(): + jsonfile = alt.data_transformers.get()(sample_data) + except TypeError: + jsonfile = {} + finally: + if jsonfile: + os.remove(jsonfile["url"]) diff --git a/altair/vegalite/v5/tests/test_display.py b/altair/vegalite/v5/tests/test_display.py new file mode 100644 index 000000000..e7ccc27ff --- /dev/null +++ b/altair/vegalite/v5/tests/test_display.py @@ -0,0 +1,69 @@ +from contextlib import contextmanager + +import pytest + +import altair.vegalite.v4 as alt + + +@contextmanager +def check_render_options(**options): + """ + Context manager that will assert that alt.renderers.options are equivalent + to the given options in the IPython.display.display call + """ + import IPython.display + + def check_options(obj): + assert alt.renderers.options == options + + _display = IPython.display.display + IPython.display.display = check_options + try: + yield + finally: + IPython.display.display = _display + + +def test_check_renderer_options(): + # this test should pass + with check_render_options(): + from IPython.display import display + + display(None) + + # check that an error is appropriately raised if the test fails + with pytest.raises(AssertionError): + with check_render_options(foo="bar"): + from IPython.display import display + + display(None) + + +def test_display_options(): + chart = alt.Chart("data.csv").mark_point().encode(x="foo:Q") + + # check that there are no options by default + with check_render_options(): + chart.display() + + # check that display options are passed + with check_render_options(embed_options={"tooltip": False, "renderer": "canvas"}): + chart.display("canvas", tooltip=False) + + # check that above options do not persist + with check_render_options(): + chart.display() + + # check that display options augment rather than overwrite pre-set options + with alt.renderers.enable(embed_options={"tooltip": True, "renderer": "svg"}): + with check_render_options(embed_options={"tooltip": True, "renderer": "svg"}): + chart.display() + + with check_render_options( + embed_options={"tooltip": True, "renderer": "canvas"} + ): + chart.display("canvas") + + # check that above options do not persist + with check_render_options(): + chart.display() diff --git a/altair/vegalite/v5/tests/test_geo_interface.py b/altair/vegalite/v5/tests/test_geo_interface.py new file mode 100644 index 000000000..b637b28fc --- /dev/null +++ b/altair/vegalite/v5/tests/test_geo_interface.py @@ -0,0 +1,204 @@ +import pytest +import altair.vegalite.v4 as alt + + +def geom_obj(geom): + class Geom(object): + pass + + geom_obj = Geom() + setattr(geom_obj, "__geo_interface__", geom) + return geom_obj + + +# correct translation of Polygon geometry to Feature type +def test_geo_interface_polygon_feature(): + geom = { + "coordinates": [[(0, 0), (0, 2), (2, 2), (2, 0), (0, 0)]], + "type": "Polygon", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["type"] == "Feature" + + +# merge geometry with empty properties dictionary +def test_geo_interface_removal_empty_properties(): + geom = { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": None, + "properties": {}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["type"] == "Feature" + + +# only register metadata in the properties member +def test_geo_interface_register_foreign_member(): + geom = { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 2, + "properties": {"foo": "bah"}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + with pytest.raises(KeyError): + spec["data"]["values"]["id"] + assert spec["data"]["values"]["foo"] == "bah" + + +# correct serializing of arrays and nested tuples +def test_geo_interface_serializing_arrays_tuples(): + import array as arr + + geom = { + "bbox": arr.array("d", [1, 2, 3, 4]), + "geometry": { + "coordinates": [ + tuple( + ( + tuple((6.90, 53.48)), + tuple((5.98, 51.85)), + tuple((6.07, 53.51)), + tuple((6.90, 53.48)), + ) + ) + ], + "type": "Polygon", + }, + "id": 27, + "properties": {}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["geometry"]["coordinates"][0][0] == [6.9, 53.48] + + +# overwrite existing 'type' value in properties with `Feature` +def test_geo_interface_reserved_members(): + geom = { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 27, + "properties": {"type": "foo"}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["type"] == "Feature" + + +# an empty FeatureCollection is valid +def test_geo_interface_empty_feature_collection(): + geom = {"type": "FeatureCollection", "features": []} + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"] == [] + + +# Features in a FeatureCollection only keep properties and geometry +def test_geo_interface_feature_collection(): + geom = { + "type": "FeatureCollection", + "features": [ + { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 27, + "properties": {"type": "foo", "id": 1, "geometry": 1}, + "type": "Feature", + }, + { + "geometry": { + "coordinates": [ + [[8.90, 53.48], [7.98, 51.85], [8.07, 53.51], [8.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 28, + "properties": {"type": "foo", "id": 2, "geometry": 1}, + "type": "Feature", + }, + ], + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"][0]["id"] == 1 + assert spec["data"]["values"][1]["id"] == 2 + assert "coordinates" in spec["data"]["values"][0]["geometry"] + assert "coordinates" in spec["data"]["values"][1]["geometry"] + assert spec["data"]["values"][0]["type"] == "Feature" + assert spec["data"]["values"][1]["type"] == "Feature" + + +# typical output of a __geo_interface__ from geopandas GeoDataFrame +# notic that the index value is registerd as a commonly used identifier +# with the name "id" (in this case 49). Similar to serialization of a +# pandas DataFrame is the index not included in the output +def test_geo_interface_feature_collection_gdf(): + geom = { + "bbox": (19.89, -26.82, 29.43, -17.66), + "features": [ + { + "bbox": (19.89, -26.82, 29.43, -17.66), + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": "49", + "properties": { + "continent": "Africa", + "gdp_md_est": 35900.0, + "id": "BWA", + "iso_a3": "BWA", + "name": "Botswana", + "pop_est": 2214858, + }, + "type": "Feature", + } + ], + "type": "FeatureCollection", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"][0]["id"] == "BWA" diff --git a/altair/vegalite/v5/tests/test_renderers.py b/altair/vegalite/v5/tests/test_renderers.py new file mode 100644 index 000000000..55c5e4ffb --- /dev/null +++ b/altair/vegalite/v5/tests/test_renderers.py @@ -0,0 +1,65 @@ +"""Tests of various renderers""" + +import json + +import pytest + +import altair.vegalite.v4 as alt + + +@pytest.fixture +def chart(): + return alt.Chart("data.csv").mark_point() + + +def test_html_renderer_embed_options(chart, renderer="html"): + """Test that embed_options in renderer metadata are correctly manifest in html""" + # Short of parsing the javascript, it's difficult to parse out the + # actions. So we use string matching + + def assert_has_options(chart, **opts): + html = chart._repr_mimebundle_(None, None)["text/html"] + for key, val in opts.items(): + assert json.dumps({key: val})[1:-1] in html + + with alt.renderers.enable(renderer): + assert_has_options(chart, mode="vega-lite") + + with alt.renderers.enable(embed_options=dict(actions={"export": True})): + assert_has_options(chart, mode="vega-lite", actions={"export": True}) + + with alt.renderers.set_embed_options(actions=True): + assert_has_options(chart, mode="vega-lite", actions=True) + + +def test_mimetype_renderer_embed_options(chart, renderer="mimetype"): + # check that metadata is passed appropriately + mimetype = alt.display.VEGALITE_MIME_TYPE + spec = chart.to_dict() + with alt.renderers.enable(renderer): + # Sanity check: no metadata specified + bundle, metadata = chart._repr_mimebundle_(None, None) + assert bundle[mimetype] == spec + assert metadata == {} + with alt.renderers.set_embed_options(actions=False): + bundle, metadata = chart._repr_mimebundle_(None, None) + assert set(bundle.keys()) == {mimetype, "text/plain"} + assert bundle[mimetype] == spec + assert metadata == {mimetype: {"embed_options": {"actions": False}}} + + +def test_json_renderer_embed_options(chart, renderer="json"): + """Test that embed_options in renderer metadata are correctly manifest in html""" + mimetype = "application/json" + spec = chart.to_dict() + with alt.renderers.enable(renderer): + # Sanity check: no options specified + bundle, metadata = chart._repr_mimebundle_(None, None) + assert bundle[mimetype] == spec + assert metadata == {} + + with alt.renderers.enable(option="foo"): + bundle, metadata = chart._repr_mimebundle_(None, None) + assert set(bundle.keys()) == {mimetype, "text/plain"} + assert bundle[mimetype] == spec + assert metadata == {mimetype: {"option": "foo"}} diff --git a/altair/vegalite/v5/tests/test_theme.py b/altair/vegalite/v5/tests/test_theme.py new file mode 100644 index 000000000..d159d2fa7 --- /dev/null +++ b/altair/vegalite/v5/tests/test_theme.py @@ -0,0 +1,19 @@ +import pytest + +import altair.vegalite.v4 as alt +from altair.vegalite.v4.theme import VEGA_THEMES + + +@pytest.fixture +def chart(): + return alt.Chart("data.csv").mark_bar().encode(x="x:Q") + + +def test_vega_themes(chart): + for theme in VEGA_THEMES: + with alt.themes.enable(theme): + dct = chart.to_dict() + assert dct["usermeta"] == {"embedOptions": {"theme": theme}} + assert dct["config"] == { + "view": {"continuousWidth": 400, "continuousHeight": 300} + } diff --git a/altair/vegalite/v5/theme.py b/altair/vegalite/v5/theme.py new file mode 100644 index 000000000..b1db45778 --- /dev/null +++ b/altair/vegalite/v5/theme.py @@ -0,0 +1,56 @@ +"""Tools for enabling and registering chart themes""" + +from ...utils.theme import ThemeRegistry + +VEGA_THEMES = [ + "ggplot2", + "quartz", + "vox", + "fivethirtyeight", + "dark", + "latimes", + "urbaninstitute", +] + + +class VegaTheme(object): + """Implementation of a builtin vega theme.""" + + def __init__(self, theme): + self.theme = theme + + def __call__(self): + return { + "usermeta": {"embedOptions": {"theme": self.theme}}, + "config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}, + } + + def __repr__(self): + return "VegaTheme({!r})".format(self.theme) + + +# 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 PluginRegistery API. +ENTRY_POINT_GROUP = "altair.vegalite.v4.theme" # type: str +themes = ThemeRegistry(entry_point_group=ENTRY_POINT_GROUP) + +themes.register( + "default", + lambda: {"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}}, +) +themes.register( + "opaque", + lambda: { + "config": { + "background": "white", + "view": {"continuousWidth": 400, "continuousHeight": 300}, + } + }, +) +themes.register("none", lambda: {}) + +for theme in VEGA_THEMES: + themes.register(theme, VegaTheme(theme)) + +themes.enable("default") diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 843f8aad5..2520df997 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -27,8 +27,7 @@ # Map of version name to github branch name. SCHEMA_VERSION = { "vega": {"v5": "v5.10.0"}, - "vega-lite": {"v3": "v3.4.0", "v4": "v4.17.0"} - # "vega-lite": {"v3": "v3.4.0", "v4": "v4.8.1"}, + "vega-lite": {"v3": "v3.4.0", "v4": "v4.17.0", "v5": "v5.2.0"}, } reLink = re.compile(r"(?<=\[)([^\]]+)(?=\]\([^\)]+\))", re.M) From 65399d37a79f9d23bfaf39c286f2c478392c0061 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 27 Nov 2021 05:08:22 -0800 Subject: [PATCH 02/24] Initial VariableParameter definitions --- altair/vegalite/v5/api.py | 163 +++++++++++++++++++++++++++++++++++--- 1 file changed, 153 insertions(+), 10 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 84162e114..7fcfc10ac 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -151,6 +151,65 @@ def _get_channels_mapping(): mapping[cls] = attr.replace("Value", "").lower() return mapping +# ------------------------------------------------------------------------- +# Tools for working with parameters +class Parameter(object): + """A Parameter object""" + + _counter = 0 + + @classmethod + def _get_name(cls): + cls._counter += 1 + return "parameter{:03d}".format(cls._counter) + + def __init__(self, name): + if name is None: + name = self._get_name() + self.name = name + + def to_dict(self): + if self.param_type == "variable": + return { + "expr": self.name.to_dict() + if hasattr(self.name, "to_dict") + else self.name + } + + def __repr__(self): + return "Parameter({0!r}, {1})".format(self.name, self.param) + + +def parameter(name=None, **kwds): + """Create a named parameter. + + Parameters + ---------- + name : string (optional) + The name of the parameter. If not specified, a unique name will be + created. + **kwds : + additional keywords will be used to construct a parameter. If 'select' + is among the keywords, then a SelectionParameter will be created. + Otherwise, a VariableParameter will be created. + + Returns + ------- + parameter: Parameter + The parameter object that can be used in chart creation. + """ + + parameter = Parameter(name) + + if "select" in kwds: + parameter.param_type = "selection" + pass + else: + parameter.param = core.VariableParameter(name=parameter.name, **kwds) + parameter.param_type = "variable" + + return parameter + # ------------------------------------------------------------------------- # Tools for working with selections @@ -215,7 +274,7 @@ def value(value, **kwargs): """Specify a value for use in an encoding""" return dict(value=value, **kwargs) - +#TODO: Update the docstring def selection(name=None, type=Undefined, **kwds): """Create a named selection. @@ -238,19 +297,19 @@ def selection(name=None, type=Undefined, **kwds): return Selection(name, core.SelectionDef(type=type, **kwds)) -@utils.use_signature(core.IntervalSelection) +@utils.use_signature(core.IntervalSelectionConfig) def selection_interval(**kwargs): """Create a selection with type='interval'""" return selection(type="interval", **kwargs) -@utils.use_signature(core.MultiSelection) +@utils.use_signature(core.PointSelectionConfig) def selection_multi(**kwargs): """Create a selection with type='multi'""" return selection(type="multi", **kwargs) -@utils.use_signature(core.SingleSelection) +@utils.use_signature(core.PointSelectionConfig) def selection_single(**kwargs): """Create a selection with type='single'""" return selection(type="single", **kwargs) @@ -2019,6 +2078,18 @@ def to_dict(self, *args, **kwargs): return super(Chart, copy).to_dict(*args, **kwargs) return super().to_dict(*args, **kwargs) + def add_parameter(self, *params): + """Add one or more parameters to the chart.""" + if not params: + return self + copy = self.copy(deep=["params"]) + if copy.params is Undefined: + copy.params = [] + + for s in params: + copy.params.append(s.param) + return copy + def add_selection(self, *selections): """Add one or more selections to the chart.""" if not selections: @@ -2193,6 +2264,18 @@ def interactive(self, name=None, bind_x=True, bind_y=True): copy.spec = copy.spec.interactive(name=name, bind_x=bind_x, bind_y=bind_y) return copy + def add_parameter(self, *params): + """Add one or more parameters to the chart.""" + if not params: + return self + copy = self.copy(deep=["params"]) + if copy.params is Undefined: + copy.params = [] + + for s in params: + copy.params.append(s.param) + return copy + def add_selection(self, *selections): """Add one or more selections to the chart.""" if not selections or self.spec is Undefined: @@ -2222,8 +2305,8 @@ def repeat(repeater="repeat"): return core.RepeatRef(repeat=repeater) -@utils.use_signature(core.TopLevelNormalizedConcatSpecGenericSpec) -class ConcatChart(TopLevelMixin, core.TopLevelNormalizedConcatSpecGenericSpec): +@utils.use_signature(core.TopLevelConcatSpec) +class ConcatChart(TopLevelMixin, core.TopLevelConcatSpec): """A chart with horizontally-concatenated facets""" def __init__(self, data=Undefined, concat=(), columns=Undefined, **kwargs): @@ -2246,6 +2329,18 @@ def __or__(self, other): copy |= other return copy + def add_parameter(self, *params): + """Add one or more parameters to the chart.""" + if not params: + return self + copy = self.copy(deep=["params"]) + if copy.params is Undefined: + copy.params = [] + + for s in params: + copy.params.append(s.param) + return copy + def add_selection(self, *selections): """Add one or more selections to all subcharts.""" if not selections or not self.concat: @@ -2260,8 +2355,8 @@ def concat(*charts, **kwargs): return ConcatChart(concat=charts, **kwargs) -@utils.use_signature(core.TopLevelNormalizedHConcatSpecGenericSpec) -class HConcatChart(TopLevelMixin, core.TopLevelNormalizedHConcatSpecGenericSpec): +@utils.use_signature(core.TopLevelHConcatSpec) +class HConcatChart(TopLevelMixin, core.TopLevelHConcatSpec): """A chart with horizontally-concatenated facets""" def __init__(self, data=Undefined, hconcat=(), **kwargs): @@ -2282,6 +2377,18 @@ def __or__(self, other): copy |= other return copy + def add_parameter(self, *params): + """Add one or more parameters to the chart.""" + if not params: + return self + copy = self.copy(deep=["params"]) + if copy.params is Undefined: + copy.params = [] + + for s in params: + copy.params.append(s.param) + return copy + def add_selection(self, *selections): """Add one or more selections to all subcharts.""" if not selections or not self.hconcat: @@ -2296,8 +2403,8 @@ def hconcat(*charts, **kwargs): return HConcatChart(hconcat=charts, **kwargs) -@utils.use_signature(core.TopLevelNormalizedVConcatSpecGenericSpec) -class VConcatChart(TopLevelMixin, core.TopLevelNormalizedVConcatSpecGenericSpec): +@utils.use_signature(core.TopLevelVConcatSpec) +class VConcatChart(TopLevelMixin, core.TopLevelVConcatSpec): """A chart with vertically-concatenated facets""" def __init__(self, data=Undefined, vconcat=(), **kwargs): @@ -2318,6 +2425,18 @@ def __and__(self, other): copy &= other return copy + def add_parameter(self, *params): + """Add one or more parameters to the chart.""" + if not params: + return self + copy = self.copy(deep=["params"]) + if copy.params is Undefined: + copy.params = [] + + for s in params: + copy.params.append(s.param) + return copy + def add_selection(self, *selections): """Add one or more selections to all subcharts.""" if not selections or not self.vconcat: @@ -2392,6 +2511,18 @@ def interactive(self, name=None, bind_x=True, bind_y=True): ) return copy + def add_parameter(self, *params): + """Add one or more parameters to the chart.""" + if not params: + return self + copy = self.copy(deep=["params"]) + if copy.params is Undefined: + copy.params = [] + + for s in params: + copy.params.append(s.param) + return copy + def add_selection(self, *selections): """Add one or more selections to all subcharts.""" if not selections or not self.layer: @@ -2437,6 +2568,18 @@ def interactive(self, name=None, bind_x=True, bind_y=True): copy.spec = copy.spec.interactive(name=name, bind_x=bind_x, bind_y=bind_y) return copy + def add_parameter(self, *params): + """Add one or more parameters to the chart.""" + if not params: + return self + copy = self.copy(deep=["params"]) + if copy.params is Undefined: + copy.params = [] + + for s in params: + copy.params.append(s.param) + return copy + def add_selection(self, *selections): """Add one or more selections to the chart.""" if not selections or self.spec is Undefined: From 50c473235f6966480a2ac6007a3a79919d38717a Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 27 Nov 2021 12:45:41 -0800 Subject: [PATCH 03/24] Updates to parameter definitions --- altair/expr/core.py | 117 +++++++++++++------- altair/vegalite/v5/api.py | 224 ++++++++++++++++++++++---------------- 2 files changed, 205 insertions(+), 136 deletions(-) diff --git a/altair/expr/core.py b/altair/expr/core.py index 264c5a195..310a5ce9f 100644 --- a/altair/expr/core.py +++ b/altair/expr/core.py @@ -31,114 +31,151 @@ def _js_repr(val): return "false" elif val is None: return "null" + elif isinstance(val, OperatorMixin): + return val._to_expr() else: return repr(val) -class Expression(SchemaBase): - """Expression - - Base object for enabling build-up of Javascript expressions using - a Python syntax. Calling ``repr(obj)`` will return a Javascript - representation of the object and the operations it encodes. - """ - - _schema = {"type": "string"} - - def to_dict(self, *args, **kwargs): +# Designed to work with Expression and VariableParameter +class OperatorMixin(object): + def _to_expr(self): return repr(self) - def __setattr__(self, attr, val): - # We don't need the setattr magic defined in SchemaBase - return object.__setattr__(self, attr, val) + def _from_expr(self, expr): + return expr def __add__(self, other): - return BinaryExpression("+", self, other) + comp_value = BinaryExpression("+", self, other) + return self._from_expr(comp_value) def __radd__(self, other): - return BinaryExpression("+", other, self) + comp_value = BinaryExpression("+", other, self) + return self._from_expr(comp_value) def __sub__(self, other): - return BinaryExpression("-", self, other) + comp_value = BinaryExpression("-", self, other) + return self._from_expr(comp_value) def __rsub__(self, other): - return BinaryExpression("-", other, self) + comp_value = BinaryExpression("-", other, self) + return self._from_expr(comp_value) def __mul__(self, other): - return BinaryExpression("*", self, other) + comp_value = BinaryExpression("*", self, other) + return self._from_expr(comp_value) def __rmul__(self, other): - return BinaryExpression("*", other, self) + comp_value = BinaryExpression("*", other, self) + return self._from_expr(comp_value) def __truediv__(self, other): - return BinaryExpression("/", self, other) + comp_value = BinaryExpression("/", self, other) + return self._from_expr(comp_value) def __rtruediv__(self, other): - return BinaryExpression("/", other, self) + comp_value = BinaryExpression("/", other, self) + return self._from_expr(comp_value) __div__ = __truediv__ __rdiv__ = __rtruediv__ def __mod__(self, other): - return BinaryExpression("%", self, other) + comp_value = BinaryExpression("%", self, other) + return self._from_expr(comp_value) def __rmod__(self, other): - return BinaryExpression("%", other, self) + comp_value = BinaryExpression("%", other, self) + return self._from_expr(comp_value) def __pow__(self, other): # "**" Javascript operator is not supported in all browsers - return FunctionExpression("pow", (self, other)) + comp_value = FunctionExpression("pow", (self, other)) + return self._from_expr(comp_value) def __rpow__(self, other): # "**" Javascript operator is not supported in all browsers - return FunctionExpression("pow", (other, self)) + comp_value = FunctionExpression("pow", (other, self)) + return self._from_expr(comp_value) def __neg__(self): - return UnaryExpression("-", self) + comp_value = UnaryExpression("-", self) + return self._from_expr(comp_value) def __pos__(self): - return UnaryExpression("+", self) + comp_value = UnaryExpression("+", self) + return self._from_expr(comp_value) # comparison operators def __eq__(self, other): - return BinaryExpression("===", self, other) + comp_value = BinaryExpression("===", self, other) + return self._from_expr(comp_value) def __ne__(self, other): - return BinaryExpression("!==", self, other) + comp_value = BinaryExpression("!==", self, other) + return self._from_expr(comp_value) def __gt__(self, other): - return BinaryExpression(">", self, other) + comp_value = BinaryExpression(">", self, other) + return self._from_expr(comp_value) def __lt__(self, other): - return BinaryExpression("<", self, other) + comp_value = BinaryExpression("<", self, other) + return self._from_expr(comp_value) def __ge__(self, other): - return BinaryExpression(">=", self, other) + comp_value = BinaryExpression(">=", self, other) + return self._from_expr(comp_value) def __le__(self, other): - return BinaryExpression("<=", self, other) + comp_value = BinaryExpression("<=", self, other) + return self._from_expr(comp_value) def __abs__(self): - return FunctionExpression("abs", (self,)) + comp_value = FunctionExpression("abs", (self,)) + return self._from_expr(comp_value) # logical operators def __and__(self, other): - return BinaryExpression("&&", self, other) + comp_value = BinaryExpression("&&", self, other) + return self._from_expr(comp_value) def __rand__(self, other): - return BinaryExpression("&&", other, self) + comp_value = BinaryExpression("&&", other, self) + return self._from_expr(comp_value) def __or__(self, other): - return BinaryExpression("||", self, other) + comp_value = BinaryExpression("||", self, other) + return self._from_expr(comp_value) def __ror__(self, other): - return BinaryExpression("||", other, self) + comp_value = BinaryExpression("||", other, self) + return self._from_expr(comp_value) def __invert__(self): - return UnaryExpression("!", self) + comp_value = UnaryExpression("!", self) + return self._from_expr(comp_value) + + +class Expression(OperatorMixin, SchemaBase): + """Expression + + Base object for enabling build-up of Javascript expressions using + a Python syntax. Calling ``repr(obj)`` will return a Javascript + representation of the object and the operations it encodes. + """ + + _schema = {"type": "string"} + + def to_dict(self, *args, **kwargs): + return repr(self) + + def __setattr__(self, attr, val): + # We don't need the setattr magic defined in SchemaBase + return object.__setattr__(self, attr, val) # item access def __getitem__(self, val): diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 7fcfc10ac..94ea91a0f 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -151,9 +151,10 @@ def _get_channels_mapping(): mapping[cls] = attr.replace("Value", "").lower() return mapping + # ------------------------------------------------------------------------- # Tools for working with parameters -class Parameter(object): +class Parameter(expr.core.OperatorMixin, object): """A Parameter object""" _counter = 0 @@ -170,8 +171,13 @@ def __init__(self, name): def to_dict(self): if self.param_type == "variable": + if self.param.expr is Undefined: + return {"expr": self.name} + else: + return {"expr": repr(self.param.expr)} + elif self.param_type == "selection": return { - "expr": self.name.to_dict() + "param": self.name.to_dict() if hasattr(self.name, "to_dict") else self.name } @@ -179,8 +185,61 @@ def to_dict(self): def __repr__(self): return "Parameter({0!r}, {1})".format(self.name, self.param) + def _to_expr(self): + if self.param.expr is Undefined: + return self.name + else: + return self.param.expr + + def _from_expr(self, expr): + return parameter(expr=expr) + + def __getattr__(self, field_name): + if field_name.startswith("__") and field_name.endswith("__"): + raise AttributeError(field_name) + _attrexpr = expr.core.GetAttrExpression(self.name, field_name) + # If self is a SelectionParameter and field_name is in its + # fields or encodings list, then we want to return an expression. + if check_fields_and_encodings(self, field_name): + return SelectionExpression(_attrexpr) + return expr.core.GetAttrExpression(self.name, field_name) + + +class SelectionExpression(expr.core.OperatorMixin, object): + def __init__(self, expr): + self.expr = expr -def parameter(name=None, **kwds): + def to_dict(self): + return {"expr": repr(self.expr)} + + def _to_expr(self): + return repr(self.expr) + + def _from_expr(self, expr): + return SelectionExpression(expr=expr) + + +def check_fields_and_encodings(parameter, field_name): + for prop in ["fields", "encodings"]: + try: + if field_name in getattr(parameter.param.select, prop): + return True + except (AttributeError, TypeError): + pass + + return False + + +# ------------------------------------------------------------------------ +# Top-Level Functions + + +def value(value, **kwargs): + """Specify a value for use in an encoding""" + return dict(value=value, **kwargs) + + +def parameter(name=None, select=None, **kwds): """Create a named parameter. Parameters @@ -201,118 +260,87 @@ def parameter(name=None, **kwds): parameter = Parameter(name) - if "select" in kwds: - parameter.param_type = "selection" - pass - else: + if select is None: parameter.param = core.VariableParameter(name=parameter.name, **kwds) parameter.param_type = "variable" - - return parameter - - -# ------------------------------------------------------------------------- -# Tools for working with selections -class Selection(object): - """A Selection object""" - - _counter = 0 - - @classmethod - def _get_name(cls): - cls._counter += 1 - return "selector{:03d}".format(cls._counter) - - def __init__(self, name, selection): - if name is None: - name = self._get_name() - self.name = name - self.selection = selection - - def __repr__(self): - return "Selection({0!r}, {1})".format(self.name, self.selection) - - def ref(self): - return self.to_dict() - - def to_dict(self): - return { - "selection": self.name.to_dict() - if hasattr(self.name, "to_dict") - else self.name - } - - def __invert__(self): - return Selection(core.SelectionNot(**{"not": self.name}), self.selection) - - def __and__(self, other): - if isinstance(other, Selection): - other = other.name - return Selection( - core.SelectionAnd(**{"and": [self.name, other]}), self.selection + else: + parameter.param = core.SelectionParameter( + name=parameter.name, select=select, **kwds ) + parameter.param_type = "selection" - def __or__(self, other): - if isinstance(other, Selection): - other = other.name - return Selection(core.SelectionOr(**{"or": [self.name, other]}), self.selection) - - def __getattr__(self, field_name): - if field_name.startswith("__") and field_name.endswith("__"): - raise AttributeError(field_name) - return expr.core.GetAttrExpression(self.name, field_name) - - def __getitem__(self, field_name): - return expr.core.GetItemExpression(self.name, field_name) - + return parameter -# ------------------------------------------------------------------------ -# Top-Level Functions - -def value(value, **kwargs): - """Specify a value for use in an encoding""" - return dict(value=value, **kwargs) - -#TODO: Update the docstring -def selection(name=None, type=Undefined, **kwds): - """Create a named selection. +# TODO: Update the docstring +def selection(type=Undefined, **kwds): + """Create a selection. Parameters ---------- - name : string (optional) - The name of the selection. If not specified, a unique name will be - created. type : string - The type of the selection: one of ["interval", "single", or "multi"] + The type of the selection: either "interval" or "point"] **kwds : - additional keywords will be used to construct a SelectionDef instance - that controls the selection. + additional keywords to control the selection. Returns ------- - selection: Selection - The selection object that can be used in chart creation. + Parameter + The Parameter object that can be used in chart creation. """ - return Selection(name, core.SelectionDef(type=type, **kwds)) + + # We separate out the parameter keywords from the selection keywords + param_kwds = {} + + for kwd in {"name", "value", "bind"}: + if kwd in kwds: + param_kwds[kwd] = kwds.pop(kwd) + + if type == "interval": + select = core.IntervalSelectionConfig(type=type, **kwds) + elif type == "point": + select = core.PointSelectionConfig(type=type, **kwds) + elif type in ["single", "multi"]: + select = core.PointSelectionConfig(type="point", **kwds) + warnings.warn( + """The types 'single' and 'multi' are now + combined and should be specified using "type='point'".""", + DeprecationWarning, + ) + else: + raise ValueError("""'type' must be 'point' or 'interval'""") + + return parameter(select=select, **param_kwds) @utils.use_signature(core.IntervalSelectionConfig) def selection_interval(**kwargs): - """Create a selection with type='interval'""" + """Create a selection parameter with type='interval'""" return selection(type="interval", **kwargs) +@utils.use_signature(core.PointSelectionConfig) +def selection_point(**kwargs): + """Create a selection with type='point'""" + return selection(type="point", **kwargs) + + @utils.use_signature(core.PointSelectionConfig) def selection_multi(**kwargs): - """Create a selection with type='multi'""" - return selection(type="multi", **kwargs) + warnings.warn( + """'selection_multi' is deprecated. Use 'selection_point'""", + DeprecationWarning, + ) + return selection(type="point", **kwargs) @utils.use_signature(core.PointSelectionConfig) def selection_single(**kwargs): - """Create a selection with type='single'""" - return selection(type="single", **kwargs) + warnings.warn( + """'selection_single' is deprecated. Use 'selection_point'""", + DeprecationWarning, + ) + return selection(type="point", **kwargs) @utils.use_signature(core.Binding) @@ -345,6 +373,7 @@ def binding_range(**kwargs): return core.BindRange(input="range", **kwargs) +# TODO: update the docstring def condition(predicate, if_true, if_false, **kwargs): """A conditional attribute or encoding @@ -367,10 +396,13 @@ def condition(predicate, if_true, if_false, **kwargs): """ test_predicates = (str, expr.Expression, core.PredicateComposition) - if isinstance(predicate, Selection): - condition = {"selection": predicate.name} - elif isinstance(predicate, core.SelectionComposition): - condition = {"selection": predicate} + if isinstance(predicate, Parameter): + if predicate.param_type == "selection" or predicate.param.expr is Undefined: + condition = {"param": predicate.name} + if "empty" in kwargs: + condition["empty"] = kwargs.pop("empty") + else: + condition = {"test": predicate.param.expr} elif isinstance(predicate, test_predicates): condition = {"test": predicate} elif isinstance(predicate, dict): @@ -638,7 +670,8 @@ def properties(self, **kwargs): """ copy = self.copy(deep=False) for key, val in kwargs.items(): - if key == "selection" and isinstance(val, Selection): + if key == "selection" and isinstance(val, Parameter): + # TODO: Can this be removed # For backward compatibility with old selection interface. setattr(copy, key, {val.name: val.selection}) else: @@ -1161,6 +1194,7 @@ def transform_joinaggregate( core.JoinAggregateTransform(joinaggregate=joinaggregate, groupby=groupby) ) + # TODO: Update docstring def transform_filter(self, filter, **kwargs): """ Add a FilterTransform to the schema. @@ -1185,10 +1219,8 @@ def transform_filter(self, filter, **kwargs): alt.FilterTransform : underlying transform object """ - if isinstance(filter, Selection): - filter = {"selection": filter.name} - elif isinstance(filter, core.SelectionComposition): - filter = {"selection": filter} + if isinstance(filter, Parameter): + filter = {"param": filter.name} return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) def transform_flatten(self, flatten, as_=Undefined): From c2a58b2f5ef211fd09d68e19c96582237387fddc Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 27 Nov 2021 13:15:20 -0800 Subject: [PATCH 04/24] Move height/width/view from layer to parent --- altair/vegalite/v5/api.py | 62 ++++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 94ea91a0f..bfae42d30 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -1221,6 +1221,8 @@ def transform_filter(self, filter, **kwargs): """ if isinstance(filter, Parameter): filter = {"param": filter.name} + if "empty" in kwargs: + filter["empty"] = kwargs.pop("empty") return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) def transform_flatten(self, flatten, as_=Undefined): @@ -2122,17 +2124,12 @@ def add_parameter(self, *params): copy.params.append(s.param) return copy - def add_selection(self, *selections): - """Add one or more selections to the chart.""" - if not selections: - return self - copy = self.copy(deep=["selection"]) - if copy.selection is Undefined: - copy.selection = {} - - for s in selections: - copy.selection[s.name] = s.selection - return copy + def add_selection(self, *params): + warnings.warn( + """'add_selection' is deprecated. Use 'add_parameter'.""", + DeprecationWarning, + ) + return self.add_parameter(*params) def interactive(self, name=None, bind_x=True, bind_y=True): """Make chart axes scales interactive @@ -2496,6 +2493,13 @@ def __init__(self, data=Undefined, layer=(), **kwargs): super(LayerChart, self).__init__(data=data, layer=list(layer), **kwargs) self.data, self.layer = _combine_subchart_data(self.data, self.layer) + # Some properties are not allowed within layer; we'll move to parent. + bad_props = ("height", "width", "view") + combined_dict, self.layer = _remove_bad_props(self, self.layer, bad_props) + + for prop in combined_dict: + self[prop] = combined_dict[prop] + def __iadd__(self, other): _check_if_valid_subspec(other, "LayerChart") _check_if_can_be_layered(other) @@ -2669,6 +2673,42 @@ def remove_data(subchart): return data, subcharts +def _remove_bad_props(chart, subcharts, bad_props): + def remove_prop(subchart, prop): + if subchart[prop] is not Undefined: + subchart = subchart.copy() + subchart[prop] = Undefined + return subchart + + output_dict = {} + + if not subcharts: + # No subcharts = nothing to do. + return output_dict + + for prop in bad_props: + if chart[prop] is Undefined: + # Top level does not have this prop. + # Check for consistent props within the subcharts. + values = [c[prop] for c in subcharts if c[prop] is not Undefined] + if len(values) == 0: + pass + elif all(v is values[0] for v in values[1:]): + output_dict[prop] = values[0] + else: + raise ValueError(f"There are inconsistent values {values} for {prop}") + else: + # Top level has this prop; subchart props must be either + # Undefined or identical to proceed. + if all(c[prop] is Undefined or c[prop] is chart[prop] for c in subcharts): + output_dict[prop] = chart[prop] + else: + raise ValueError(f"There are inconsistent values {values} for {prop}") + subcharts = [remove_prop(c, prop) for c in subcharts] + + return output_dict, subcharts + + @utils.use_signature(core.SequenceParams) def sequence(start, stop=None, step=Undefined, as_=Undefined, **kwds): """Sequence generator.""" From c143c04c71aafbc0a03d3e2862418f4e87b4dc79 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 27 Nov 2021 16:44:13 -0800 Subject: [PATCH 05/24] Increase compatibility with old selection syntax --- altair/vegalite/v5/api.py | 68 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index bfae42d30..44353782e 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -182,11 +182,34 @@ def to_dict(self): else self.name } + + def __invert__(self): + if self.param_type == "selection": + return core.PredicateComposition({"not": {"param": self.name}}) + else: + return expr.core.OperatorMixin.__invert__(self) + + def __and__(self, other): + if self.param_type == "selection": + if isinstance(other, Parameter): + other = other.name + return core.PredicateComposition({"and": [self.name, other]}) + else: + return expr.core.OperatorMixin.__and__(self, other) + + def __or__(self, other): + if self.param_type == "selection": + if isinstance(other, Parameter): + other = other.name + return core.PredicateComposition({"or": [self.name, other]}) + else: + return expr.core.OperatorMixin.__or__(self, other) + def __repr__(self): return "Parameter({0!r}, {1})".format(self.name, self.param) def _to_expr(self): - if self.param.expr is Undefined: + if not hasattr(self.param, "expr") or self.param.expr is Undefined: return self.name else: return self.param.expr @@ -260,6 +283,36 @@ def parameter(name=None, select=None, **kwds): parameter = Parameter(name) + if "empty" in kwds: + parameter.empty = kwds.pop("empty") + if parameter.empty == "none": + warnings.warn( + """The value of 'empty' should be True or False.""", + DeprecationWarning, + ) + parameter.empty = False + elif parameter.empty == "all": + warnings.warn( + """The value of 'empty' should be True or False.""", + DeprecationWarning, + ) + parameter.empty = True + elif (parameter.empty is False) or (parameter.empty is True): + pass + else: + raise ValueError("The value of 'empty' should be True or False.") + + if "init" in kwds: + warnings.warn( + """Use 'value' instead of 'init'.""", + DeprecationWarning, + ) + if "value" not in kwds: + kwds["value"] = kwds.pop("init") + else: + # If both 'value' and 'init' are set, we ignore 'init'. + kwds.pop("init") + if select is None: parameter.param = core.VariableParameter(name=parameter.name, **kwds) parameter.param_type = "variable" @@ -292,7 +345,7 @@ def selection(type=Undefined, **kwds): # We separate out the parameter keywords from the selection keywords param_kwds = {} - for kwd in {"name", "value", "bind"}: + for kwd in {"name", "value", "bind", "empty", "init"}: if kwd in kwds: param_kwds[kwd] = kwds.pop(kwd) @@ -401,6 +454,8 @@ def condition(predicate, if_true, if_false, **kwargs): condition = {"param": predicate.name} if "empty" in kwargs: condition["empty"] = kwargs.pop("empty") + elif isinstance(predicate.empty,bool): + condition["empty"] = predicate.empty else: condition = {"test": predicate.param.expr} elif isinstance(predicate, test_predicates): @@ -1220,9 +1275,12 @@ def transform_filter(self, filter, **kwargs): """ if isinstance(filter, Parameter): - filter = {"param": filter.name} + new_filter = {"param": filter.name} if "empty" in kwargs: - filter["empty"] = kwargs.pop("empty") + new_filter["empty"] = kwargs.pop("empty") + elif isinstance(filter.empty,bool): + new_filter["empty"] = filter.empty + filter = new_filter return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) def transform_flatten(self, flatten, as_=Undefined): @@ -2684,7 +2742,7 @@ def remove_prop(subchart, prop): if not subcharts: # No subcharts = nothing to do. - return output_dict + return output_dict, subcharts for prop in bad_props: if chart[prop] is Undefined: From 5bba4025b98c9bb6ee4b2bcd448dd461bae8ead0 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 27 Nov 2021 17:21:36 -0800 Subject: [PATCH 06/24] Fix formatting --- altair/vegalite/v5/api.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 44353782e..e614e4e82 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -182,7 +182,6 @@ def to_dict(self): else self.name } - def __invert__(self): if self.param_type == "selection": return core.PredicateComposition({"not": {"param": self.name}}) @@ -287,14 +286,14 @@ def parameter(name=None, select=None, **kwds): parameter.empty = kwds.pop("empty") if parameter.empty == "none": warnings.warn( - """The value of 'empty' should be True or False.""", - DeprecationWarning, + """The value of 'empty' should be True or False.""", + DeprecationWarning, ) parameter.empty = False elif parameter.empty == "all": warnings.warn( - """The value of 'empty' should be True or False.""", - DeprecationWarning, + """The value of 'empty' should be True or False.""", + DeprecationWarning, ) parameter.empty = True elif (parameter.empty is False) or (parameter.empty is True): @@ -306,7 +305,7 @@ def parameter(name=None, select=None, **kwds): warnings.warn( """Use 'value' instead of 'init'.""", DeprecationWarning, - ) + ) if "value" not in kwds: kwds["value"] = kwds.pop("init") else: @@ -454,7 +453,7 @@ def condition(predicate, if_true, if_false, **kwargs): condition = {"param": predicate.name} if "empty" in kwargs: condition["empty"] = kwargs.pop("empty") - elif isinstance(predicate.empty,bool): + elif isinstance(predicate.empty, bool): condition["empty"] = predicate.empty else: condition = {"test": predicate.param.expr} @@ -1278,7 +1277,7 @@ def transform_filter(self, filter, **kwargs): new_filter = {"param": filter.name} if "empty" in kwargs: new_filter["empty"] = kwargs.pop("empty") - elif isinstance(filter.empty,bool): + elif isinstance(filter.empty, bool): new_filter["empty"] = filter.empty filter = new_filter return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) From 4d0ae32b691ce491a596735f78497a92e82da37d Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 2 Dec 2021 06:21:32 -0800 Subject: [PATCH 07/24] Updated use of PredicateComposition And replaced v4 with v5 in some files. --- altair/vegalite/v5/api.py | 32 +++++++++---------- altair/vegalite/v5/tests/test_api.py | 2 +- altair/vegalite/v5/tests/test_display.py | 2 +- .../vegalite/v5/tests/test_geo_interface.py | 2 +- altair/vegalite/v5/tests/test_renderers.py | 2 +- altair/vegalite/v5/tests/test_theme.py | 4 +-- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index e614e4e82..d8befa365 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -191,16 +191,16 @@ def __invert__(self): def __and__(self, other): if self.param_type == "selection": if isinstance(other, Parameter): - other = other.name - return core.PredicateComposition({"and": [self.name, other]}) + other = {"param": other.name} + return core.PredicateComposition({"and": [{"param": self.name}, other]}) else: return expr.core.OperatorMixin.__and__(self, other) def __or__(self, other): if self.param_type == "selection": if isinstance(other, Parameter): - other = other.name - return core.PredicateComposition({"or": [self.name, other]}) + other = {"param": other.name} + return core.PredicateComposition({"or": [{"param": self.name}, other]}) else: return expr.core.OperatorMixin.__or__(self, other) @@ -2194,8 +2194,8 @@ def interactive(self, name=None, bind_x=True, bind_y=True): Parameters ---------- name : string - The selection name to use for the axes scales. This name should be - unique among all selections within the chart. + The parameter name to use for the axes scales. This name should be + unique among all parameters within the chart. bind_x : boolean, default True If true, then bind the interactive scales to the x-axis bind_y : boolean, default True @@ -2333,8 +2333,8 @@ def interactive(self, name=None, bind_x=True, bind_y=True): Parameters ---------- name : string - The selection name to use for the axes scales. This name should be - unique among all selections within the chart. + The parameter name to use for the axes scales. This name should be + unique among all parameters within the chart. bind_x : boolean, default True If true, then bind the interactive scales to the x-axis bind_y : boolean, default True @@ -2551,8 +2551,8 @@ def __init__(self, data=Undefined, layer=(), **kwargs): self.data, self.layer = _combine_subchart_data(self.data, self.layer) # Some properties are not allowed within layer; we'll move to parent. - bad_props = ("height", "width", "view") - combined_dict, self.layer = _remove_bad_props(self, self.layer, bad_props) + layer_props = ("height", "width", "view") + combined_dict, self.layer = _remove_layer_props(self, self.layer, layer_props) for prop in combined_dict: self[prop] = combined_dict[prop] @@ -2581,8 +2581,8 @@ def interactive(self, name=None, bind_x=True, bind_y=True): Parameters ---------- name : string - The selection name to use for the axes scales. This name should be - unique among all selections within the chart. + The parameter name to use for the axes scales. This name should be + unique among all parameters within the chart. bind_x : boolean, default True If true, then bind the interactive scales to the x-axis bind_y : boolean, default True @@ -2644,8 +2644,8 @@ def interactive(self, name=None, bind_x=True, bind_y=True): Parameters ---------- name : string - The selection name to use for the axes scales. This name should be - unique among all selections within the chart. + The parameter name to use for the axes scales. This name should be + unique among all parameters within the chart. bind_x : boolean, default True If true, then bind the interactive scales to the x-axis bind_y : boolean, default True @@ -2730,7 +2730,7 @@ def remove_data(subchart): return data, subcharts -def _remove_bad_props(chart, subcharts, bad_props): +def _remove_layer_props(chart, subcharts, layer_props): def remove_prop(subchart, prop): if subchart[prop] is not Undefined: subchart = subchart.copy() @@ -2743,7 +2743,7 @@ def remove_prop(subchart, prop): # No subcharts = nothing to do. return output_dict, subcharts - for prop in bad_props: + for prop in layer_props: if chart[prop] is Undefined: # Top level does not have this prop. # Check for consistent props within the subcharts. diff --git a/altair/vegalite/v5/tests/test_api.py b/altair/vegalite/v5/tests/test_api.py index 450553f3c..6a7542b9d 100644 --- a/altair/vegalite/v5/tests/test_api.py +++ b/altair/vegalite/v5/tests/test_api.py @@ -11,7 +11,7 @@ import pytest import pandas as pd -import altair.vegalite.v4 as alt +import altair.vegalite.v5 as alt try: import altair_saver # noqa: F401 diff --git a/altair/vegalite/v5/tests/test_display.py b/altair/vegalite/v5/tests/test_display.py index e7ccc27ff..2a3fa3a35 100644 --- a/altair/vegalite/v5/tests/test_display.py +++ b/altair/vegalite/v5/tests/test_display.py @@ -2,7 +2,7 @@ import pytest -import altair.vegalite.v4 as alt +import altair.vegalite.v5 as alt @contextmanager diff --git a/altair/vegalite/v5/tests/test_geo_interface.py b/altair/vegalite/v5/tests/test_geo_interface.py index b637b28fc..15a55bb41 100644 --- a/altair/vegalite/v5/tests/test_geo_interface.py +++ b/altair/vegalite/v5/tests/test_geo_interface.py @@ -1,5 +1,5 @@ import pytest -import altair.vegalite.v4 as alt +import altair.vegalite.v5 as alt def geom_obj(geom): diff --git a/altair/vegalite/v5/tests/test_renderers.py b/altair/vegalite/v5/tests/test_renderers.py index 55c5e4ffb..94717e629 100644 --- a/altair/vegalite/v5/tests/test_renderers.py +++ b/altair/vegalite/v5/tests/test_renderers.py @@ -4,7 +4,7 @@ import pytest -import altair.vegalite.v4 as alt +import altair.vegalite.v5 as alt @pytest.fixture diff --git a/altair/vegalite/v5/tests/test_theme.py b/altair/vegalite/v5/tests/test_theme.py index d159d2fa7..eaa2d8898 100644 --- a/altair/vegalite/v5/tests/test_theme.py +++ b/altair/vegalite/v5/tests/test_theme.py @@ -1,7 +1,7 @@ import pytest -import altair.vegalite.v4 as alt -from altair.vegalite.v4.theme import VEGA_THEMES +import altair.vegalite.v5 as alt +from altair.vegalite.v5.theme import VEGA_THEMES @pytest.fixture From d4915ce1616a459cb0efbe6bc8f5a89f4870d4d2 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 2 Dec 2021 06:24:25 -0800 Subject: [PATCH 08/24] Update scatter_with_minimap.py Replaced dict key "selection" with "param" to match the Vega-Lite v5 schema. --- altair/examples/scatter_with_minimap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/altair/examples/scatter_with_minimap.py b/altair/examples/scatter_with_minimap.py index 7de894c43..8473520c6 100644 --- a/altair/examples/scatter_with_minimap.py +++ b/altair/examples/scatter_with_minimap.py @@ -35,11 +35,11 @@ .mark_point() .encode( x=alt.X( - "date:T", scale=alt.Scale(domain={"selection": zoom.name, "encoding": "x"}) + "date:T", scale=alt.Scale(domain={"param": zoom.name, "encoding": "x"}) ), y=alt.Y( "temp_max:Q", - scale=alt.Scale(domain={"selection": zoom.name, "encoding": "y"}), + scale=alt.Scale(domain={"param": zoom.name, "encoding": "y"}), ), color="weather", ) From 870e30c198c934f1af7b4506724055a883b56624 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 2 Dec 2021 18:01:17 -0800 Subject: [PATCH 09/24] Update api.py Updates related to UnitSpec not having e.g. a "height" property. --- altair/utils/tests/test_mimebundle.py | 4 ++-- altair/vegalite/v5/api.py | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/altair/utils/tests/test_mimebundle.py b/altair/utils/tests/test_mimebundle.py index c893b7ce2..14120cbba 100644 --- a/altair/utils/tests/test_mimebundle.py +++ b/altair/utils/tests/test_mimebundle.py @@ -15,7 +15,7 @@ def require_altair_saver(): @pytest.fixture def vegalite_spec(): return { - "$schema": "https://vega.github.io/schema/vega-lite/v4.json", + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "description": "A simple bar chart with embedded data.", "data": { "values": [ @@ -188,7 +188,7 @@ def test_spec_to_vegalite_mimebundle(vegalite_spec): format="vega-lite", vegalite_version=alt.VEGALITE_VERSION, ) - assert bundle == {"application/vnd.vegalite.v4+json": vegalite_spec} + assert bundle == {"application/vnd.vegalite.v5+json": vegalite_spec} def test_spec_to_vega_mimebundle(vega_spec): diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index d8befa365..3481cb00c 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -2732,9 +2732,13 @@ def remove_data(subchart): def _remove_layer_props(chart, subcharts, layer_props): def remove_prop(subchart, prop): - if subchart[prop] is not Undefined: - subchart = subchart.copy() - subchart[prop] = Undefined + # If subchart is a UnitSpec, then subchart["height"] raises a KeyError + try: + if subchart[prop] is not Undefined: + subchart = subchart.copy() + subchart[prop] = Undefined + except KeyError: + pass return subchart output_dict = {} @@ -2747,7 +2751,15 @@ def remove_prop(subchart, prop): if chart[prop] is Undefined: # Top level does not have this prop. # Check for consistent props within the subcharts. - values = [c[prop] for c in subcharts if c[prop] is not Undefined] + values = [] + for c in subcharts: + # If c is a UnitSpec, then c["height"] raises a KeyError. + try: + val = c[prop] + if val is not Undefined: + values.append(val) + except KeyError: + pass if len(values) == 0: pass elif all(v is values[0] for v in values[1:]): From 566a779806c49ed521bbac75c88b5d29b0b07921 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Mon, 13 Dec 2021 08:47:30 -0600 Subject: [PATCH 10/24] First draft of parameters documentation --- doc/index.rst | 1 + doc/user_guide/interactions2.rst | 216 +++++++++++++++++++++++++++++++ 2 files changed, 217 insertions(+) create mode 100644 doc/user_guide/interactions2.rst diff --git a/doc/index.rst b/doc/index.rst index f24afbbc5..ec0a18b1e 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -40,6 +40,7 @@ beautiful and effective visualizations with a minimal amount of code. user_guide/marks user_guide/transform/index user_guide/interactions + user_guide/interactions2 user_guide/configuration user_guide/compound_charts user_guide/scale_resolve diff --git a/doc/user_guide/interactions2.rst b/doc/user_guide/interactions2.rst new file mode 100644 index 000000000..1f141126b --- /dev/null +++ b/doc/user_guide/interactions2.rst @@ -0,0 +1,216 @@ +.. currentmodule:: altair + +.. _user-guide-interactions2: + +Parameters: Variables and Selections +==================================== + +Interactivity in Altair is built around *parameters*, of which there are two types: variables and selections. We introduce these concepts through a series examples. + +Basic Example: Using a variable +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Here is a simple scatter-plot created from the ``cars`` dataset: + +.. altair-plot:: + + import altair as alt + from vega_datasets import data + + cars = data.cars.url + + alt.Chart(cars).mark_circle().encode( + x='Miles_per_Gallon:Q', + y='Horsepower:Q', + color='Origin:N' + ) + +We can create a variable parameter with a default value of 0.1 as follows: + +.. altair-plot:: + + op_var = alt.parameter(value=0.1) + +In order to use this variable in the chart specification, we explicitly add it to the chart using the :func:`add_parameter` function, and we can then reference the variable within the chart specification. Here we set the opacity using ``op_var``. + +.. altair-plot:: + + import altair as alt + from vega_datasets import data + + cars = data.cars.url + + op_var = alt.parameter(value=0.1) + + alt.Chart(cars).mark_circle(opacity=op_var).encode( + x='Miles_per_Gallon:Q', + y='Horsepower:Q', + color='Origin:N' + ).add_parameter( + op_var + ) + +It's reasonable to ask whether all this effort is necessary. Here is a more natural way to accomplish the same thing. We avoid the use of both :func:`alt.parameter` and :func:`add_parameter`. + +.. altair-plot:: + + import altair as alt + from vega_datasets import data + + cars = data.cars.url + + op_var2 = 0.1 + + alt.Chart(cars).mark_circle(opacity=op_var2).encode( + x='Miles_per_Gallon:Q', + y='Horsepower:Q', + color='Origin:N' + ) + +The benefit of using :func:`parameter` doesn't become apparent until we incorporate an additional component, such as in the following, where we `bind` the parameter to a slider widget. + +.. altair-plot:: + + import altair as alt + from vega_datasets import data + + cars = data.cars.url + + slider = alt.binding_range(min=0, max=1, step=0.05, name='opacity:') + op_var = alt.parameter(value=0.1, bind=slider) + + alt.Chart(cars).mark_circle(opacity=op_var).encode( + x='Miles_per_Gallon:Q', + y='Horsepower:Q', + color='Origin:N' + ).add_parameter( + op_var + ) + +Notice that the effects on the chart are produced entirely within your web browser. Once the Vega-Lite chart specification has been created by Altair, the result is an interactive chart that no longer needs a running Python environment. + +The above example shows some of the common components used to produce interactivity in Altair: + +- Creating a variable parameter using ``alt.parameter``. +- Attaching the parameter to a chart using ``add_parameter``. +- Binding the parameter to an input widget using ``bind``. (In the above example, the input widget is a slider widget.) + +Some further aspects that we will see below include: + +- Creating a *selection* parameter. +- Using a parameter within a `condition`. +- Using a parameter within a `transform_filter`. + +Using selection parameters +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The basic syntax for adding a selection parameter to a chart is similar to the syntax for a variable parameter. Instead of creating the parameter using ``alt.parameter``, we will typically use ``alt.selection_interval`` or ``alt.selection_point``. + +.. altair-plot:: + + import altair as alt + from vega_datasets import data + + cars = data.cars.url + + brush = alt.selection_interval() + + alt.Chart(cars).mark_circle().encode( + x='Miles_per_Gallon:Q', + y='Horsepower:Q', + color='Origin:N' + ).add_parameter( + brush + ) + +If you click and drag on the above chart, you will see that the corresponding region gets highlighted. We have done two things so far: created a selection parameter using ``brush = alt.selection_interval()``, and attached that parameter to the chart, using ``add_parameter``. + +Typically selection parameters will be used in conjunction with ``condition`` or with ``transform_filter``. Here are some possibilities. + +Using a selection within a condition +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In the following example, we are using the selection parameter ``brush`` as a *predicate* (something that evaluates as `True` or `False`). This is controlled by the line ``color=alt.condition(brush, 'Origin:N', alt.value('lightgray'))``. Data points which fall within the selection evaluate as ``True``, and data points which fall outside the selection evaluate to ``False``. The ``'Origin:N'`` specifies how to color the points which fall within the selection, and the ``alt.value('lightgray')`` specifies that the outside points should be given a constant color value. + +.. altair-plot:: + + import altair as alt + from vega_datasets import data + + cars = data.cars.url + + brush = alt.selection_interval() + + alt.Chart(cars).mark_circle().encode( + x='Miles_per_Gallon:Q', + y='Horsepower:Q', + color=alt.condition(brush, 'Origin:N', alt.value('lightgray')) + ).add_parameter( + brush + ) + +Using a selection to filter the data +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Once you are comfortable with using a parameter within ``alt.condition``, using a parameter within ``transform_filter`` works in much the same way. For example, in ``transform_filter(brush)``, we are again using the selection parameter ``brush`` as a predicate. Data points which evaluate to ``True`` (i.e., data points which lie within the selection) are kept, and data points which evaluate to ``False`` are removed. + +It is not possible to both select and filter in the same chart, so typically this functionality will be used when at least two sub-charts are present. In the following example, we attach the selection parameter to the left chart, and then filter data using the selection parameter on the right chart. We specify explicit domains for the right chart so that the positions of the points remain steady. + +.. altair-plot:: + + import altair as alt + from vega_datasets import data + + cars = data.cars.url + + brush = alt.selection_interval() + + c1 = alt.Chart(cars).mark_point().encode( + x = "Horsepower:Q", + y = "Miles_per_Gallon:Q" + ).add_parameter(brush) + + c2 = alt.Chart(cars).mark_point().encode( + x = alt.X("Acceleration:Q", scale=alt.Scale(domain=[0,25])), + y = alt.Y("Displacement:Q", scale=alt.Scale(domain=[0,500])), + ).transform_filter(brush) + + alt.vconcat(c1,c2) + + +Limitations +^^^^^^^^^^^ + +Some possible use cases for the above interactivity are not currently supported by Vega-Lite, and hence are not currently supported by Altair. Here are some examples. + +1. If we are using a ``selection_point``, it would be natural to want to return information about the chosen data point, and then process that information using Python. This is not currently possible (and as of December 2021 it does not seem likely to become possible any time soon), so any data processing will have to be handled using tools such as ``transform_calculate``, etc. + +2. It is not possible to use an encoding such as ``y=column_variable`` to then dynamically display different charts based on different column choices. Similar functionality could be created using for example ``ipywidgets``, but the resulting interactivity would be controlled by Python, and would not work for example as a stand-alone web page. The underlying reason this is not possible is that in Vega-Lite, the ``field`` property does not accept a parameter as value; see the `field Vega-Lite documentation `_. A first approximation of a workaround is given in the following example. + +.. altair-plot:: + import altair as alt + from vega_datasets import data + + iris = data.iris() + iris_long = iris.melt(id_vars=['sepalLength','species'],var_name='column') + + col_dropdown = alt.binding_select(options=list(set(iris_long['column']))) + col_select = alt.parameter(bind=col_dropdown, name="Column", value='sepalWidth') + + c = alt.Chart(iris_long).mark_circle().encode( + x = alt.X("sepalLength:Q", scale=alt.Scale(zero=False)), + y = alt.Y("value:Q",scale=alt.Scale(domain=[0,8]), title=None), + color = "species:N", + ).transform_filter( + "datum.column == Column" + ) + + label = alt.Chart(iris_long).mark_text().encode( + x = alt.value(60), + y = alt.value(20), + text = alt.value("y-axis = " + col_select) + ) + + (c+label).add_parameter( + col_select + ) \ No newline at end of file From 846a842a6dbd6c7f989bff5232c697be94ffb7b1 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 7 Jan 2022 17:33:18 -0800 Subject: [PATCH 11/24] Define SelectionPredicateComposition Made a new class SelectionPredicateComposition to allow use of ~,&,| with certain PredicateCompositions. Rewrote test_filter_transform_selection_predicates to match the new syntax. --- altair/vegalite/v5/api.py | 18 +++++++++++++++--- altair/vegalite/v5/tests/test_api.py | 14 +++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 3481cb00c..fd2121ad9 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -184,7 +184,7 @@ def to_dict(self): def __invert__(self): if self.param_type == "selection": - return core.PredicateComposition({"not": {"param": self.name}}) + return SelectionPredicateComposition({"not": {"param": self.name}}) else: return expr.core.OperatorMixin.__invert__(self) @@ -192,7 +192,7 @@ def __and__(self, other): if self.param_type == "selection": if isinstance(other, Parameter): other = {"param": other.name} - return core.PredicateComposition({"and": [{"param": self.name}, other]}) + return SelectionPredicateComposition({"and": [{"param": self.name}, other]}) else: return expr.core.OperatorMixin.__and__(self, other) @@ -200,7 +200,7 @@ def __or__(self, other): if self.param_type == "selection": if isinstance(other, Parameter): other = {"param": other.name} - return core.PredicateComposition({"or": [{"param": self.name}, other]}) + return SelectionPredicateComposition({"or": [{"param": self.name}, other]}) else: return expr.core.OperatorMixin.__or__(self, other) @@ -227,6 +227,18 @@ def __getattr__(self, field_name): return expr.core.GetAttrExpression(self.name, field_name) +# Enables use of ~, &, | with compositions of selection objects. +class SelectionPredicateComposition(core.PredicateComposition): + def __invert__(self): + return SelectionPredicateComposition({"not": self.to_dict()}) + + def __and__(self, other): + return SelectionPredicateComposition({"and": [self.to_dict(), other.to_dict()]}) + + def __or__(self, other): + return SelectionPredicateComposition({"or": [self.to_dict(), other.to_dict()]}) + + class SelectionExpression(expr.core.OperatorMixin, object): def __init__(self, expr): self.expr = expr diff --git a/altair/vegalite/v5/tests/test_api.py b/altair/vegalite/v5/tests/test_api.py index 6a7542b9d..c06da2978 100644 --- a/altair/vegalite/v5/tests/test_api.py +++ b/altair/vegalite/v5/tests/test_api.py @@ -534,34 +534,34 @@ def test_filter_transform_selection_predicates(): base = alt.Chart("data.txt").mark_point() chart = base.transform_filter(selector1) - assert chart.to_dict()["transform"] == [{"filter": {"selection": "s1"}}] + assert chart.to_dict()["transform"] == [{'filter': {'param': 's1'}}] chart = base.transform_filter(~selector1) - assert chart.to_dict()["transform"] == [{"filter": {"selection": {"not": "s1"}}}] + assert chart.to_dict()["transform"] == [{'filter': {'not': {'param': 's1'}}}] chart = base.transform_filter(selector1 & selector2) assert chart.to_dict()["transform"] == [ - {"filter": {"selection": {"and": ["s1", "s2"]}}} + {'filter': {'and': [{'param': 's1'}, {'param': 's2'}]}} ] chart = base.transform_filter(selector1 | selector2) assert chart.to_dict()["transform"] == [ - {"filter": {"selection": {"or": ["s1", "s2"]}}} + {'filter': {'or': [{'param': 's1'}, {'param': 's2'}]}} ] chart = base.transform_filter(selector1 | ~selector2) assert chart.to_dict()["transform"] == [ - {"filter": {"selection": {"or": ["s1", {"not": "s2"}]}}} + {'filter': {'or': [{'param': 's1'}, {'not': {'param': 's2'}}]}} ] chart = base.transform_filter(~selector1 | ~selector2) assert chart.to_dict()["transform"] == [ - {"filter": {"selection": {"or": [{"not": "s1"}, {"not": "s2"}]}}} + {'filter': {'or': [{'not': {'param': 's1'}}, {'not': {'param': 's2'}}]}} ] chart = base.transform_filter(~(selector1 & selector2)) assert chart.to_dict()["transform"] == [ - {"filter": {"selection": {"not": {"and": ["s1", "s2"]}}}} + {'filter': {'not': {'and': [{'param': 's1'}, {'param': 's2'}]}}} ] From b391eec07e4ac48cbd92feb0c9ac9ede589b134d Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 7 Jan 2022 17:53:17 -0800 Subject: [PATCH 12/24] Update test_add_selection Also fixed formatting. --- altair/vegalite/v5/tests/test_api.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/altair/vegalite/v5/tests/test_api.py b/altair/vegalite/v5/tests/test_api.py index c06da2978..4920b50ee 100644 --- a/altair/vegalite/v5/tests/test_api.py +++ b/altair/vegalite/v5/tests/test_api.py @@ -534,34 +534,34 @@ def test_filter_transform_selection_predicates(): base = alt.Chart("data.txt").mark_point() chart = base.transform_filter(selector1) - assert chart.to_dict()["transform"] == [{'filter': {'param': 's1'}}] + assert chart.to_dict()["transform"] == [{"filter": {"param": "s1"}}] chart = base.transform_filter(~selector1) - assert chart.to_dict()["transform"] == [{'filter': {'not': {'param': 's1'}}}] + assert chart.to_dict()["transform"] == [{"filter": {"not": {"param": "s1"}}}] chart = base.transform_filter(selector1 & selector2) assert chart.to_dict()["transform"] == [ - {'filter': {'and': [{'param': 's1'}, {'param': 's2'}]}} + {"filter": {"and": [{"param": "s1"}, {"param": "s2"}]}} ] chart = base.transform_filter(selector1 | selector2) assert chart.to_dict()["transform"] == [ - {'filter': {'or': [{'param': 's1'}, {'param': 's2'}]}} + {"filter": {"or": [{"param": "s1"}, {"param": "s2"}]}} ] chart = base.transform_filter(selector1 | ~selector2) assert chart.to_dict()["transform"] == [ - {'filter': {'or': [{'param': 's1'}, {'not': {'param': 's2'}}]}} + {"filter": {"or": [{"param": "s1"}, {"not": {"param": "s2"}}]}} ] chart = base.transform_filter(~selector1 | ~selector2) assert chart.to_dict()["transform"] == [ - {'filter': {'or': [{'not': {'param': 's1'}}, {'not': {'param': 's2'}}]}} + {"filter": {"or": [{"not": {"param": "s1"}}, {"not": {"param": "s2"}}]}} ] chart = base.transform_filter(~(selector1 & selector2)) assert chart.to_dict()["transform"] == [ - {'filter': {'not': {'and': [{'param': 's1'}, {'param': 's2'}]}}} + {"filter": {"not": {"and": [{"param": "s1"}, {"param": "s2"}]}}} ] @@ -599,8 +599,8 @@ def test_add_selection(): .add_selection(selections[0]) .add_selection(selections[1], selections[2]) ) - expected = {s.name: s.selection for s in selections} - assert chart.selection == expected + expected = [s.param for s in selections] + assert chart.params == expected def test_repeat_add_selections(): From 3b41f22658876c9529726234a88ce207674fe479 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 7 Jan 2022 18:09:25 -0800 Subject: [PATCH 13/24] Update test_selection_expression --- altair/vegalite/v5/api.py | 5 +++++ altair/vegalite/v5/tests/test_api.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index fd2121ad9..3899ffb21 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -226,6 +226,11 @@ def __getattr__(self, field_name): return SelectionExpression(_attrexpr) return expr.core.GetAttrExpression(self.name, field_name) + # TODO: Are there any special cases to consider for __getitem__? + # This was copied from v4. + def __getitem__(self, field_name): + return expr.core.GetItemExpression(self.name, field_name) + # Enables use of ~, &, | with compositions of selection objects. class SelectionPredicateComposition(core.PredicateComposition): diff --git a/altair/vegalite/v5/tests/test_api.py b/altair/vegalite/v5/tests/test_api.py index 4920b50ee..6381e503a 100644 --- a/altair/vegalite/v5/tests/test_api.py +++ b/altair/vegalite/v5/tests/test_api.py @@ -243,8 +243,8 @@ def test_selection_to_dict(): def test_selection_expression(): selection = alt.selection_single(fields=["value"]) - assert isinstance(selection.value, alt.expr.Expression) - assert selection.value.to_dict() == "{0}.value".format(selection.name) + assert isinstance(selection.value, alt.SelectionExpression) + assert selection.value.to_dict() == {"expr": f"{selection.name}.value"} assert isinstance(selection["value"], alt.expr.Expression) assert selection["value"].to_dict() == "{0}['value']".format(selection.name) From b8fd70e0520b08c70db082100d6a4e81d251cdfb Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Mon, 10 Jan 2022 18:44:30 -0800 Subject: [PATCH 14/24] Update tests related to selections --- altair/vegalite/v5/tests/test_api.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/altair/vegalite/v5/tests/test_api.py b/altair/vegalite/v5/tests/test_api.py index 6381e503a..d3aebfe24 100644 --- a/altair/vegalite/v5/tests/test_api.py +++ b/altair/vegalite/v5/tests/test_api.py @@ -382,29 +382,29 @@ def test_facet_parse_data(): def test_selection(): # test instantiation of selections interval = alt.selection_interval(name="selec_1") - assert interval.selection.type == "interval" + assert interval.param.select.type == "interval" assert interval.name == "selec_1" single = alt.selection_single(name="selec_2") - assert single.selection.type == "single" + assert single.param.select.type == "point" assert single.name == "selec_2" multi = alt.selection_multi(name="selec_3") - assert multi.selection.type == "multi" + assert multi.param.select.type == "point" assert multi.name == "selec_3" # test adding to chart chart = alt.Chart().add_selection(single) chart = chart.add_selection(multi, interval) - assert set(chart.selection.keys()) == {"selec_1", "selec_2", "selec_3"} + assert set(x.name for x in chart.params) == {"selec_1", "selec_2", "selec_3"} # test logical operations - assert isinstance(single & multi, alt.Selection) - assert isinstance(single | multi, alt.Selection) - assert isinstance(~single, alt.Selection) - assert isinstance((single & multi)[0].group, alt.SelectionAnd) - assert isinstance((single | multi)[0].group, alt.SelectionOr) - assert isinstance((~single)[0].group, alt.SelectionNot) + assert isinstance(single & multi, alt.SelectionPredicateComposition) + assert isinstance(single | multi, alt.SelectionPredicateComposition) + assert isinstance(~single, alt.SelectionPredicateComposition) + assert "and" in (single & multi).to_dict().keys() + assert "or" in (single | multi).to_dict().keys() + assert "not" in (~single).to_dict().keys() # test that default names increment (regression for #1454) sel1 = alt.selection_single() @@ -478,7 +478,7 @@ def test_transforms(): assert chart.transform == [alt.LookupTransform(**kwds)] # lookup transform (selection) - lookup_selection = alt.LookupSelection(key="key", selection="sel") + lookup_selection = alt.LookupSelection(key="key", param="sel") chart = alt.Chart().transform_lookup( "a", from_=lookup_selection, as_="a", default="b" ) From 55e88fb3b486e2203c8755b6886916c7dcded311 Mon Sep 17 00:00:00 2001 From: mattijn Date: Mon, 17 Jan 2022 22:24:15 +0100 Subject: [PATCH 15/24] point temporary to master of altair_viewer --- .github/workflows/build.yml | 1 + .github/workflows/docbuild.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40922ad2f..4c7620630 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,7 @@ jobs: python -m pip install --upgrade pip pip install .[dev] pip install altair_saver + pip install git+git://github.com/altair-viz/altair_viewer.git - name: Test with pytest run: | pytest --doctest-modules altair diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml index 1c99835fd..dbf20122e 100644 --- a/.github/workflows/docbuild.yml +++ b/.github/workflows/docbuild.yml @@ -21,6 +21,7 @@ jobs: pip install .[dev] pip install altair_saver pip install -r doc/requirements.txt + pip install git+git://github.com/altair-viz/altair_viewer.git - name: Run docbuild run: | cd doc && make ${{ matrix.build-type }} From c1236a6fbdc954ff1cc90af81e6dff5e9368742d Mon Sep 17 00:00:00 2001 From: mattijn Date: Tue, 18 Jan 2022 21:49:03 +0100 Subject: [PATCH 16/24] alt.VEGALITE_VERSION uses this schema --- altair/vegalite/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altair/vegalite/schema.py b/altair/vegalite/schema.py index fd7f3df7e..ebb3b4d08 100644 --- a/altair/vegalite/schema.py +++ b/altair/vegalite/schema.py @@ -1,3 +1,3 @@ """Altair schema wrappers""" # flake8: noqa -from .v4.schema import * +from .v5.schema import * From 96634c83b7070fd013c468922fd08bda0fbef26a Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 18 Jan 2022 14:35:54 -0800 Subject: [PATCH 17/24] Update expected vega_spec Updated so test_vegalite_to_vega_mimebundle would pass. See @mattijn's comments here: https://github.com/altair-viz/altair/pull/2528#issuecomment-1015845461 --- altair/utils/tests/test_mimebundle.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/altair/utils/tests/test_mimebundle.py b/altair/utils/tests/test_mimebundle.py index 14120cbba..b3f3c42c9 100644 --- a/altair/utils/tests/test_mimebundle.py +++ b/altair/utils/tests/test_mimebundle.py @@ -97,10 +97,18 @@ def vega_spec(): "name": "data_0", "source": "source_0", "transform": [ + { + "as": ["b_start", "b_end"], + "field": "b", + "groupby": ["a"], + "offset": "zero", + "sort": {"field": [], "order": []}, + "type": "stack", + }, { "expr": 'isValid(datum["b"]) && isFinite(+datum["b"])', "type": "filter", - } + }, ], }, ], @@ -117,8 +125,8 @@ def vega_spec(): "fill": {"value": "#4c78a8"}, "width": {"band": 1, "scale": "x"}, "x": {"field": "a", "scale": "x"}, - "y": {"field": "b", "scale": "y"}, - "y2": {"scale": "y", "value": 0}, + "y": {"field": "b_end", "scale": "y"}, + "y2": {"field": "b_start", "scale": "y"}, } }, "from": {"data": "data_0"}, @@ -138,7 +146,7 @@ def vega_spec(): "type": "band", }, { - "domain": {"data": "data_0", "field": "b"}, + "domain": {"data": "data_0", "fields": ["b_start", "b_end"]}, "name": "y", "nice": True, "range": [{"signal": "height"}, 0], From 62ec05178ddeea8052b4b68cc12df0ab3f8da94f Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 3 Feb 2022 20:56:16 -0800 Subject: [PATCH 18/24] Update release notes Listed grammar changes. Also added one example to illustrate variable parameters and referred to that example in the release notes. --- altair/examples/slider_cutoff.py | 30 ++++++++++++++++++++++++++++++ doc/releases/changes.rst | 13 +++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 altair/examples/slider_cutoff.py diff --git a/altair/examples/slider_cutoff.py b/altair/examples/slider_cutoff.py new file mode 100644 index 000000000..b59850c39 --- /dev/null +++ b/altair/examples/slider_cutoff.py @@ -0,0 +1,30 @@ +""" +Slider Cutoff +============= +This example shows how to bind a variable parameter to a slider, and how to use the corresponding bound value to color data points. This example is based on an example from the Altair 4 documentation for Interactions, in which the interactivity was accomplished using a selection. The version below has been simplified significantly through the use of a variable parameter. Variable parameters were added in Altair 5. +""" +# category: interactive charts +import altair as alt +import pandas as pd +import numpy as np + +rand = np.random.RandomState(42) + +df = pd.DataFrame({ + 'xval': range(100), + 'yval': rand.randn(100).cumsum() +}) + +slider = alt.binding_range(min=0, max=100, step=1) +cutoff = alt.parameter(bind=slider, value=50) + +alt.Chart(df).mark_point().encode( + x='xval', + y='yval', + color=alt.condition( + alt.datum.xval < cutoff, + alt.value('red'), alt.value('blue') + ) +).add_parameter( + cutoff +) \ No newline at end of file diff --git a/doc/releases/changes.rst b/doc/releases/changes.rst index 9caeded9e..859f703f4 100644 --- a/doc/releases/changes.rst +++ b/doc/releases/changes.rst @@ -5,13 +5,26 @@ Altair Change Log Version 4.3.0 (unreleased) -------------------------- +- Update Vega-Lite from version 4.17.0 to version 5.2.0; + see `Vega-Lite Release Notes `_. Enhancements ~~~~~~~~~~~~ +- As described in the release notes for `Vega-Lite 5.0.0 `_, the primary change in this release of Altair is the introduction of parameters. There are two types of parameters, selection parameters and variable parameters. Variable parameters are new to Altair, and while selections are not new, much of the old terminology has been deprecated. See :ref:`gallery_slider_cutoff` for an application of variable parameters. + +Grammar Changes +~~~~~~~~~~~~~~~ +- ``selection_single`` and ``selection_multi`` are now deprecated; use ``selection_point`` instead. Similarly, ``type=point`` should be used instead of ``type=single`` and ``type=multi``. +- ``add_selection`` is deprecated; use ``add_parameter`` instead. +- The ``selection`` keyword argument must in many cases be replaced by ``param`` (e.g., when specifying a filter transform). +- The ``empty`` keyword argument for a selection parameter should be specified as ``True`` or ``False`` instead of ``all`` or ``none``, respectively. +- The ``init`` keyword argument for a parameter is deprecated; use ``value`` instead. + Bug Fixes ~~~~~~~~~ Backward-Incompatible Changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +- In regards to the grammar changes listed above, the old terminology will still work in many basic cases. On the other hand, if that old terminology gets used at a lower level, then it most likely will not work. For example, in the current version of :ref:`gallery_scatter_with_minimap`, two instances of the key ``param`` are used in dictionaries to specify axis domains. Those used to be ``selection``, but that usage is not compatible with the current Vega-Lite schema. Version 4.2.0 (released Dec 29, 2021) ------------------------------------- From d0022f39a7e267cf7fa87924cf070d1af9f790ef Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 4 Feb 2022 06:55:01 -0800 Subject: [PATCH 19/24] Update test_plugin_registry.py Reformatted with black --- altair/utils/tests/test_plugin_registry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/altair/utils/tests/test_plugin_registry.py b/altair/utils/tests/test_plugin_registry.py index cbfb62ac2..38f9cc053 100644 --- a/altair/utils/tests/test_plugin_registry.py +++ b/altair/utils/tests/test_plugin_registry.py @@ -26,7 +26,7 @@ def test_plugin_registry(): assert plugins.get() is None assert repr(plugins) == "TypedCallableRegistry(active='', registered=[])" - plugins.register("new_plugin", lambda x: x ** 2) + plugins.register("new_plugin", lambda x: x**2) assert plugins.names() == ["new_plugin"] assert plugins.active == "" assert plugins.get() is None @@ -46,7 +46,7 @@ def test_plugin_registry(): def test_plugin_registry_extra_options(): plugins = GeneralCallableRegistry() - plugins.register("metadata_plugin", lambda x, p=2: x ** p) + plugins.register("metadata_plugin", lambda x, p=2: x**p) plugins.enable("metadata_plugin") assert plugins.get()(3) == 9 @@ -86,7 +86,7 @@ def test_plugin_registry_global_settings(): def test_plugin_registry_context(): plugins = GeneralCallableRegistry() - plugins.register("default", lambda x, p=2: x ** p) + plugins.register("default", lambda x, p=2: x**p) # At first there is no plugin enabled assert plugins.active == "" From 6e62f53766c2a1b531307f32a3bb006acf36233b Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 8 Feb 2022 16:47:39 -0800 Subject: [PATCH 20/24] Corrected add_parameter definition on multi-view charts --- altair/vegalite/v5/api.py | 128 +++++++++++++++----------------------- 1 file changed, 49 insertions(+), 79 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 3899ffb21..87b1bcaf1 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -2229,7 +2229,7 @@ def interactive(self, name=None, bind_x=True, bind_y=True): encodings.append("x") if bind_y: encodings.append("y") - return self.add_selection( + return self.add_parameter( selection_interval(bind="scales", encodings=encodings) ) @@ -2369,23 +2369,18 @@ def interactive(self, name=None, bind_x=True, bind_y=True): def add_parameter(self, *params): """Add one or more parameters to the chart.""" - if not params: + if not params or self.spec is Undefined: return self - copy = self.copy(deep=["params"]) - if copy.params is Undefined: - copy.params = [] - - for s in params: - copy.params.append(s.param) + copy = self.copy() + copy.spec = copy.spec.add_parameter(*params) return copy def add_selection(self, *selections): - """Add one or more selections to the chart.""" - if not selections or self.spec is Undefined: - return self - copy = self.copy() - copy.spec = copy.spec.add_selection(*selections) - return copy + warnings.warn( + """'add_selection' is deprecated. Use 'add_parameter'""", + DeprecationWarning, + ) + return self.add_parameter(*selections) def repeat(repeater="repeat"): @@ -2434,23 +2429,18 @@ def __or__(self, other): def add_parameter(self, *params): """Add one or more parameters to the chart.""" - if not params: + if not params or not self.concat: return self - copy = self.copy(deep=["params"]) - if copy.params is Undefined: - copy.params = [] - - for s in params: - copy.params.append(s.param) + copy = self.copy() + copy.concat = [chart.add_parameter(*params) for chart in copy.concat] return copy def add_selection(self, *selections): - """Add one or more selections to all subcharts.""" - if not selections or not self.concat: - return self - copy = self.copy() - copy.concat = [chart.add_selection(*selections) for chart in copy.concat] - return copy + warnings.warn( + """'add_selection' is deprecated. Use 'add_parameter'""", + DeprecationWarning, + ) + return self.add_parameter(*selections) def concat(*charts, **kwargs): @@ -2482,23 +2472,18 @@ def __or__(self, other): def add_parameter(self, *params): """Add one or more parameters to the chart.""" - if not params: + if not params or not self.hconcat: return self - copy = self.copy(deep=["params"]) - if copy.params is Undefined: - copy.params = [] - - for s in params: - copy.params.append(s.param) + copy = self.copy() + copy.hconcat = [chart.add_parameter(*params) for chart in copy.hconcat] return copy def add_selection(self, *selections): - """Add one or more selections to all subcharts.""" - if not selections or not self.hconcat: - return self - copy = self.copy() - copy.hconcat = [chart.add_selection(*selections) for chart in copy.hconcat] - return copy + warnings.warn( + """'add_selection' is deprecated. Use 'add_parameter'""", + DeprecationWarning, + ) + return self.add_parameter(*selections) def hconcat(*charts, **kwargs): @@ -2530,23 +2515,18 @@ def __and__(self, other): def add_parameter(self, *params): """Add one or more parameters to the chart.""" - if not params: + if not params or not self.vconcat: return self - copy = self.copy(deep=["params"]) - if copy.params is Undefined: - copy.params = [] - - for s in params: - copy.params.append(s.param) + copy = self.copy() + copy.vconcat = [chart.add_parameter(*params) for chart in copy.vconcat] return copy def add_selection(self, *selections): - """Add one or more selections to all subcharts.""" - if not selections or not self.vconcat: - return self - copy = self.copy() - copy.vconcat = [chart.add_selection(*selections) for chart in copy.vconcat] - return copy + warnings.warn( + """'add_selection' is deprecated. Use 'add_parameter'""", + DeprecationWarning, + ) + return self.add_parameter(*selections) def vconcat(*charts, **kwargs): @@ -2623,23 +2603,18 @@ def interactive(self, name=None, bind_x=True, bind_y=True): def add_parameter(self, *params): """Add one or more parameters to the chart.""" - if not params: + if not params or not self.layer: return self - copy = self.copy(deep=["params"]) - if copy.params is Undefined: - copy.params = [] - - for s in params: - copy.params.append(s.param) + copy = self.copy() + copy.layer[0] = copy.layer[0].add_parameter(*params) return copy def add_selection(self, *selections): - """Add one or more selections to all subcharts.""" - if not selections or not self.layer: - return self - copy = self.copy() - copy.layer[0] = copy.layer[0].add_selection(*selections) - return copy + warnings.warn( + """'add_selection' is deprecated. Use 'add_parameter'""", + DeprecationWarning, + ) + return self.add_parameter(*selections) def layer(*charts, **kwargs): @@ -2680,23 +2655,18 @@ def interactive(self, name=None, bind_x=True, bind_y=True): def add_parameter(self, *params): """Add one or more parameters to the chart.""" - if not params: + if not params or self.spec is Undefined: return self - copy = self.copy(deep=["params"]) - if copy.params is Undefined: - copy.params = [] - - for s in params: - copy.params.append(s.param) + copy = self.copy() + copy.spec = copy.spec.add_parameter(*params) return copy def add_selection(self, *selections): - """Add one or more selections to the chart.""" - if not selections or self.spec is Undefined: - return self - copy = self.copy() - copy.spec = copy.spec.add_selection(*selections) - return copy + warnings.warn( + """'add_selection' is deprecated. Use 'add_parameter'""", + DeprecationWarning, + ) + return self.add_parameter(*selections) def topo_feature(url, feature, **kwargs): From a941cc1d257ad1bbae927e8483ddf8c6744cc144 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 1 Mar 2022 16:24:43 -0800 Subject: [PATCH 21/24] Remove remove obsolete schema classes from the user guide --- doc/user_guide/API.rst | 41 -------------------------------- doc/user_guide/interactions2.rst | 12 +++++----- 2 files changed, 6 insertions(+), 47 deletions(-) diff --git a/doc/user_guide/API.rst b/doc/user_guide/API.rst index dba0f0510..7490f4436 100644 --- a/doc/user_guide/API.rst +++ b/doc/user_guide/API.rst @@ -59,13 +59,11 @@ Encoding Channels Latitude2Datum Latitude2Value LatitudeDatum - LatitudeValue Longitude Longitude2 Longitude2Datum Longitude2Value LongitudeDatum - LongitudeValue Opacity OpacityDatum OpacityValue @@ -244,16 +242,6 @@ Low-Level Schema Wrappers ConditionalPredicateValueDefnumbernullExprRef ConditionalPredicateValueDefstringExprRef ConditionalPredicateValueDefstringnullExprRef - ConditionalSelectionMarkPropFieldOrDatumDef - ConditionalSelectionMarkPropFieldOrDatumDefTypeForShape - ConditionalSelectionStringFieldDef - ConditionalSelectionValueDefGradientstringnullExprRef - ConditionalSelectionValueDefTextExprRef - ConditionalSelectionValueDefnumber - ConditionalSelectionValueDefnumberArrayExprRef - ConditionalSelectionValueDefnumberExprRef - ConditionalSelectionValueDefstringExprRef - ConditionalSelectionValueDefstringnullExprRef ConditionalStringFieldDef ConditionalValueDefGradientstringnullExprRef ConditionalValueDefTextExprRef @@ -278,14 +266,12 @@ Low-Level Schema Wrappers DictInlineDataset DictSelectionInit DictSelectionInitInterval - Dictunknown Diverging DomainUnionWith DsvDataFormat Element Encoding EncodingSortField - EncodingSortFieldFieldName ErrorBand ErrorBandConfig ErrorBandDef @@ -296,13 +282,10 @@ Low-Level Schema Wrappers EventStream EventType Expr - ExprOrSignalRef ExprRef FacetEncodingFieldDef FacetFieldDef - FacetFieldDefFieldName FacetMapping - FacetMappingFieldName FacetSpec FacetedEncoding FacetedUnitSpec @@ -351,9 +334,7 @@ Low-Level Schema Wrappers ImputeTransform InlineData InlineDataset - InputBinding Interpolate - IntervalSelection IntervalSelectionConfig JoinAggregateFieldDef JoinAggregateTransform @@ -384,7 +365,6 @@ Low-Level Schema Wrappers LookupTransform Mark MarkConfig - MarkConfigExprOrSignalRef MarkDef MarkPropDefGradientstringnull MarkPropDefnumber @@ -393,20 +373,12 @@ Low-Level Schema Wrappers MarkType MergedStream Month - MultiSelection - MultiSelectionConfig MultiTimeUnit NamedData NonArgAggregateOp NonLayerRepeatSpec - NormalizedConcatSpecGenericSpec - NormalizedFacetSpec - NormalizedHConcatSpecGenericSpec - NormalizedSpec - NormalizedVConcatSpecGenericSpec NumericArrayMarkPropDef NumericMarkPropDef - NumericValueDef OrderFieldDef OrderValueDef Orient @@ -462,18 +434,11 @@ Low-Level Schema Wrappers SchemaBase SchemeParams SecondaryFieldDef - SelectionAnd - SelectionComposition SelectionConfig - SelectionDef - SelectionExtent SelectionInit SelectionInitInterval SelectionInitIntervalMapping SelectionInitMapping - SelectionNot - SelectionOr - SelectionPredicate SelectionResolution SequenceGenerator SequenceParams @@ -482,8 +447,6 @@ Low-Level Schema Wrappers ShapeDef SharedEncoding SingleDefUnitChannel - SingleSelection - SingleSelectionConfig SingleTimeUnit Sort SortArray @@ -525,9 +488,6 @@ Low-Level Schema Wrappers TooltipContent TopLevelFacetSpec TopLevelLayerSpec - TopLevelNormalizedConcatSpecGenericSpec - TopLevelNormalizedHConcatSpecGenericSpec - TopLevelNormalizedVConcatSpecGenericSpec TopLevelRepeatSpec TopLevelSpec TopLevelUnitSpec @@ -550,7 +510,6 @@ Low-Level Schema Wrappers ValueDefWithConditionMarkPropFieldOrDatumDefstringnull ValueDefWithConditionStringFieldDefText ValueDefnumber - ValueDefnumberExprRef ValueDefnumberwidthheightExprRef Vector2DateTime Vector2Vector2number diff --git a/doc/user_guide/interactions2.rst b/doc/user_guide/interactions2.rst index 1f141126b..0beba1469 100644 --- a/doc/user_guide/interactions2.rst +++ b/doc/user_guide/interactions2.rst @@ -31,7 +31,7 @@ We can create a variable parameter with a default value of 0.1 as follows: op_var = alt.parameter(value=0.1) -In order to use this variable in the chart specification, we explicitly add it to the chart using the :func:`add_parameter` function, and we can then reference the variable within the chart specification. Here we set the opacity using ``op_var``. +In order to use this variable in the chart specification, we explicitly add it to the chart using the :func:`Chart.add_parameter` method, and we can then reference the variable within the chart specification. Here we set the opacity using ``op_var``. .. altair-plot:: @@ -67,7 +67,7 @@ It's reasonable to ask whether all this effort is necessary. Here is a more nat color='Origin:N' ) -The benefit of using :func:`parameter` doesn't become apparent until we incorporate an additional component, such as in the following, where we `bind` the parameter to a slider widget. +The benefit of using :func:`alt.parameter` doesn't become apparent until we incorporate an additional component, such as in the following, where we `bind` the parameter to a slider widget. .. altair-plot:: @@ -87,9 +87,9 @@ The benefit of using :func:`parameter` doesn't become apparent until we incorpor op_var ) -Notice that the effects on the chart are produced entirely within your web browser. Once the Vega-Lite chart specification has been created by Altair, the result is an interactive chart that no longer needs a running Python environment. +Now we can dynamically change the opacity of the points in our chart, using the slider. A noteworthy aspect of this chart is that these effects are controlled entirely within your web browser. Once the Vega-Lite chart specification has been created by Altair, the result is an interactive chart, and that interactivity no longer requires a running Python environment. -The above example shows some of the common components used to produce interactivity in Altair: +The above example includes some of the common aspects of interactive charts produced in Altair: - Creating a variable parameter using ``alt.parameter``. - Attaching the parameter to a chart using ``add_parameter``. @@ -98,8 +98,8 @@ The above example shows some of the common components used to produce interactiv Some further aspects that we will see below include: - Creating a *selection* parameter. -- Using a parameter within a `condition`. -- Using a parameter within a `transform_filter`. +- Using a parameter within a ``condition``. +- Using a parameter within a ``transform_filter``. Using selection parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^ From 5d834345883a5210dce39986cf9637910b2b503c Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 3 Mar 2022 13:50:22 -0800 Subject: [PATCH 22/24] Update parameters documentation --- doc/user_guide/API.rst | 1 + doc/user_guide/interactions2.rst | 69 +++++++++++++++++--------------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/doc/user_guide/API.rst b/doc/user_guide/API.rst index 7490f4436..9053b8c0e 100644 --- a/doc/user_guide/API.rst +++ b/doc/user_guide/API.rst @@ -146,6 +146,7 @@ API Functions graticule hconcat layer + parameter repeat selection selection_interval diff --git a/doc/user_guide/interactions2.rst b/doc/user_guide/interactions2.rst index 0beba1469..c1e15b023 100644 --- a/doc/user_guide/interactions2.rst +++ b/doc/user_guide/interactions2.rst @@ -7,6 +7,12 @@ Parameters: Variables and Selections Interactivity in Altair is built around *parameters*, of which there are two types: variables and selections. We introduce these concepts through a series examples. +.. note:: + + This material was changed considerably with the release of Altair 5. In particular, Altair 4 had selections but not variables, and the term ``parameter`` first appeared in Altair 5. + +.. _basic variable: + Basic Example: Using a variable ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,13 +31,14 @@ Here is a simple scatter-plot created from the ``cars`` dataset: color='Origin:N' ) -We can create a variable parameter with a default value of 0.1 as follows: +We can create a variable parameter using :func:`parameter`, and assign that parameter a default value of 0.1 using the ``value`` property, as follows: .. altair-plot:: + :output: none op_var = alt.parameter(value=0.1) -In order to use this variable in the chart specification, we explicitly add it to the chart using the :func:`Chart.add_parameter` method, and we can then reference the variable within the chart specification. Here we set the opacity using ``op_var``. +In order to use this variable in the chart specification, we explicitly add it to the chart using the :meth:`Chart.add_parameter` method, and we can then reference the variable within the chart specification. Here we set the opacity using our ``op_var`` parameter. .. altair-plot:: @@ -50,7 +57,7 @@ In order to use this variable in the chart specification, we explicitly add it t op_var ) -It's reasonable to ask whether all this effort is necessary. Here is a more natural way to accomplish the same thing. We avoid the use of both :func:`alt.parameter` and :func:`add_parameter`. +It's reasonable to ask whether all this effort is necessary. Here is a more natural way to accomplish the same thing. We avoid the use of both :func:`alt.parameter` and ``add_parameter``. .. altair-plot:: @@ -67,7 +74,7 @@ It's reasonable to ask whether all this effort is necessary. Here is a more nat color='Origin:N' ) -The benefit of using :func:`alt.parameter` doesn't become apparent until we incorporate an additional component, such as in the following, where we `bind` the parameter to a slider widget. +The benefit of using :func:`alt.parameter` doesn't become apparent until we incorporate an additional component, such as in the following, where we use the ``bind`` property of the parameter, so that the parameter becomes bound to an input element. In this example, that input element is a slider widget. .. altair-plot:: @@ -87,24 +94,24 @@ The benefit of using :func:`alt.parameter` doesn't become apparent until we inco op_var ) -Now we can dynamically change the opacity of the points in our chart, using the slider. A noteworthy aspect of this chart is that these effects are controlled entirely within your web browser. Once the Vega-Lite chart specification has been created by Altair, the result is an interactive chart, and that interactivity no longer requires a running Python environment. +Now we can dynamically change the opacity of the points in our chart using the slider. A noteworthy aspect of this chart is that these effects are controlled entirely within your web browser. Once the Vega-Lite chart specification has been created by Altair, the result is an interactive chart, and that interactivity no longer requires a running Python environment. -The above example includes some of the common aspects of interactive charts produced in Altair: +The above example includes some aspects which occur frequently when creating interactive charts in Altair: -- Creating a variable parameter using ``alt.parameter``. -- Attaching the parameter to a chart using ``add_parameter``. -- Binding the parameter to an input widget using ``bind``. (In the above example, the input widget is a slider widget.) +- Creating a variable parameter using :func:`parameter`. +- Attaching the parameter to a chart using the :meth:`Chart.add_parameter` method. +- Binding the parameter to an input widget using the parameter's ``bind`` property. (In the above example, the input widget is a slider widget.) Some further aspects that we will see below include: - Creating a *selection* parameter. -- Using a parameter within a ``condition``. -- Using a parameter within a ``transform_filter``. +- Using a parameter within a :func:`condition`. +- Using a parameter within a :meth:`Chart.transform_filter`. Using selection parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^ -The basic syntax for adding a selection parameter to a chart is similar to the syntax for a variable parameter. Instead of creating the parameter using ``alt.parameter``, we will typically use ``alt.selection_interval`` or ``alt.selection_point``. +The basic syntax for adding a selection parameter to a chart is similar to the syntax for a variable parameter. Instead of creating the parameter using ``alt.parameter``, we will typically use ``alt.selection_interval`` or ``alt.selection_point``. Here is a basic example, again using the ``cars`` dataset: .. altair-plot:: @@ -123,7 +130,12 @@ The basic syntax for adding a selection parameter to a chart is similar to the s brush ) -If you click and drag on the above chart, you will see that the corresponding region gets highlighted. We have done two things so far: created a selection parameter using ``brush = alt.selection_interval()``, and attached that parameter to the chart, using ``add_parameter``. + +If you click and drag on the above chart, you will see that the corresponding region gets highlighted. + +So far this example is very similar to what we did in the :ref:`variable example `. Here we have done two things: we created a selection parameter using ``brush = alt.selection_interval()``, and we attached that parameter to the chart using ``add_parameter``. + +The line ``brush = alt.selection_interval()`` is equivalent to ``brush = alt.parameter(select="interval")``; we will typically use the ``selection_interval`` version, because it is shorter and because it matches the syntax that was used in Altair 4. Typically selection parameters will be used in conjunction with ``condition`` or with ``transform_filter``. Here are some possibilities. @@ -188,29 +200,20 @@ Some possible use cases for the above interactivity are not currently supported 2. It is not possible to use an encoding such as ``y=column_variable`` to then dynamically display different charts based on different column choices. Similar functionality could be created using for example ``ipywidgets``, but the resulting interactivity would be controlled by Python, and would not work for example as a stand-alone web page. The underlying reason this is not possible is that in Vega-Lite, the ``field`` property does not accept a parameter as value; see the `field Vega-Lite documentation `_. A first approximation of a workaround is given in the following example. .. altair-plot:: + import pandas as pd import altair as alt - from vega_datasets import data - iris = data.iris() - iris_long = iris.melt(id_vars=['sepalLength','species'],var_name='column') + df = pd.DataFrame({'col0':range(4), 'col1':list('ABAA'), 'col2':list('CDDC')}) + df_long = df.melt(id_vars=['col0'], var_name='column') - col_dropdown = alt.binding_select(options=list(set(iris_long['column']))) - col_select = alt.parameter(bind=col_dropdown, name="Column", value='sepalWidth') + col_dropdown = alt.binding_select(options=df_long['column'].unique()) + col_param = alt.parameter(bind=col_dropdown, name="ColumnParam", value='col1') - c = alt.Chart(iris_long).mark_circle().encode( - x = alt.X("sepalLength:Q", scale=alt.Scale(zero=False)), - y = alt.Y("value:Q",scale=alt.Scale(domain=[0,8]), title=None), - color = "species:N", + alt.Chart(df_long).mark_bar().encode( + x = "value:N", + y = "count()", ).transform_filter( - "datum.column == Column" - ) - - label = alt.Chart(iris_long).mark_text().encode( - x = alt.value(60), - y = alt.value(20), - text = alt.value("y-axis = " + col_select) - ) - - (c+label).add_parameter( - col_select + "datum.column == ColumnParam" + ).add_parameter( + col_param ) \ No newline at end of file From 2168430f9f475253e19ffd1bd105f13512d5ecb3 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 4 Mar 2022 13:31:17 -0800 Subject: [PATCH 23/24] Include new classes in API.rst --- doc/user_guide/API.rst | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/doc/user_guide/API.rst b/doc/user_guide/API.rst index 9053b8c0e..94f89230b 100644 --- a/doc/user_guide/API.rst +++ b/doc/user_guide/API.rst @@ -116,6 +116,9 @@ Encoding Channels XError2 XError2Value XErrorValue + XOffset + XOffsetDatum + XOffsetValue XValue Y Y2 @@ -126,6 +129,9 @@ Encoding Channels YError2 YError2Value YErrorValue + YOffset + YOffsetDatum + YOffsetValue YValue API Functions @@ -190,6 +196,8 @@ Low-Level Schema Wrappers BinParams BinTransform BindCheckbox + BindDirect + BindInput BindRadioSelect BindRange Binding @@ -226,6 +234,16 @@ Low-Level Schema Wrappers ConditionalAxisString ConditionalMarkPropFieldOrDatumDef ConditionalMarkPropFieldOrDatumDefTypeForShape + ConditionalParameterMarkPropFieldOrDatumDef + ConditionalParameterMarkPropFieldOrDatumDefTypeForShape + ConditionalParameterStringFieldDef + ConditionalParameterValueDefGradientstringnullExprRef + ConditionalParameterValueDefTextExprRef + ConditionalParameterValueDefnumber + ConditionalParameterValueDefnumberArrayExprRef + ConditionalParameterValueDefnumberExprRef + ConditionalParameterValueDefstringExprRef + ConditionalParameterValueDefstringnullExprRef ConditionalPredicateMarkPropFieldOrDatumDef ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape ConditionalPredicateStringFieldDef @@ -319,6 +337,7 @@ Low-Level Schema Wrappers FontStyle FontWeight Generator + GenericUnitSpecEncodingAnyMark GeoJsonFeature GeoJsonFeatureCollection Gradient @@ -337,6 +356,7 @@ Low-Level Schema Wrappers InlineDataset Interpolate IntervalSelectionConfig + IntervalSelectionConfigWithoutType JoinAggregateFieldDef JoinAggregateTransform JsonDataFormat @@ -357,6 +377,7 @@ Low-Level Schema Wrappers LinearGradient LocalMultiTimeUnit LocalSingleTimeUnit + Locale LoessTransform LogicalAndPredicate LogicalNotPredicate @@ -378,8 +399,11 @@ Low-Level Schema Wrappers NamedData NonArgAggregateOp NonLayerRepeatSpec + NonNormalizedSpec + NumberLocale NumericArrayMarkPropDef NumericMarkPropDef + OffsetDef OrderFieldDef OrderValueDef Orient @@ -387,9 +411,14 @@ Low-Level Schema Wrappers OverlayMarkDef Padding Parameter + ParameterExtent + ParameterName + ParameterPredicate Parse ParseValue PivotTransform + PointSelectionConfig + PointSelectionConfigWithoutType PolarDef Position2Def PositionDatumDef @@ -413,6 +442,7 @@ Low-Level Schema Wrappers RangeScheme RectConfig RegressionTransform + RelativeBandSize RepeatMapping RepeatRef RepeatSpec @@ -428,6 +458,8 @@ Low-Level Schema Wrappers ScaleBinParams ScaleBins ScaleConfig + ScaleDatumDef + ScaleFieldDef ScaleInterpolateEnum ScaleInterpolateParams ScaleResolveMap @@ -440,7 +472,9 @@ Low-Level Schema Wrappers SelectionInitInterval SelectionInitIntervalMapping SelectionInitMapping + SelectionParameter SelectionResolution + SelectionType SequenceGenerator SequenceParams SequentialMultiHue @@ -462,6 +496,7 @@ Low-Level Schema Wrappers StackTransform StandardType Step + StepFor Stream StringFieldDef StringFieldDefWithCondition @@ -478,6 +513,7 @@ Low-Level Schema Wrappers TickCount TimeInterval TimeIntervalStep + TimeLocale TimeUnit TimeUnitParams TimeUnitTransform @@ -487,11 +523,15 @@ Low-Level Schema Wrappers TitleOrient TitleParams TooltipContent + TopLevelConcatSpec TopLevelFacetSpec + TopLevelHConcatSpec TopLevelLayerSpec TopLevelRepeatSpec + TopLevelSelectionParameter TopLevelSpec TopLevelUnitSpec + TopLevelVConcatSpec TopoDataFormat Transform Type @@ -512,12 +552,16 @@ Low-Level Schema Wrappers ValueDefWithConditionStringFieldDefText ValueDefnumber ValueDefnumberwidthheightExprRef + VariableParameter + Vector10string + Vector12string Vector2DateTime Vector2Vector2number Vector2boolean Vector2number Vector2string Vector3number + Vector7string VegaLiteSchema ViewBackground ViewConfig From af0c3b4c1d27c366fb66fb6743aa15d5d30a56ce Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Fri, 4 Mar 2022 14:37:09 -0800 Subject: [PATCH 24/24] Examples involving offsets --- altair/examples/grouped_bar_chart2.py | 20 ++++++++++++++++++++ altair/examples/jitter_chart.py | 21 +++++++++++++++++++++ doc/user_guide/encoding.rst | 2 ++ 3 files changed, 43 insertions(+) create mode 100644 altair/examples/grouped_bar_chart2.py create mode 100644 altair/examples/jitter_chart.py diff --git a/altair/examples/grouped_bar_chart2.py b/altair/examples/grouped_bar_chart2.py new file mode 100644 index 000000000..74e955113 --- /dev/null +++ b/altair/examples/grouped_bar_chart2.py @@ -0,0 +1,20 @@ +""" +Grouped Bar Chart with xOffset +------------------------------ +Like :ref:`gallery_grouped_bar_chart`, this example shows a grouped bar chart. Whereas :ref:`gallery_grouped_bar_chart` used the ``column`` encoding channel, this example uses the ``xOffset`` encoding channel. This is adapted from a corresponding Vega-Lite Example: +`Grouped Bar Chart `_. +""" +# category: bar charts +import altair as alt +import pandas as pd + +source = pd.DataFrame({"Category":list("AAABBBCCC"), + "Group":list("xyzxyzxyz"), + "Value":[0.1, 0.6, 0.9, 0.7, 0.2, 1.1, 0.6, 0.1, 0.2]}) + +alt.Chart(source).mark_bar().encode( + x="Category:N", + y="Value:Q", + xOffset="Group:N", + color="Group:N" +) diff --git a/altair/examples/jitter_chart.py b/altair/examples/jitter_chart.py new file mode 100644 index 000000000..bbe5d8c58 --- /dev/null +++ b/altair/examples/jitter_chart.py @@ -0,0 +1,21 @@ +""" +Jitter Chart +------------ +In this chart, we encode the ``Cylinders`` column from the ``cars`` dataset in the ``y``-channel. Because most cars (all but seven) in this dataset have 4, 6, or 8 cylinders, the default presentation of this data would show most of the data concentrated on three horizontal lines. Furthermore, in that default presentation, it would be difficult to gauge the relative frequencies with which different values occur (because there would be so much overlap). To compensate for this, we use the ``yOffset`` channel to incorporate a random offset (jittering). This is adapted from a corresponding Vega-Lite Example: +`Dot Plot with Jittering `_. +""" +# category: scatter plots +import altair as alt +from vega_datasets import data + +source = data.cars() + +alt.Chart(source).mark_point().encode( + x='Horsepower:Q', + y='Cylinders:O', + yOffset='randomCalc:Q' +).transform_calculate( + randomCalc='random()' +).properties( + height=alt.Step(50) +) diff --git a/doc/user_guide/encoding.rst b/doc/user_guide/encoding.rst index d3a94c09a..3841d1234 100644 --- a/doc/user_guide/encoding.rst +++ b/doc/user_guide/encoding.rst @@ -57,6 +57,8 @@ xError :class:`XError` The x-axis error value N/A yError :class:`YError` The y-axis error value N/A xError2 :class:`XError2` The second x-axis error value N/A yError2 :class:`YError2` The second y-axis error value N/A +xOffset :class:`XOffset` Offset to the x position :ref:`gallery_grouped_bar_chart2` +yOffset :class:`YOffset` Offset to the y position :ref:`gallery_jitter_chart` theta :class:`Theta` The start arc angle :ref:`gallery_radial_chart` theta2 :class:`Theta2` The end arc angle (radian) :ref:`gallery_pacman_chart` ========== =================== ================================= ===================================