From cc2f9ec653b33679afdd3eac9d3254d123d13df9 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 23 Oct 2021 14:48:54 -0700 Subject: [PATCH 01/46] Include datum in channel wrappers --- altair/vegalite/v3/schema/channels.py | 17 + altair/vegalite/v4/schema/__init__.py | 4 +- altair/vegalite/v4/schema/channels.py | 9213 ++++-- altair/vegalite/v4/schema/core.py | 19679 ++++++------ altair/vegalite/v4/schema/mixins.py | 1096 +- .../vegalite/v4/schema/vega-lite-schema.json | 25776 ++++++++++++---- doc/user_guide/API.rst | 213 +- tools/generate_schema_wrapper.py | 99 +- 8 files changed, 37103 insertions(+), 18994 deletions(-) diff --git a/altair/vegalite/v3/schema/channels.py b/altair/vegalite/v3/schema/channels.py index 605bff320..73a9e73a4 100644 --- a/altair/vegalite/v3/schema/channels.py +++ b/altair/vegalite/v3/schema/channels.py @@ -78,6 +78,23 @@ def to_dict(self, validate=True, ignore=(), context=None): 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 + elif 'field' in datum and 'type' not in datum: + kwds = parse_shorthand(datum['field'], context.get('data', None)) + copy = self.copy(deep=['datum']) + copy.datum.update(kwds) + return super(DatumChannelMixin, copy).to_dict(validate=validate, + ignore=ignore, + context=context) + + class Color(FieldChannelMixin, core.StringFieldDefWithCondition): """Color schema wrapper diff --git a/altair/vegalite/v4/schema/__init__.py b/altair/vegalite/v4/schema/__init__.py index 733e70165..618a50350 100644 --- a/altair/vegalite/v4/schema/__init__.py +++ b/altair/vegalite/v4/schema/__init__.py @@ -1,5 +1,5 @@ # flake8: noqa from .core import * from .channels import * -SCHEMA_VERSION = 'v4.8.1' -SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v4.8.1.json' +SCHEMA_VERSION = 'v4.17.0' +SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v4.17.0.json' diff --git a/altair/vegalite/v4/schema/channels.py b/altair/vegalite/v4/schema/channels.py index 4b24444df..bf586d998 100644 --- a/altair/vegalite/v4/schema/channels.py +++ b/altair/vegalite/v4/schema/channels.py @@ -78,11 +78,29 @@ def to_dict(self, validate=True, ignore=(), context=None): context=context) -class Color(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): - """Color schema wrapper +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 + elif 'field' in datum and 'type' not in datum: + kwds = parse_shorthand(datum['field'], context.get('data', None)) + copy = self.copy(deep=['datum']) + copy.datum.update(kwds) + 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:`` + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -90,13 +108,24 @@ class Color(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -118,7 +147,8 @@ class Color(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionGradientstringnull` + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -127,24 +157,22 @@ class Color(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): 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 + 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``. + **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. + 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. @@ -170,30 +198,25 @@ class Color(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): 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. + 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"`` @@ -204,8 +227,7 @@ class Color(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -233,80 +255,199 @@ class Color(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "angle" - def __init__(self, shorthand=Undefined, aggregate=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, bin=bin, + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, condition=condition, field=field, legend=legend, scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) -class ColorValue(ValueChannelMixin, core.ColorGradientValueWithCondition): - """ColorValue schema wrapper +class AngleDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """AngleDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(AngleDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class AngleDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """AngleDatumValue schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, - :class:`ValueConditionGradientstringnull`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(:class:`Gradient`, string, None) + 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 = "color" + _encoding_name = "angle" def __init__(self, value, condition=Undefined, **kwds): - super(ColorValue, self).__init__(value=value, condition=condition, **kwds) + super(AngleDatumValue, self).__init__(value=value, condition=condition, **kwds) -class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): - """Column schema wrapper +class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): + """Color schema wrapper Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -314,27 +455,24 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + 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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. - **Default value:** ``"all"``. + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -356,66 +494,87 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): **See also:** `bin `__ documentation. - center : boolean - Boolean flag indicating if facet's subviews should be centered relative to their - respective rows or columns. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. - **Default value:** ``false`` + **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 + 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 : :class:`Header` - An object defining properties of a facet's header. - sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + **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 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. + 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`` is not supported for ``row`` and ``column``. - spacing : float - The spacing in pixels between facet's sub-views. + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. - **Default value** : Depends on ``"spacing"`` property of `the view composition - configuration `__ ( - ``20`` by default) + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -443,58 +602,198 @@ class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "color" - def __init__(self, shorthand=Undefined, aggregate=Undefined, align=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, bin=bin, - center=center, field=field, header=header, sort=sort, - spacing=spacing, timeUnit=timeUnit, title=title, type=type, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) -class Detail(FieldChannelMixin, core.FieldDefWithoutScale): - """Detail schema wrapper +class ColorDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull): + """ColorDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(ColorDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class ColorDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """ColorDatumValue 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 selection 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(ColorDatumValue, self).__init__(value=value, condition=condition, **kwds) + + +class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): + """Column schema wrapper Mapping(required=[shorthand]) - Definition object for a data field, its type and transformation of an encoding channel. Attributes ---------- @@ -502,14 +801,38 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + 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"``. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -530,27 +853,59 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): **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 + 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``. + **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 : :class:`Header` + 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -578,55 +933,80 @@ class Detail(FieldChannelMixin, core.FieldDefWithoutScale): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "column" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Detail, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, type=type, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, band=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, band=band, + bin=bin, center=center, field=field, header=header, sort=sort, + spacing=spacing, timeUnit=timeUnit, title=title, type=type, **kwds) -class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): - """Facet schema wrapper +class Description(FieldChannelMixin, core.StringFieldDefWithCondition): + """Description schema wrapper Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -634,31 +1014,25 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + 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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. - **Default value:** ``"all"``. - bin : anyOf(boolean, :class:`BinParams`, None) + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -679,16 +1053,427 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): **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. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a selection 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:`Dictunknown`) + 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``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + 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, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + labelExpr=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Description, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, labelExpr=labelExpr, 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 selection 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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Detail, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, 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"``. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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`) @@ -703,38 +1488,32 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): 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`` ). + 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) + 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 + 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``. + **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 : :class:`Header` An object defining properties of a facet's header. sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) @@ -743,38 +1522,1130 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): 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. + 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. + 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 + 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, band=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, band=band, + 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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 selection 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, band=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, band=band, 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 + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(FillDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class FillDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """FillDatumValue 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 selection 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(FillDatumValue, 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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 selection 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, band=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, band=band, 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 + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(FillOpacityDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, + **kwds) + + +class FillOpacityDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """FillOpacityDatumValue 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 selection 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(FillOpacityDatumValue, 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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 selection 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:`Dictunknown`) + 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``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + 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, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + labelExpr=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Href, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, labelExpr=labelExpr, 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 selection 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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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) @@ -802,60 +2673,76 @@ class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "key" - def __init__(self, shorthand=Undefined, aggregate=Undefined, align=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, bin=bin, - bounds=bounds, center=center, columns=columns, field=field, - header=header, sort=sort, spacing=spacing, timeUnit=timeUnit, - title=title, type=type, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Key, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, type=type, **kwds) -class Fill(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): - """Fill schema wrapper +class Latitude(FieldChannelMixin, core.LatLongFieldDef): + """Latitude schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` Attributes ---------- @@ -863,14 +2750,25 @@ class Fill(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -891,94 +2789,24 @@ class Fill(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionGradientstringnull` - One or more value definition(s) with `a selection 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 + 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. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -1005,82 +2833,187 @@ class Fill(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "latitude" - def __init__(self, shorthand=Undefined, aggregate=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, bin=bin, - condition=condition, field=field, legend=legend, scale=scale, - sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Latitude, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, type=type, **kwds) -class FillValue(ValueChannelMixin, core.ColorGradientValueWithCondition): - """FillValue schema wrapper +class LatitudeDatum(DatumChannelMixin, core.DatumDef): + """LatitudeDatum schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, - :class:`ValueConditionGradientstringnull`) - A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(:class:`Gradient`, string, None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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, band=Undefined, type=Undefined, **kwds): + super(LatitudeDatum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class LatitudeDatumValue(ValueChannelMixin, core.NumericValueDef): + """LatitudeDatumValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + 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). """ _class_is_valid_at_instantiation = False - _encoding_name = "fill" + _encoding_name = "latitude" - def __init__(self, value, condition=Undefined, **kwds): - super(FillValue, self).__init__(value=value, condition=condition, **kwds) + def __init__(self, value, **kwds): + super(LatitudeDatumValue, self).__init__(value=value, **kwds) -class FillOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): - """FillOpacity schema wrapper +class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): + """Latitude2 schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` + 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 ---------- @@ -1088,14 +3021,25 @@ class FillOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -1116,94 +3060,24 @@ class FillOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionnumber` - One or more value definition(s) with `a selection 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 + 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. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -1230,81 +3104,128 @@ class FillOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + """ + _class_is_valid_at_instantiation = False + _encoding_name = "latitude2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Latitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Latitude2Datum(DatumChannelMixin, core.DatumDef): + """Latitude2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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, 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, bin=bin, - condition=condition, field=field, legend=legend, scale=scale, - sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + _encoding_name = "latitude2" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(Latitude2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) -class FillOpacityValue(ValueChannelMixin, core.NumericValueWithCondition): - """FillOpacityValue schema wrapper +class Latitude2DatumValue(ValueChannelMixin, core.PositionValueDef): + """Latitude2DatumValue schema wrapper - Mapping(required=[]) + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionnumber`) - A field definition or one or more value definition(s) with a selection predicate. - value : float + 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 = "fillOpacity" + _encoding_name = "latitude2" - def __init__(self, value, condition=Undefined, **kwds): - super(FillOpacityValue, self).__init__(value=value, condition=condition, **kwds) + def __init__(self, value, **kwds): + super(Latitude2DatumValue, self).__init__(value=value, **kwds) -class Href(FieldChannelMixin, core.StringFieldDefWithCondition): - """Href schema wrapper +class Longitude(FieldChannelMixin, core.LatLongFieldDef): + """Longitude schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` Attributes ---------- @@ -1312,14 +3233,25 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -1329,84 +3261,35 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): 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 : :class:`ValueConditionstring` - One or more value definition(s) with `a selection 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, Mapping(required=[])) - 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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. - - **Default value:** Derived from `numberFormat - `__ config for number - format and from `timeFormat - `__ config for time - format. - formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). + 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:** + **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. - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. - labelExpr : string - `Vega expression `__ for customizing - labels text. + **See also:** `field `__ + documentation. - **Note:** The label text and value can be assessed via the ``label`` and ``value`` - properties of the axis's backing ``datum`` object. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -1433,82 +3316,187 @@ class Href(FieldChannelMixin, core.StringFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "longitude" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Href, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, - condition=condition, field=field, format=format, - formatType=formatType, labelExpr=labelExpr, timeUnit=timeUnit, - title=title, type=type, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Longitude, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, type=type, **kwds) -class HrefValue(ValueChannelMixin, core.StringValueWithCondition): - """HrefValue schema wrapper +class LongitudeDatum(DatumChannelMixin, core.DatumDef): + """LongitudeDatum schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionstringnull`) - A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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, band=Undefined, type=Undefined, **kwds): + super(LongitudeDatum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class LongitudeDatumValue(ValueChannelMixin, core.NumericValueDef): + """LongitudeDatumValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + 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). """ _class_is_valid_at_instantiation = False - _encoding_name = "href" + _encoding_name = "longitude" - def __init__(self, value, condition=Undefined, **kwds): - super(HrefValue, self).__init__(value=value, condition=condition, **kwds) + def __init__(self, value, **kwds): + super(LongitudeDatumValue, self).__init__(value=value, **kwds) -class Key(FieldChannelMixin, core.FieldDefWithoutScale): - """Key schema wrapper +class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): + """Longitude2 schema wrapper Mapping(required=[shorthand]) - Definition object for a data field, its type and transformation of an encoding channel. + 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 ---------- @@ -1516,14 +3504,25 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -1546,25 +3545,22 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -1591,56 +3587,130 @@ class Key(FieldChannelMixin, core.FieldDefWithoutScale): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + """ + _class_is_valid_at_instantiation = False + _encoding_name = "longitude2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Longitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Longitude2Datum(DatumChannelMixin, core.DatumDef): + """Longitude2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "longitude2" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(Longitude2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Key, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, type=type, **kwds) +class Longitude2DatumValue(ValueChannelMixin, core.PositionValueDef): + """Longitude2DatumValue schema wrapper -class Latitude(FieldChannelMixin, core.LatLongFieldDef): - """Latitude 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(Longitude2DatumValue, 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 ---------- @@ -1648,14 +3718,25 @@ class Latitude(FieldChannelMixin, core.LatLongFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : None + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -1676,27 +3757,87 @@ class Latitude(FieldChannelMixin, core.LatLongFieldDef): **See also:** `bin `__ documentation. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -1723,80 +3864,199 @@ class Latitude(FieldChannelMixin, core.LatLongFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : enum('quantitative') - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "opacity" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Latitude, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, type=type, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) -class LatitudeValue(ValueChannelMixin, core.NumberValueDef): - """LatitudeValue schema wrapper +class OpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """OpacityDatum schema wrapper - Mapping(required=[value]) - Definition object for a constant value (primitive value or gradient definition) of an - encoding channel. + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- - value : float + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(OpacityDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, + **kwds) + + +class OpacityDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """OpacityDatumValue 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 selection 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 = "latitude" + _encoding_name = "opacity" - def __init__(self, value, **kwds): - super(LatitudeValue, self).__init__(value=value, **kwds) + def __init__(self, value, condition=Undefined, **kwds): + super(OpacityDatumValue, self).__init__(value=value, condition=condition, **kwds) -class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): - """Latitude2 schema wrapper +class Order(FieldChannelMixin, core.OrderFieldDef): + """Order 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 ---------- @@ -1804,14 +4064,25 @@ class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : None + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -1834,25 +4105,24 @@ class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -1879,40 +4149,105 @@ class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): 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 = "latitude2" + _encoding_name = "order" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(Latitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, + **kwds): + super(Order, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, sort=sort, timeUnit=timeUnit, title=title, type=type, + **kwds) -class Latitude2Value(ValueChannelMixin, core.NumberValueDef): - """Latitude2Value schema wrapper +class OrderValue(ValueChannelMixin, core.OrderValueDef): + """OrderValue schema wrapper Mapping(required=[value]) - Definition object for a constant value (primitive value or gradient definition) of an - encoding channel. Attributes ---------- - value : float + 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 selection 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 = "latitude2" + _encoding_name = "order" - def __init__(self, value, **kwds): - super(Latitude2Value, self).__init__(value=value, **kwds) + def __init__(self, value, condition=Undefined, **kwds): + super(OrderValue, self).__init__(value=value, condition=condition, **kwds) -class Longitude(FieldChannelMixin, core.LatLongFieldDef): - """Longitude schema wrapper +class Radius(FieldChannelMixin, core.PositionFieldDefBase): + """Radius schema wrapper Mapping(required=[shorthand]) @@ -1922,14 +4257,25 @@ class Longitude(FieldChannelMixin, core.LatLongFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : None + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -1952,25 +4298,93 @@ class Longitude(FieldChannelMixin, core.LatLongFieldDef): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -1997,54 +4411,202 @@ class Longitude(FieldChannelMixin, core.LatLongFieldDef): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : enum('quantitative') - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "radius" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, 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 + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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. - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Longitude, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, type=type, **kwds) + **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. + 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, band=Undefined, scale=Undefined, stack=Undefined, type=Undefined, **kwds): + super(RadiusDatum, self).__init__(datum=datum, band=band, scale=scale, stack=stack, type=type, + **kwds) -class LongitudeValue(ValueChannelMixin, core.NumberValueDef): - """LongitudeValue schema wrapper + +class RadiusDatumValue(ValueChannelMixin, core.PositionValueDef): + """RadiusDatumValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -2053,20 +4615,20 @@ class LongitudeValue(ValueChannelMixin, core.NumberValueDef): Attributes ---------- - value : float + 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 = "longitude" + _encoding_name = "radius" def __init__(self, value, **kwds): - super(LongitudeValue, self).__init__(value=value, **kwds) + super(RadiusDatumValue, self).__init__(value=value, **kwds) -class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): - """Longitude2 schema wrapper +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. @@ -2078,13 +4640,24 @@ class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : None A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -2108,25 +4681,22 @@ class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -2155,16 +4725,102 @@ class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): defined, axis/header/legend title will be used. """ _class_is_valid_at_instantiation = False - _encoding_name = "longitude2" + _encoding_name = "radius2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Radius2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Radius2Datum(DatumChannelMixin, core.DatumDef): + """Radius2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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`` ). - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(Longitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + **See also:** `type `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "radius2" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(Radius2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) -class Longitude2Value(ValueChannelMixin, core.NumberValueDef): - """Longitude2Value schema wrapper +class Radius2DatumValue(ValueChannelMixin, core.PositionValueDef): + """Radius2DatumValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -2173,23 +4829,22 @@ class Longitude2Value(ValueChannelMixin, core.NumberValueDef): Attributes ---------- - value : float + 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" + _encoding_name = "radius2" def __init__(self, value, **kwds): - super(Longitude2Value, self).__init__(value=value, **kwds) + super(Radius2DatumValue, self).__init__(value=value, **kwds) -class Opacity(FieldChannelMixin, core.NumericFieldDefWithCondition): - """Opacity schema wrapper +class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): + """Row schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` Attributes ---------- @@ -2197,13 +4852,37 @@ class Opacity(FieldChannelMixin, core.NumericFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + 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"``. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -2225,94 +4904,59 @@ class Opacity(FieldChannelMixin, core.NumericFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionnumber` - One or more value definition(s) with `a selection or a test predicate - `__. + center : boolean + Boolean flag indicating if facet's subviews should be centered relative to their + respective rows or columns. - **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. + **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 + 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` + **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 : :class:`Header` + 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 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. + 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`` and sorting by another channel is not supported for ``row`` and - ``column``. + **Note:** ``null`` is not supported for ``row`` and ``column``. + spacing : float + The spacing in pixels between facet's sub-views. - **See also:** `sort `__ - documentation. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -2340,79 +4984,80 @@ class Opacity(FieldChannelMixin, core.NumericFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they 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, 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, bin=bin, - condition=condition, field=field, legend=legend, scale=scale, - sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) - - -class OpacityValue(ValueChannelMixin, core.NumericValueWithCondition): - """OpacityValue schema wrapper + 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``. - Mapping(required=[]) + **Default value:** - Attributes - ---------- + 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`` ). - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionnumber`) - A field definition or one or more value definition(s) with a selection predicate. - value : float - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + **See also:** `type `__ + documentation. """ _class_is_valid_at_instantiation = False - _encoding_name = "opacity" + _encoding_name = "row" - def __init__(self, value, condition=Undefined, **kwds): - super(OpacityValue, self).__init__(value=value, condition=condition, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, band=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, band=band, + bin=bin, center=center, field=field, header=header, sort=sort, + spacing=spacing, timeUnit=timeUnit, title=title, type=type, **kwds) -class Order(FieldChannelMixin, core.OrderFieldDef): - """Order schema wrapper +class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull): + """Shape schema wrapper Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -2420,14 +5065,25 @@ class Order(FieldChannelMixin, core.OrderFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -2448,29 +5104,87 @@ class Order(FieldChannelMixin, core.OrderFieldDef): **See also:** `bin `__ documentation. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a selection 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 + 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"``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -2497,78 +5211,201 @@ class Order(FieldChannelMixin, core.OrderFieldDef): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "shape" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Order, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + super(Shape, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) -class OrderValue(ValueChannelMixin, core.NumberValueDef): - """OrderValue schema wrapper +class ShapeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefstringnull): + """ShapeDatum schema wrapper - Mapping(required=[value]) - Definition object for a constant value (primitive value or gradient definition) of an - encoding channel. + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- - value : float + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(ShapeDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class ShapeDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull): + """ShapeDatumValue 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 selection 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 = "order" + _encoding_name = "shape" - def __init__(self, value, **kwds): - super(OrderValue, self).__init__(value=value, **kwds) + def __init__(self, value, condition=Undefined, **kwds): + super(ShapeDatumValue, self).__init__(value=value, condition=condition, **kwds) -class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): - """Row schema wrapper +class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """Size schema wrapper Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -2576,27 +5413,24 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + 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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. - **Default value:** ``"all"``. + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -2618,66 +5452,87 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): **See also:** `bin `__ documentation. - center : boolean - Boolean flag indicating if facet's subviews should be centered relative to their - respective rows or columns. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. - **Default value:** ``false`` + **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 + 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 : :class:`Header` - An object defining properties of a facet's header. - sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + **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 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. + 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`` is not supported for ``row`` and ``column``. - spacing : float - The spacing in pixels between facet's sub-views. + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. - **Default value** : Depends on ``"spacing"`` property of `the view composition - configuration `__ ( - ``20`` by default) + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -2705,58 +5560,199 @@ class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "size" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) - def __init__(self, shorthand=Undefined, aggregate=Undefined, align=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, bin=bin, - center=center, field=field, header=header, sort=sort, spacing=spacing, - timeUnit=timeUnit, title=title, type=type, **kwds) +class SizeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """SizeDatum schema wrapper -class Shape(FieldChannelMixin, core.ShapeFieldDefWithCondition): - """Shape schema wrapper + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(SizeDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class SizeDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """SizeDatumValue 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 selection 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(SizeDatumValue, self).__init__(value=value, condition=condition, **kwds) + + +class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): + """Stroke schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -2764,13 +5760,24 @@ class Shape(FieldChannelMixin, core.ShapeFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -2792,7 +5799,8 @@ class Shape(FieldChannelMixin, core.ShapeFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionstringnull` + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -2801,24 +5809,22 @@ class Shape(FieldChannelMixin, core.ShapeFieldDefWithCondition): 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 + 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``. + **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. + 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. @@ -2844,30 +5850,25 @@ class Shape(FieldChannelMixin, core.ShapeFieldDefWithCondition): 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. + 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"`` @@ -2878,8 +5879,7 @@ class Shape(FieldChannelMixin, core.ShapeFieldDefWithCondition): 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -2896,92 +5896,211 @@ class Shape(FieldChannelMixin, core.ShapeFieldDefWithCondition): parentheses (e.g., ``"Profit (binned)"``, ``"Transaction Date (year-month)"`` ). Otherwise, the title is simply the field name. - **Notes** : + **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, band=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, band=band, 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 + ---------- - 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 - `__. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. - 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection 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. + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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, 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, bin=bin, - condition=condition, field=field, legend=legend, scale=scale, - sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + _encoding_name = "stroke" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(StrokeDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) -class ShapeValue(ValueChannelMixin, core.ShapeValueWithCondition): - """ShapeValue schema wrapper +class StrokeDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """StrokeDatumValue schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDefTypeForShape`, - :class:`ValueConditionstringnull`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) + 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 = "shape" + _encoding_name = "stroke" def __init__(self, value, condition=Undefined, **kwds): - super(ShapeValue, self).__init__(value=value, condition=condition, **kwds) + super(StrokeDatumValue, self).__init__(value=value, condition=condition, **kwds) -class Size(FieldChannelMixin, core.NumericFieldDefWithCondition): - """Size schema wrapper +class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """StrokeDash schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -2989,13 +6108,24 @@ class Size(FieldChannelMixin, core.NumericFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -3017,7 +6147,8 @@ class Size(FieldChannelMixin, core.NumericFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionnumber` + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -3026,24 +6157,22 @@ class Size(FieldChannelMixin, core.NumericFieldDefWithCondition): 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 + 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``. + **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. + 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. @@ -3069,30 +6198,25 @@ class Size(FieldChannelMixin, core.NumericFieldDefWithCondition): 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. + 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"`` @@ -3103,8 +6227,7 @@ class Size(FieldChannelMixin, core.NumericFieldDefWithCondition): 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -3132,80 +6255,200 @@ class Size(FieldChannelMixin, core.NumericFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "strokeDash" - def __init__(self, shorthand=Undefined, aggregate=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, bin=bin, - condition=condition, field=field, legend=legend, scale=scale, - sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StrokeDashDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """StrokeDashDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection 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. + 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``. -class SizeValue(ValueChannelMixin, core.NumericValueWithCondition): - """SizeValue schema wrapper + **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, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(StrokeDashDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, + **kwds) + + +class StrokeDashDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """StrokeDashDatumValue schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionnumber`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : float + 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 = "size" + _encoding_name = "strokeDash" def __init__(self, value, condition=Undefined, **kwds): - super(SizeValue, self).__init__(value=value, condition=condition, **kwds) + super(StrokeDashDatumValue, self).__init__(value=value, condition=condition, **kwds) -class Stroke(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): - """Stroke schema wrapper +class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """StrokeOpacity schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -3213,13 +6456,24 @@ class Stroke(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -3241,7 +6495,8 @@ class Stroke(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionGradientstringnull` + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -3250,24 +6505,22 @@ class Stroke(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): 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 + 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``. + **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. + 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. @@ -3293,30 +6546,25 @@ class Stroke(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): 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. + 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"`` @@ -3327,8 +6575,7 @@ class Stroke(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -3356,81 +6603,201 @@ class Stroke(FieldChannelMixin, core.ColorGradientFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "strokeOpacity" - def __init__(self, shorthand=Undefined, aggregate=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, bin=bin, - condition=condition, field=field, legend=legend, scale=scale, - sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, + 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 + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(StrokeOpacityDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, + **kwds) -class StrokeValue(ValueChannelMixin, core.ColorGradientValueWithCondition): - """StrokeValue schema wrapper +class StrokeOpacityDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """StrokeOpacityDatumValue schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, - :class:`ValueConditionGradientstringnull`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(:class:`Gradient`, string, None) + 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 = "stroke" + _encoding_name = "strokeOpacity" def __init__(self, value, condition=Undefined, **kwds): - super(StrokeValue, self).__init__(value=value, condition=condition, **kwds) + super(StrokeOpacityDatumValue, self).__init__(value=value, condition=condition, **kwds) -class StrokeDash(FieldChannelMixin, core.NumericArrayFieldDefWithCondition): - """StrokeDash schema wrapper +class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """StrokeWidth schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -3438,13 +6805,24 @@ class StrokeDash(FieldChannelMixin, core.NumericArrayFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -3466,7 +6844,8 @@ class StrokeDash(FieldChannelMixin, core.NumericArrayFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionnumber` + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -3475,24 +6854,22 @@ class StrokeDash(FieldChannelMixin, core.NumericArrayFieldDefWithCondition): 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 + 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``. + **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. + 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. @@ -3518,30 +6895,25 @@ class StrokeDash(FieldChannelMixin, core.NumericArrayFieldDefWithCondition): 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. + 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"`` @@ -3552,8 +6924,7 @@ class StrokeDash(FieldChannelMixin, core.NumericArrayFieldDefWithCondition): 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -3581,80 +6952,200 @@ class StrokeDash(FieldChannelMixin, core.NumericArrayFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "strokeWidth" - def __init__(self, shorthand=Undefined, aggregate=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, bin=bin, - condition=condition, field=field, legend=legend, scale=scale, - sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, 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 + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(StrokeWidthDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, + **kwds) -class StrokeDashValue(ValueChannelMixin, core.NumericArrayValueDefWithCondition): - """StrokeDashValue schema wrapper +class StrokeWidthDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """StrokeWidthDatumValue schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionnumber`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : List(float) + 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 = "strokeDash" + _encoding_name = "strokeWidth" def __init__(self, value, condition=Undefined, **kwds): - super(StrokeDashValue, self).__init__(value=value, condition=condition, **kwds) + super(StrokeWidthDatumValue, self).__init__(value=value, condition=condition, **kwds) -class StrokeOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): - """StrokeOpacity schema wrapper +class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefText): + """Text schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -3662,14 +7153,25 @@ class StrokeOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -3690,7 +7192,8 @@ class StrokeOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionnumber` + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -3699,85 +7202,59 @@ class StrokeOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): 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 + 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 - `__. + **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:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. - **Default value:** If undefined, default `scale properties - `__ are applied. - **See also:** `scale `__ - documentation. - sort : :class:`Sort` - Sort order for the encoded field. + * 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 `__. - For continuous fields (quantitative or temporal), ``sort`` can be either - ``"ascending"`` or ``"descending"``. + See the `format documentation `__ + for more examples. - 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. + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. - **Default value:** ``"ascending"`` + **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 + `__. - **Note:** ``null`` and sorting by another channel is not supported for ``row`` and - ``column``. + **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``. + labelExpr : string + `Vega expression `__ for customizing + labels text. - **See also:** `sort `__ - documentation. + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -3805,81 +7282,237 @@ class StrokeOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "text" - def __init__(self, shorthand=Undefined, aggregate=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, bin=bin, - condition=condition, field=field, legend=legend, - scale=scale, sort=sort, timeUnit=timeUnit, title=title, - type=type, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + labelExpr=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Text, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, labelExpr=labelExpr, 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 + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) + One or more value definition(s) with `a selection 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:`Dictunknown`) + 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``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + 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, band=Undefined, condition=Undefined, format=Undefined, + formatType=Undefined, labelExpr=Undefined, type=Undefined, **kwds): + super(TextDatum, self).__init__(datum=datum, band=band, condition=condition, format=format, + formatType=formatType, labelExpr=labelExpr, type=type, **kwds) -class StrokeOpacityValue(ValueChannelMixin, core.NumericValueWithCondition): - """StrokeOpacityValue schema wrapper +class TextDatumValue(ValueChannelMixin, core.ValueDefWithConditionStringFieldDefText): + """TextDatumValue schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionnumber`) + condition : anyOf(:class:`ConditionalStringFieldDef`, + :class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : float + 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 = "strokeOpacity" + _encoding_name = "text" def __init__(self, value, condition=Undefined, **kwds): - super(StrokeOpacityValue, self).__init__(value=value, condition=condition, **kwds) + super(TextDatumValue, self).__init__(value=value, condition=condition, **kwds) -class StrokeWidth(FieldChannelMixin, core.NumericFieldDefWithCondition): - """StrokeWidth schema wrapper +class Theta(FieldChannelMixin, core.PositionFieldDefBase): + """Theta schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` Attributes ---------- @@ -3887,14 +7520,25 @@ class StrokeWidth(FieldChannelMixin, core.NumericFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -3915,39 +7559,21 @@ class StrokeWidth(FieldChannelMixin, core.NumericFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionnumber` - One or more value definition(s) with `a selection 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 + 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. + **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 @@ -3967,30 +7593,25 @@ class StrokeWidth(FieldChannelMixin, core.NumericFieldDefWithCondition): 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. + 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"`` @@ -3999,10 +7620,34 @@ class StrokeWidth(FieldChannelMixin, core.NumericFieldDefWithCondition): **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -4030,80 +7675,227 @@ class StrokeWidth(FieldChannelMixin, core.NumericFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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" + _encoding_name = "theta" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(StrokeWidth, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, - condition=condition, field=field, legend=legend, scale=scale, - sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + super(Theta, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, scale=scale, sort=sort, stack=stack, timeUnit=timeUnit, + title=title, type=type, **kwds) -class StrokeWidthValue(ValueChannelMixin, core.NumericValueWithCondition): - """StrokeWidthValue schema wrapper +class ThetaDatum(DatumChannelMixin, core.PositionDatumDefBase): + """ThetaDatum schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionnumber`) - A field definition or one or more value definition(s) with a selection predicate. - value : float + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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. + 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, band=Undefined, scale=Undefined, stack=Undefined, type=Undefined, **kwds): + super(ThetaDatum, self).__init__(datum=datum, band=band, scale=scale, stack=stack, type=type, + **kwds) + + +class ThetaDatumValue(ValueChannelMixin, core.PositionValueDef): + """ThetaDatumValue 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 = "strokeWidth" + _encoding_name = "theta" - def __init__(self, value, condition=Undefined, **kwds): - super(StrokeWidthValue, self).__init__(value=value, condition=condition, **kwds) + def __init__(self, value, **kwds): + super(ThetaDatumValue, self).__init__(value=value, **kwds) -class Text(FieldChannelMixin, core.TextFieldDefWithCondition): - """Text schema wrapper +class Theta2(FieldChannelMixin, core.SecondaryFieldDef): + """Theta2 schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` + 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 ---------- @@ -4111,14 +7903,25 @@ class Text(FieldChannelMixin, core.TextFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -4139,73 +7942,24 @@ class Text(FieldChannelMixin, core.TextFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionText` - One or more value definition(s) with `a selection 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 + 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, Mapping(required=[])) - 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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. - - **Default value:** Derived from `numberFormat - `__ config for number - format and from `timeFormat - `__ config for time - format. - formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** - - - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. - labelExpr : string - `Vega expression `__ for customizing - labels text. - - **Note:** The label text and value can be assessed via the ``label`` and ``value`` - properties of the axis's backing ``datum`` object. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -4232,82 +7986,130 @@ class Text(FieldChannelMixin, core.TextFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + """ + _class_is_valid_at_instantiation = False + _encoding_name = "theta2" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Theta2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Theta2Datum(DatumChannelMixin, core.DatumDef): + """Theta2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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, bin=Undefined, condition=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Text, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, - condition=condition, field=field, format=format, - formatType=formatType, labelExpr=labelExpr, timeUnit=timeUnit, - title=title, type=type, **kwds) + _encoding_name = "theta2" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(Theta2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) -class TextValue(ValueChannelMixin, core.TextValueWithCondition): - """TextValue schema wrapper +class Theta2DatumValue(ValueChannelMixin, core.PositionValueDef): + """Theta2DatumValue schema wrapper - Mapping(required=[]) + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. Attributes ---------- - condition : anyOf(:class:`ConditionalStringFieldDef`, :class:`ValueConditionText`) - A field definition or one or more value definition(s) with a selection predicate. - value : :class:`Text` + 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 = "text" + _encoding_name = "theta2" - def __init__(self, value, condition=Undefined, **kwds): - super(TextValue, self).__init__(value=value, condition=condition, **kwds) + def __init__(self, value, **kwds): + super(Theta2DatumValue, self).__init__(value=value, **kwds) class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): """Tooltip schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -4315,14 +8117,25 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -4343,7 +8156,8 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionstring` + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -4352,38 +8166,36 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): 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 + 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, Mapping(required=[])) + **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:`Dictunknown`) 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 + `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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. + 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 @@ -4391,15 +8203,13 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): `__ config for time format. formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. - - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. + **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``. labelExpr : string `Vega expression `__ for customizing labels text. @@ -4408,8 +8218,7 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): properties of the axis's backing ``datum`` object. 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -4437,38 +8246,59 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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. @@ -4476,16 +8306,16 @@ class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): _class_is_valid_at_instantiation = False _encoding_name = "tooltip" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Tooltip, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + labelExpr=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Tooltip, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, condition=condition, field=field, format=format, formatType=formatType, labelExpr=labelExpr, timeUnit=timeUnit, title=title, type=type, **kwds) -class TooltipValue(ValueChannelMixin, core.StringValueWithCondition): +class TooltipValue(ValueChannelMixin, core.StringValueDefWithCondition): """TooltipValue schema wrapper Mapping(required=[]) @@ -4493,9 +8323,11 @@ class TooltipValue(ValueChannelMixin, core.StringValueWithCondition): Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionstringnull`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) + 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). @@ -4511,7 +8343,8 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): """Url schema wrapper Mapping(required=[shorthand]) - A FieldDef with Condition :raw-html:`` + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- @@ -4519,14 +8352,25 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -4547,7 +8391,8 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionstring` + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -4556,38 +8401,36 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): 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 + 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, Mapping(required=[])) + **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:`Dictunknown`) 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 + `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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. + 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 @@ -4595,15 +8438,13 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): `__ config for time format. formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. - **Default value:** - - - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. + **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``. labelExpr : string `Vega expression `__ for customizing labels text. @@ -4612,8 +8453,7 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): properties of the axis's backing ``datum`` object. 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -4641,38 +8481,59 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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. @@ -4680,16 +8541,16 @@ class Url(FieldChannelMixin, core.StringFieldDefWithCondition): _class_is_valid_at_instantiation = False _encoding_name = "url" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, - timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): - super(Url, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + labelExpr=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Url, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, condition=condition, field=field, format=format, formatType=formatType, labelExpr=labelExpr, timeUnit=timeUnit, title=title, type=type, **kwds) -class UrlValue(ValueChannelMixin, core.StringValueWithCondition): +class UrlValue(ValueChannelMixin, core.StringValueDefWithCondition): """UrlValue schema wrapper Mapping(required=[]) @@ -4697,9 +8558,11 @@ class UrlValue(ValueChannelMixin, core.StringValueWithCondition): Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionstringnull`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) + 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). @@ -4722,16 +8585,16 @@ class X(FieldChannelMixin, core.PositionFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + 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. + 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. @@ -4740,15 +8603,16 @@ class X(FieldChannelMixin, core.PositionFieldDef): documentation. band : float For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to - bandwidth of `band scales `__ - or time units. If set to ``1``, the mark size is set to the bandwidth or the time + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time unit interval. For other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to ``0``, the marks will be positioned at the beginning of the band. If set to ``0.5``, the marks will be positioned in the middle of the band. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + 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 ( @@ -4771,27 +8635,24 @@ class X(FieldChannelMixin, core.PositionFieldDef): 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 + 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``. + **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. + 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. @@ -4814,30 +8675,25 @@ class X(FieldChannelMixin, core.PositionFieldDef): 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. + 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"`` @@ -4847,40 +8703,33 @@ class X(FieldChannelMixin, core.PositionFieldDef): **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`` and ``y`` channels with continuous domains. - For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + 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. + ``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`` or ``area`` ; - (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. + (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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -4908,38 +8757,59 @@ class X(FieldChannelMixin, core.PositionFieldDef): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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. @@ -4955,8 +8825,151 @@ def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, ban timeUnit=timeUnit, title=title, type=type, **kwds) -class XValue(ValueChannelMixin, core.XValueDef): - """XValue schema wrapper +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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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. + 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, band=Undefined, impute=Undefined, scale=Undefined, + stack=Undefined, type=Undefined, **kwds): + super(XDatum, self).__init__(datum=datum, axis=axis, band=band, impute=impute, scale=scale, + stack=stack, type=type, **kwds) + + +class XDatumValue(ValueChannelMixin, core.PositionValueDef): + """XDatumValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -4965,7 +8978,7 @@ class XValue(ValueChannelMixin, core.XValueDef): Attributes ---------- - value : anyOf(float, enum('width')) + 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). @@ -4974,7 +8987,7 @@ class XValue(ValueChannelMixin, core.XValueDef): _encoding_name = "x" def __init__(self, value, **kwds): - super(XValue, self).__init__(value=value, **kwds) + super(XDatumValue, self).__init__(value=value, **kwds) class X2(FieldChannelMixin, core.SecondaryFieldDef): @@ -4990,13 +9003,24 @@ class X2(FieldChannelMixin, core.SecondaryFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : None A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -5020,25 +9044,22 @@ class X2(FieldChannelMixin, core.SecondaryFieldDef): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -5069,14 +9090,100 @@ class X2(FieldChannelMixin, core.SecondaryFieldDef): _class_is_valid_at_instantiation = False _encoding_name = "x2" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(X2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(X2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) -class X2Value(ValueChannelMixin, core.XValueDef): - """X2Value schema wrapper +class X2Datum(DatumChannelMixin, core.DatumDef): + """X2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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, band=Undefined, type=Undefined, **kwds): + super(X2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class X2DatumValue(ValueChannelMixin, core.PositionValueDef): + """X2DatumValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -5085,7 +9192,7 @@ class X2Value(ValueChannelMixin, core.XValueDef): Attributes ---------- - value : anyOf(float, enum('width')) + 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). @@ -5094,7 +9201,7 @@ class X2Value(ValueChannelMixin, core.XValueDef): _encoding_name = "x2" def __init__(self, value, **kwds): - super(X2Value, self).__init__(value=value, **kwds) + super(X2DatumValue, self).__init__(value=value, **kwds) class XError(FieldChannelMixin, core.SecondaryFieldDef): @@ -5110,13 +9217,24 @@ class XError(FieldChannelMixin, core.SecondaryFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : None A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -5140,25 +9258,22 @@ class XError(FieldChannelMixin, core.SecondaryFieldDef): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -5189,13 +9304,13 @@ class XError(FieldChannelMixin, core.SecondaryFieldDef): _class_is_valid_at_instantiation = False _encoding_name = "xError" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(XError, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(XError, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) -class XErrorValue(ValueChannelMixin, core.NumberValueDef): +class XErrorValue(ValueChannelMixin, core.ValueDefnumber): """XErrorValue schema wrapper Mapping(required=[value]) @@ -5230,13 +9345,24 @@ class XError2(FieldChannelMixin, core.SecondaryFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : None A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -5260,25 +9386,22 @@ class XError2(FieldChannelMixin, core.SecondaryFieldDef): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -5309,13 +9432,13 @@ class XError2(FieldChannelMixin, core.SecondaryFieldDef): _class_is_valid_at_instantiation = False _encoding_name = "xError2" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(XError2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(XError2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) -class XError2Value(ValueChannelMixin, core.NumberValueDef): +class XError2Value(ValueChannelMixin, core.ValueDefnumber): """XError2Value schema wrapper Mapping(required=[value]) @@ -5348,16 +9471,16 @@ class Y(FieldChannelMixin, core.PositionFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + 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. + 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. @@ -5366,15 +9489,16 @@ class Y(FieldChannelMixin, core.PositionFieldDef): documentation. band : float For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to - bandwidth of `band scales `__ - or time units. If set to ``1``, the mark size is set to the bandwidth or the time + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time unit interval. For other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to ``0``, the marks will be positioned at the beginning of the band. If set to ``0.5``, the marks will be positioned in the middle of the band. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + 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 ( @@ -5397,27 +9521,24 @@ class Y(FieldChannelMixin, core.PositionFieldDef): 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 + 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``. + **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. + 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. @@ -5440,30 +9561,25 @@ class Y(FieldChannelMixin, core.PositionFieldDef): 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. + 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"`` @@ -5473,40 +9589,33 @@ class Y(FieldChannelMixin, core.PositionFieldDef): **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`` and ``y`` channels with continuous domains. - For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + 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. + ``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`` or ``area`` ; - (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. + (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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -5534,38 +9643,59 @@ class Y(FieldChannelMixin, core.PositionFieldDef): 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 encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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. @@ -5581,8 +9711,151 @@ def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, ban timeUnit=timeUnit, title=title, type=type, **kwds) -class YValue(ValueChannelMixin, core.YValueDef): - """YValue schema wrapper +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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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. + 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, band=Undefined, impute=Undefined, scale=Undefined, + stack=Undefined, type=Undefined, **kwds): + super(YDatum, self).__init__(datum=datum, axis=axis, band=band, impute=impute, scale=scale, + stack=stack, type=type, **kwds) + + +class YDatumValue(ValueChannelMixin, core.PositionValueDef): + """YDatumValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -5591,7 +9864,7 @@ class YValue(ValueChannelMixin, core.YValueDef): Attributes ---------- - value : anyOf(float, enum('height')) + 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). @@ -5600,7 +9873,7 @@ class YValue(ValueChannelMixin, core.YValueDef): _encoding_name = "y" def __init__(self, value, **kwds): - super(YValue, self).__init__(value=value, **kwds) + super(YDatumValue, self).__init__(value=value, **kwds) class Y2(FieldChannelMixin, core.SecondaryFieldDef): @@ -5616,13 +9889,24 @@ class Y2(FieldChannelMixin, core.SecondaryFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : None A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -5646,25 +9930,22 @@ class Y2(FieldChannelMixin, core.SecondaryFieldDef): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -5695,14 +9976,100 @@ class Y2(FieldChannelMixin, core.SecondaryFieldDef): _class_is_valid_at_instantiation = False _encoding_name = "y2" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(Y2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Y2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Y2Datum(DatumChannelMixin, core.DatumDef): + """Y2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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, band=Undefined, type=Undefined, **kwds): + super(Y2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) -class Y2Value(ValueChannelMixin, core.YValueDef): - """Y2Value schema wrapper +class Y2DatumValue(ValueChannelMixin, core.PositionValueDef): + """Y2DatumValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -5711,7 +10078,7 @@ class Y2Value(ValueChannelMixin, core.YValueDef): Attributes ---------- - value : anyOf(float, enum('height')) + 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). @@ -5720,7 +10087,7 @@ class Y2Value(ValueChannelMixin, core.YValueDef): _encoding_name = "y2" def __init__(self, value, **kwds): - super(Y2Value, self).__init__(value=value, **kwds) + super(Y2DatumValue, self).__init__(value=value, **kwds) class YError(FieldChannelMixin, core.SecondaryFieldDef): @@ -5736,13 +10103,24 @@ class YError(FieldChannelMixin, core.SecondaryFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : None A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -5766,25 +10144,22 @@ class YError(FieldChannelMixin, core.SecondaryFieldDef): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -5815,13 +10190,13 @@ class YError(FieldChannelMixin, core.SecondaryFieldDef): _class_is_valid_at_instantiation = False _encoding_name = "yError" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(YError, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(YError, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) -class YErrorValue(ValueChannelMixin, core.NumberValueDef): +class YErrorValue(ValueChannelMixin, core.ValueDefnumber): """YErrorValue schema wrapper Mapping(required=[value]) @@ -5856,13 +10231,24 @@ class YError2(FieldChannelMixin, core.SecondaryFieldDef): shorthand : string shorthand for field, aggregate, and type aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : None A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -5886,25 +10272,22 @@ class YError2(FieldChannelMixin, core.SecondaryFieldDef): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -5935,13 +10318,13 @@ class YError2(FieldChannelMixin, core.SecondaryFieldDef): _class_is_valid_at_instantiation = False _encoding_name = "yError2" - def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(YError2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(YError2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) -class YError2Value(ValueChannelMixin, core.NumberValueDef): +class YError2Value(ValueChannelMixin, core.ValueDefnumber): """YError2Value schema wrapper Mapping(required=[value]) diff --git a/altair/vegalite/v4/schema/core.py b/altair/vegalite/v4/schema/core.py index 0056a226b..103b3dcd7 100644 --- a/altair/vegalite/v4/schema/core.py +++ b/altair/vegalite/v4/schema/core.py @@ -25,9 +25,8 @@ class Root(VegaLiteSchema): :class:`TopLevelRepeatSpec`, :class:`TopLevelNormalizedConcatSpecGenericSpec`, :class:`TopLevelNormalizedVConcatSpecGenericSpec`, :class:`TopLevelNormalizedHConcatSpecGenericSpec`) - A Vega-Lite top-level specification. - This is the root class for all Vega-Lite specifications. - (The json schema is generated from this type.) + 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 @@ -69,10 +68,8 @@ class AggregatedFieldDef(VegaLiteSchema): 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. + ``"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"``. @@ -127,84 +124,75 @@ class AreaConfig(AnyMarkConfig): Attributes ---------- - align : :class:`Align` + 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"``. - angle : float - The rotation angle of the text, in degrees. - aspect : boolean - Whether to keep aspect ratio of image marks. - baseline : :class:`TextBaseline` - The vertical text baseline. 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. - blend : :class:`Blend` - The color blend mode for drawing an item on its current background. Any valid `CSS - mix-blend-mode `__ - value can be used. - - __Default value: ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`) + + **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:** + **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`) - * This property cannot be used in a `style config - `__. - * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and - will override ``color``. - cornerRadius : float - The radius in pixels of rounded rectangle corners. + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomLeft : float - The radius in pixels of rounded rectangle bottom left corner. + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomRight : float - The radius in pixels of rounded rectangle bottom right corner. + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopLeft : float - The radius in pixels of rounded rectangle top right corner. + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopRight : float - The radius in pixels of rounded rectangle top left corner. + description : anyOf(string, :class:`ExprRef`) - **Default value:** ``0`` - cursor : :class:`Cursor` - The mouse cursor used over the mark. Any valid `CSS cursor type - `__ can be used. - dir : :class:`TextDirection` - 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. - - **Default value:** ``"ltr"`` - dx : float - The horizontal offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - dy : float - The vertical offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - ellipsis : string - The ellipsis string for text truncated in response to the limit parameter. - - **Default value:** ``"…"`` - fill : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Fill Color. This property has higher precedence than ``config.color``. + 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 : float - The fill opacity (value between [0,1]). + fillOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` filled : boolean Whether the mark's color should be used as fill color instead of stroke color. @@ -215,59 +203,31 @@ class AreaConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config `__. - font : string - The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : float - The font size, in pixels. - - **Default value:** ``11`` - fontStyle : :class:`FontStyle` - The font style (e.g., ``"italic"`` ). - fontWeight : :class:`FontWeight` - 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`` - ). - height : float - Height of the marks. - href : string - A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - interpolate : :class:`Interpolate` - The line interpolation method to use for line and area marks. One of the following: - - - * ``"linear"`` : piecewise linear segments, as in a polyline. - * ``"linear-closed"`` : close the linear segments to form a polygon. - * ``"step"`` : alternate between horizontal and vertical segments, as in a step - function. - * ``"step-before"`` : alternate between vertical and horizontal segments, as in a - step function. - * ``"step-after"`` : alternate between horizontal and vertical segments, as in a - step function. - * ``"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. - invalid : enum('filter', None) - Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` - ). + font : anyOf(string, :class:`ExprRef`) + fontSize : anyOf(float, :class:`ExprRef`) - * 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 : float - The maximum length of the text mark in pixels. The text value will be automatically - truncated if the rendered size exceeds the limit. + 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``. + 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`) - **Default value:** ``0`` -- indicating no limit 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. @@ -279,13 +239,11 @@ class AreaConfig(AnyMarkConfig): If this value is ``false``, no lines would be automatically added to area marks. **Default value:** ``false``. - lineBreak : string - 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. - lineHeight : float - The line height in pixels (the spacing between subsequent lines of text) for - multi-line text marks. - opacity : float + 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``, @@ -294,19 +252,19 @@ class AreaConfig(AnyMarkConfig): 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. - point : anyOf(boolean, :class:`OverlayMarkDef`, enum('transparent')) + 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``. + 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. @@ -321,124 +279,107 @@ class AreaConfig(AnyMarkConfig): area marks. **Default value:** ``false``. - radius : float - Polar coordinate radial offset, in pixels, of the text label from the origin - determined by the ``x`` and ``y`` properties. - shape : anyOf(:class:`SymbolShape`, string) - Shape of the point marks. 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.) - - **Default value:** ``"circle"`` - size : float - Default size for marks. + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) - * 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. + 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:** + **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`) - * ``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. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Stroke Color. This property has higher precedence than ``config.color``. + 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 : string - The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or - ``"square"``. + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) - **Default value:** ``"butt"`` - strokeDash : List(float) - An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : float - The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : string - The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. - - **Default value:** ``"miter"`` - strokeMiterLimit : float - The miter limit at which to bevel a line join. - strokeOffset : float - 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. - strokeOpacity : float - The stroke opacity (value between [0,1]). + strokeDash : anyOf(List(float), :class:`ExprRef`) - **Default value:** ``1`` - strokeWidth : float - The stroke width, in pixels. - tension : float - Depending on the interpolation type, sets the tension parameter (for line and area - marks). - text : :class:`Text` - Placeholder text if the ``text`` channel is not specified - theta : float - Polar coordinate angle, in radians, of the text label from the origin determined by - the ``x`` and ``y`` properties. Values for ``theta`` follow the same convention of - ``arc`` mark ``startAngle`` and ``endAngle`` properties: angles are measured in - radians, with ``0`` indicating "north". + 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. timeUnitBand : 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. + 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. 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. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, None) + 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. + 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. + ``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`` - width : float - Width of the marks. - x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('height')) + 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 @@ -446,43 +387,52 @@ class AreaConfig(AnyMarkConfig): """ _schema = {'$ref': '#/definitions/AreaConfig'} - def __init__(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - blend=Undefined, color=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, fill=Undefined, + 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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=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, timeUnitBand=Undefined, - timeUnitBandPosition=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, - x2=Undefined, y=Undefined, y2=Undefined, **kwds): - super(AreaConfig, self).__init__(align=align, angle=angle, aspect=aspect, baseline=baseline, - blend=blend, color=color, cornerRadius=cornerRadius, + 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, timeUnitBand=Undefined, timeUnitBandPosition=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, - dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, + 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, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, - lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, - size=size, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, - strokeOffset=strokeOffset, strokeOpacity=strokeOpacity, - strokeWidth=strokeWidth, tension=tension, text=text, - theta=theta, timeUnitBand=timeUnitBand, + 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, + timeUnitBand=timeUnitBand, timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) class ArgmaxDef(Aggregate): @@ -574,48 +524,43 @@ class Axis(VegaLiteSchema): Attributes ---------- - bandPosition : float - 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. + aria : anyOf(boolean, :class:`ExprRef`) - **Default value:** ``0.5`` - domain : boolean - A boolean flag indicating if the domain (the axis baseline) should be included as - part of the axis. + bandPosition : anyOf(float, :class:`ExprRef`) - **Default value:** ``true`` - domainColor : anyOf(None, :class:`Color`) - Color of axis domain line. - - **Default value:** ``"gray"``. - domainDash : List(float) - An array of alternating [stroke, space] lengths for dashed domain lines. - domainDashOffset : float - The pixel offset at which to start drawing with the domain dash array. - domainOpacity : float - Opacity of the axis domain line. - domainWidth : float - Stroke width of axis domain line + description : anyOf(string, :class:`ExprRef`) - **Default value:** ``1`` - format : anyOf(string, Mapping(required=[])) + domain : anyOf(boolean, :class:`ExprRef`) + + 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:`Dictunknown`) 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 + `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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. + 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 @@ -623,48 +568,43 @@ class Axis(VegaLiteSchema): `__ config for time format. formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** - + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. + **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``. - gridColor : anyOf(anyOf(None, :class:`Color`), :class:`ConditionalAxisColor`) + gridCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) - gridDash : anyOf(List(float), :class:`ConditionalAxisNumberArray`) + gridColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) - gridDashOffset : anyOf(float, :class:`ConditionalAxisNumber`) + gridDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) - gridOpacity : anyOf(float, :class:`ConditionalAxisNumber`) + gridDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - gridWidth : anyOf(float, :class:`ConditionalAxisNumber`) + gridOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - labelAlign : anyOf(:class:`Align`, :class:`ConditionalAxisLabelAlign`) + gridWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - labelAngle : float - The rotation angle of the axis labels. + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`, :class:`ConditionalAxisLabelAlign`) - **Default value:** ``-90`` for nominal and ordinal fields; ``0`` otherwise. - labelBaseline : anyOf(:class:`TextBaseline`, :class:`ConditionalAxisLabelBaseline`) + labelAngle : anyOf(float, :class:`ExprRef`) - labelBound : anyOf(float, boolean) - 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. + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`, + :class:`ConditionalAxisLabelBaseline`) - **Default value:** ``false``. - labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ConditionalAxisColor`) + labelBound : anyOf(anyOf(float, boolean), :class:`ExprRef`) + + labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) labelExpr : string `Vega expression `__ for customizing @@ -683,32 +623,27 @@ class Axis(VegaLiteSchema): visually group with corresponding axis ticks. **Default value:** ``true`` for axis of a continuous x-scale. Otherwise, ``false``. - labelFlushOffset : float - 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. + labelFlushOffset : anyOf(float, :class:`ExprRef`) - **Default value:** ``0``. - labelFont : anyOf(string, :class:`ConditionalAxisString`) + labelFont : anyOf(string, :class:`ExprRef`, :class:`ConditionalAxisString`) - labelFontSize : anyOf(float, :class:`ConditionalAxisNumber`) + labelFontSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - labelFontStyle : anyOf(:class:`FontStyle`, :class:`ConditionalAxisLabelFontStyle`) + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontStyle`) - labelFontWeight : anyOf(:class:`FontWeight`, :class:`ConditionalAxisLabelFontWeight`) + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontWeight`) - labelLimit : float - Maximum allowed pixel width of axis tick labels. + labelLimit : anyOf(float, :class:`ExprRef`) - **Default value:** ``180`` - labelLineHeight : float - Line height in pixels for multi-line label text. - labelOffset : anyOf(float, :class:`ConditionalAxisNumber`) + labelLineHeight : anyOf(float, :class:`ExprRef`) - labelOpacity : anyOf(float, :class:`ConditionalAxisNumber`) + labelOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - labelOverlap : :class:`LabelOverlap` + 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 @@ -718,26 +653,16 @@ class Axis(VegaLiteSchema): **Default value:** ``true`` for non-nominal fields with non-log scales; ``"greedy"`` for log scales; otherwise ``false``. - labelPadding : anyOf(float, :class:`ConditionalAxisNumber`) + labelPadding : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - labelSeparation : float - 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. - labels : boolean - A boolean flag indicating if labels should be included as part of the axis. + labelSeparation : anyOf(float, :class:`ExprRef`) - **Default value:** ``true``. - maxExtent : float - The maximum extent in pixels that axis ticks and labels should use. This determines - a maximum offset value for axis titles. + labels : anyOf(boolean, :class:`ExprRef`) + + maxExtent : anyOf(float, :class:`ExprRef`) - **Default value:** ``undefined``. - minExtent : float - The minimum extent in pixels that axis ticks and labels should use. This determines - a minimum offset value for axis titles. + minExtent : anyOf(float, :class:`ExprRef`) - **Default value:** ``30`` for y-axis; ``undefined`` for x-axis. offset : float The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle. @@ -745,13 +670,13 @@ class Axis(VegaLiteSchema): **Default value:** derived from the `axis config `__ 's ``offset`` ( ``0`` by default) - orient : :class:`AxisOrient` + 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 : float + 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. @@ -763,55 +688,53 @@ class Axis(VegaLiteSchema): 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 : enum('center', 'extent') - For band scales, indicates if ticks and grid lines should be placed at the center of - a band (default) or at the band extents to indicate intervals. - tickColor : anyOf(anyOf(None, :class:`Color`), :class:`ConditionalAxisColor`) + **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`) - tickCount : float + 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:`ConditionalAxisNumberArray`) + tickDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + + tickDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - tickDashOffset : anyOf(float, :class:`ConditionalAxisNumber`) + tickExtra : anyOf(boolean, :class:`ExprRef`) - 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 : float + 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`) - **Default value** : ``undefined`` - tickOffset : float - Position offset in pixels to apply to ticks, labels, and gridlines. - tickOpacity : anyOf(float, :class:`ConditionalAxisNumber`) + tickOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - tickRound : boolean - Boolean flag indicating if pixel position values should be rounded to the nearest - integer. + tickRound : anyOf(boolean, :class:`ExprRef`) - **Default value:** ``true`` - tickSize : anyOf(float, :class:`ConditionalAxisNumber`) + tickSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - tickWidth : anyOf(float, :class:`ConditionalAxisNumber`) + tickWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - ticks : boolean - Boolean value that determines whether the axis should include ticks. + ticks : anyOf(boolean, :class:`ExprRef`) - **Default value:** ``true`` title : anyOf(:class:`Text`, None) A title for the field. If ``null``, the title will be removed. @@ -832,56 +755,54 @@ class Axis(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - titleAlign : :class:`Align` - Horizontal text alignment of axis titles. - titleAnchor : :class:`TitleAnchor` - Text anchor position for placing axis titles. - titleAngle : float - Angle in degrees of axis titles. - titleBaseline : :class:`TextBaseline` - Vertical text baseline for axis titles. - titleColor : anyOf(None, :class:`Color`) - Color of the title, can be in hex color code or regular color name. - titleFont : string - Font of the title. (e.g., ``"Helvetica Neue"`` ). - titleFontSize : float - Font size of the title. - titleFontStyle : :class:`FontStyle` - Font style of the title. - titleFontWeight : :class:`FontWeight` - 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`` - ). - titleLimit : float - Maximum allowed pixel width of axis titles. - titleLineHeight : float - Line height in pixels for multi-line title text. - titleOpacity : float - Opacity of the axis title. - titlePadding : float - The padding, in pixels, between title and axis. - titleX : float - X-coordinate of the axis title relative to the axis group. - titleY : float - Y-coordinate of the axis title relative to the axis group. - translate : float - Translation offset in pixels applied to the axis group mark x and y. If specified, - overrides the default behavior of a 0.5 offset to pixel-align stroked lines. - values : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`)) + 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. + 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, bandPosition=Undefined, domain=Undefined, domainColor=Undefined, - domainDash=Undefined, domainDashOffset=Undefined, domainOpacity=Undefined, - domainWidth=Undefined, format=Undefined, formatType=Undefined, grid=Undefined, + 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, @@ -891,33 +812,35 @@ def __init__(self, bandPosition=Undefined, domain=Undefined, domainColor=Undefin 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, 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__(bandPosition=bandPosition, domain=domain, domainColor=domainColor, + 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, 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, tickColor=tickColor, + 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, @@ -941,70 +864,93 @@ class AxisConfig(VegaLiteSchema): Attributes ---------- - bandPosition : float - 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. + aria : anyOf(boolean, :class:`ExprRef`) + + bandPosition : anyOf(float, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) - **Default value:** ``0.5`` 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. + domain : anyOf(boolean, :class:`ExprRef`) - **Default value:** ``true`` - domainColor : anyOf(None, :class:`Color`) - Color of axis domain line. - - **Default value:** ``"gray"``. - domainDash : List(float) - An array of alternating [stroke, space] lengths for dashed domain lines. - domainDashOffset : float - The pixel offset at which to start drawing with the domain dash array. - domainOpacity : float - Opacity of the axis domain line. - domainWidth : float - Stroke width of axis domain line + domainCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) - **Default value:** ``1`` + 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:`Dictunknown`) + 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``. - gridColor : anyOf(anyOf(None, :class:`Color`), :class:`ConditionalAxisColor`) + gridCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) - gridDash : anyOf(List(float), :class:`ConditionalAxisNumberArray`) + gridColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) - gridDashOffset : anyOf(float, :class:`ConditionalAxisNumber`) + gridDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) - gridOpacity : anyOf(float, :class:`ConditionalAxisNumber`) + gridDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - gridWidth : anyOf(float, :class:`ConditionalAxisNumber`) + gridOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - labelAlign : anyOf(:class:`Align`, :class:`ConditionalAxisLabelAlign`) + gridWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - labelAngle : float - The rotation angle of the axis labels. + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`, :class:`ConditionalAxisLabelAlign`) - **Default value:** ``-90`` for nominal and ordinal fields; ``0`` otherwise. - labelBaseline : anyOf(:class:`TextBaseline`, :class:`ConditionalAxisLabelBaseline`) + labelAngle : anyOf(float, :class:`ExprRef`) - labelBound : anyOf(float, boolean) - 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. + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`, + :class:`ConditionalAxisLabelBaseline`) - **Default value:** ``false``. - labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ConditionalAxisColor`) + labelBound : anyOf(anyOf(float, boolean), :class:`ExprRef`) + + labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) labelExpr : string `Vega expression `__ for customizing - labels. + labels text. **Note:** The label text and value can be assessed via the ``label`` and ``value`` properties of the axis's backing ``datum`` object. @@ -1019,32 +965,27 @@ class AxisConfig(VegaLiteSchema): visually group with corresponding axis ticks. **Default value:** ``true`` for axis of a continuous x-scale. Otherwise, ``false``. - labelFlushOffset : float - 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. + labelFlushOffset : anyOf(float, :class:`ExprRef`) - **Default value:** ``0``. - labelFont : anyOf(string, :class:`ConditionalAxisString`) + labelFont : anyOf(string, :class:`ExprRef`, :class:`ConditionalAxisString`) - labelFontSize : anyOf(float, :class:`ConditionalAxisNumber`) + labelFontSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - labelFontStyle : anyOf(:class:`FontStyle`, :class:`ConditionalAxisLabelFontStyle`) + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontStyle`) - labelFontWeight : anyOf(:class:`FontWeight`, :class:`ConditionalAxisLabelFontWeight`) + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontWeight`) - labelLimit : float - Maximum allowed pixel width of axis tick labels. + labelLimit : anyOf(float, :class:`ExprRef`) - **Default value:** ``180`` - labelLineHeight : float - Line height in pixels for multi-line label text. - labelOffset : anyOf(float, :class:`ConditionalAxisNumber`) + labelLineHeight : anyOf(float, :class:`ExprRef`) - labelOpacity : anyOf(float, :class:`ConditionalAxisNumber`) + labelOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - labelOverlap : :class:`LabelOverlap` + 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 @@ -1054,26 +995,16 @@ class AxisConfig(VegaLiteSchema): **Default value:** ``true`` for non-nominal fields with non-log scales; ``"greedy"`` for log scales; otherwise ``false``. - labelPadding : anyOf(float, :class:`ConditionalAxisNumber`) + labelPadding : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - labelSeparation : float - 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. - labels : boolean - A boolean flag indicating if labels should be included as part of the axis. + labelSeparation : anyOf(float, :class:`ExprRef`) - **Default value:** ``true``. - maxExtent : float - The maximum extent in pixels that axis ticks and labels should use. This determines - a maximum offset value for axis titles. + labels : anyOf(boolean, :class:`ExprRef`) + + maxExtent : anyOf(float, :class:`ExprRef`) - **Default value:** ``undefined``. - minExtent : float - The minimum extent in pixels that axis ticks and labels should use. This determines - a minimum offset value for axis titles. + minExtent : anyOf(float, :class:`ExprRef`) - **Default value:** ``30`` for y-axis; ``undefined`` for x-axis. offset : float The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle. @@ -1081,106 +1012,141 @@ class AxisConfig(VegaLiteSchema): **Default value:** derived from the `axis config `__ 's ``offset`` ( ``0`` by default) - orient : :class:`AxisOrient` + 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 : enum('center', 'extent') - For band scales, indicates if ticks and grid lines should be placed at the center of - a band (default) or at the band extents to indicate intervals. - tickColor : anyOf(anyOf(None, :class:`Color`), :class:`ConditionalAxisColor`) + **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`) - tickCount : float + 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:`ConditionalAxisNumberArray`) + tickDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + + tickDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickExtra : anyOf(boolean, :class:`ExprRef`) - tickDashOffset : anyOf(float, :class:`ConditionalAxisNumber`) + 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`) - 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``. - tickOffset : float - Position offset in pixels to apply to ticks, labels, and gridlines. - tickOpacity : anyOf(float, :class:`ConditionalAxisNumber`) + tickOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - tickRound : boolean - Boolean flag indicating if pixel position values should be rounded to the nearest - integer. + tickRound : anyOf(boolean, :class:`ExprRef`) - **Default value:** ``true`` - tickSize : anyOf(float, :class:`ConditionalAxisNumber`) + tickSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - tickWidth : anyOf(float, :class:`ConditionalAxisNumber`) + tickWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) - ticks : boolean - Boolean value that determines whether the axis should include ticks. + ticks : anyOf(boolean, :class:`ExprRef`) - **Default value:** ``true`` - title : None - Set to null to disable title for the axis, legend, or header. - titleAlign : :class:`Align` - Horizontal text alignment of axis titles. - titleAnchor : :class:`TitleAnchor` - Text anchor position for placing axis titles. - titleAngle : float - Angle in degrees of axis titles. - titleBaseline : :class:`TextBaseline` - Vertical text baseline for axis titles. - titleColor : anyOf(None, :class:`Color`) - Color of the title, can be in hex color code or regular color name. - titleFont : string - Font of the title. (e.g., ``"Helvetica Neue"`` ). - titleFontSize : float - Font size of the title. - titleFontStyle : :class:`FontStyle` - Font style of the title. - titleFontWeight : :class:`FontWeight` - 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`` - ). - titleLimit : float - Maximum allowed pixel width of axis titles. - titleLineHeight : float - Line height in pixels for multi-line title text. - titleOpacity : float - Opacity of the axis title. - titlePadding : float - The padding, in pixels, between title and axis. - titleX : float - X-coordinate of the axis title relative to the axis group. - titleY : float - Y-coordinate of the axis title relative to the axis group. - translate : float - Translation offset in pixels applied to the axis group mark x and y. If specified, - overrides the default behavior of a 0.5 offset to pixel-align stroked lines. + 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, bandPosition=Undefined, disable=Undefined, domain=Undefined, - domainColor=Undefined, domainDash=Undefined, domainDashOffset=Undefined, - domainOpacity=Undefined, domainWidth=Undefined, grid=Undefined, gridColor=Undefined, - gridDash=Undefined, gridDashOffset=Undefined, gridOpacity=Undefined, - gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, + 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, @@ -1188,19 +1154,22 @@ def __init__(self, bandPosition=Undefined, disable=Undefined, domain=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, - style=Undefined, tickBand=Undefined, tickColor=Undefined, tickCount=Undefined, - tickDash=Undefined, tickDashOffset=Undefined, tickExtra=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, **kwds): - super(AxisConfig, self).__init__(bandPosition=bandPosition, disable=disable, domain=domain, + 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, grid=grid, gridColor=gridColor, + domainWidth=domainWidth, format=format, formatType=formatType, + grid=grid, gridCap=gridCap, gridColor=gridColor, gridDash=gridDash, gridDashOffset=gridDashOffset, gridOpacity=gridOpacity, gridWidth=gridWidth, labelAlign=labelAlign, labelAngle=labelAngle, @@ -1214,19 +1183,21 @@ def __init__(self, bandPosition=Undefined, disable=Undefined, domain=Undefined, labelOverlap=labelOverlap, labelPadding=labelPadding, labelSeparation=labelSeparation, labels=labels, maxExtent=maxExtent, minExtent=minExtent, offset=offset, - orient=orient, style=style, tickBand=tickBand, - tickColor=tickColor, tickCount=tickCount, tickDash=tickDash, + orient=orient, position=position, style=style, + tickBand=tickBand, tickCap=tickCap, tickColor=tickColor, + tickCount=tickCount, tickDash=tickDash, tickDashOffset=tickDashOffset, tickExtra=tickExtra, - 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, **kwds) + 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): @@ -1267,101 +1238,92 @@ class BarConfig(AnyMarkConfig): Attributes ---------- - align : :class:`Align` + 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"``. - angle : float - The rotation angle of the text, in degrees. - aspect : boolean - Whether to keep aspect ratio of image marks. - baseline : :class:`TextBaseline` - The vertical text baseline. 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. + + **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 : :class:`Blend` - The color blend mode for drawing an item on its current background. Any valid `CSS - mix-blend-mode `__ - value can be used. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) - __Default value: ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`) + 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``. + **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 : float - The radius in pixels of rounded rectangle corners. + cornerRadius : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomLeft : float - The radius in pixels of rounded rectangle bottom left corner. + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomRight : float - The radius in pixels of rounded rectangle bottom right corner. + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusEnd : float - * For vertical bars, top-left and top-right corner radius. - * For horizontal bars, top-right and bottom-right corner radius. - cornerRadiusTopLeft : float - The radius in pixels of rounded rectangle top right corner. + 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`) - **Default value:** ``0`` - cornerRadiusTopRight : float - The radius in pixels of rounded rectangle top left corner. + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cursor : :class:`Cursor` - The mouse cursor used over the mark. Any valid `CSS cursor type - `__ can be used. - dir : :class:`TextDirection` - 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. + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) - **Default value:** ``"ltr"`` discreteBandSize : float 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 : float - The horizontal offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - dy : float - The vertical offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - ellipsis : string - The ellipsis string for text truncated in response to the limit parameter. - - **Default value:** ``"…"`` - fill : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Fill Color. This property has higher precedence than ``config.color``. + dx : anyOf(float, :class:`ExprRef`) - **Default value:** (None) - fillOpacity : float - The fill opacity (value between [0,1]). + dy : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` - filled : boolean - Whether the mark's color should be used as fill color instead of stroke color. + 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 @@ -1370,66 +1332,36 @@ class BarConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config `__. - font : string - The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : float - The font size, in pixels. - - **Default value:** ``11`` - fontStyle : :class:`FontStyle` - The font style (e.g., ``"italic"`` ). - fontWeight : :class:`FontWeight` - 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`` - ). - height : float - Height of the marks. - href : string - A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - interpolate : :class:`Interpolate` - The line interpolation method to use for line and area marks. One of the following: - - - * ``"linear"`` : piecewise linear segments, as in a polyline. - * ``"linear-closed"`` : close the linear segments to form a polygon. - * ``"step"`` : alternate between horizontal and vertical segments, as in a step - function. - * ``"step-before"`` : alternate between vertical and horizontal segments, as in a - step function. - * ``"step-after"`` : alternate between horizontal and vertical segments, as in a - step function. - * ``"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. + 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``. + 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`) - * 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 : float - The maximum length of the text mark in pixels. The text value will be automatically - truncated if the rendered size exceeds the limit. + lineHeight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` -- indicating no limit - lineBreak : string - 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. - lineHeight : float - The line height in pixels (the spacing between subsequent lines of text) for - multi-line text marks. - opacity : float + opacity : anyOf(float, :class:`ExprRef`) The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, @@ -1438,136 +1370,119 @@ class BarConfig(AnyMarkConfig): 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. - radius : float - Polar coordinate radial offset, in pixels, of the text label from the origin - determined by the ``x`` and ``y`` properties. - shape : anyOf(:class:`SymbolShape`, string) - Shape of the point marks. 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.) - - **Default value:** ``"circle"`` - size : float - Default size for marks. + 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``. + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + 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`) - * 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. + strokeDash : anyOf(List(float), :class:`ExprRef`) - **Default value:** + strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) - * ``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. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Stroke Color. This property has higher precedence than ``config.color``. + strokeMiterLimit : anyOf(float, :class:`ExprRef`) - **Default value:** (None) - strokeCap : string - The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or - ``"square"``. + strokeOffset : anyOf(float, :class:`ExprRef`) - **Default value:** ``"butt"`` - strokeDash : List(float) - An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : float - The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : string - The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. - - **Default value:** ``"miter"`` - strokeMiterLimit : float - The miter limit at which to bevel a line join. - strokeOffset : float - 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. - strokeOpacity : float - The stroke opacity (value between [0,1]). + strokeOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` - strokeWidth : float - The stroke width, in pixels. - tension : float - Depending on the interpolation type, sets the tension parameter (for line and area - marks). - text : :class:`Text` - Placeholder text if the ``text`` channel is not specified - theta : float - Polar coordinate angle, in radians, of the text label from the origin determined by - the ``x`` and ``y`` properties. Values for ``theta`` follow the same convention of - ``arc`` mark ``startAngle`` and ``endAngle`` properties: angles are measured in - radians, with ``0`` indicating "north". + 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. timeUnitBand : 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. + 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. 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. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, None) + 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. + 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. + ``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`` - width : float - Width of the marks. - x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('height')) + 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 @@ -1575,47 +1490,56 @@ class BarConfig(AnyMarkConfig): """ _schema = {'$ref': '#/definitions/BarConfig'} - def __init__(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, + 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, - 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, interpolate=Undefined, invalid=Undefined, - limit=Undefined, lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, - order=Undefined, orient=Undefined, radius=Undefined, shape=Undefined, size=Undefined, - stroke=Undefined, strokeCap=Undefined, strokeDash=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, timeUnitBand=Undefined, - timeUnitBandPosition=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, - x2=Undefined, y=Undefined, y2=Undefined, **kwds): - super(BarConfig, self).__init__(align=align, angle=angle, aspect=aspect, baseline=baseline, - binSpacing=binSpacing, blend=blend, color=color, - continuousBandSize=continuousBandSize, + tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + timeUnitBand=Undefined, timeUnitBandPosition=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, - 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, interpolate=interpolate, invalid=invalid, - limit=limit, lineBreak=lineBreak, lineHeight=lineHeight, - opacity=opacity, order=order, orient=orient, radius=radius, - shape=shape, size=size, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, - strokeOffset=strokeOffset, strokeOpacity=strokeOpacity, - strokeWidth=strokeWidth, tension=tension, text=text, - theta=theta, timeUnitBand=timeUnitBand, + 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, + timeUnitBand=timeUnitBand, timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) class BaseTitleNoValueRefs(VegaLiteSchema): @@ -1629,73 +1553,69 @@ class BaseTitleNoValueRefs(VegaLiteSchema): 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 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. - angle : float - Angle in degrees of title and subtitle text. + 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 ``"top"``, ``"middle"``, - ``"bottom"``, or ``"alphabetic"``. - color : anyOf(None, :class:`Color`) - Text color for title text. - dx : float - Delta offset for title and subtitle text x-coordinate. - dy : float - Delta offset for title and subtitle text y-coordinate. - font : string - Font name for title text. - fontSize : float - Font size in pixels for title text. - fontStyle : :class:`FontStyle` - Font style for title text. - fontWeight : :class:`FontWeight` - 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`` - ). - frame : anyOf(:class:`TitleFrame`, string) - 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). - limit : float - The maximum allowed length in pixels of title and subtitle text. - lineHeight : float - Line height in pixels for multi-line title text. - offset : float - The orthogonal offset in pixels by which to displace the title group from its - position along the edge of the chart. - orient : :class:`TitleOrient` - Default title orientation ( ``"top"``, ``"bottom"``, ``"left"``, or ``"right"`` ) - subtitleColor : anyOf(None, :class:`Color`) - Text color for subtitle text. - subtitleFont : string - Font name for subtitle text. - subtitleFontSize : float - Font size in pixels for subtitle text. - subtitleFontStyle : :class:`FontStyle` - Font style for subtitle text. - subtitleFontWeight : :class:`FontWeight` - 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`` - ). - subtitleLineHeight : float - Line height in pixels for multi-line subtitle text. - subtitlePadding : float - The padding in pixels between title and subtitle text. + 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, 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, - **kwds): - super(BaseTitleNoValueRefs, self).__init__(align=align, anchor=anchor, angle=angle, + 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, @@ -1706,7 +1626,8 @@ def __init__(self, align=Undefined, anchor=Undefined, angle=Undefined, baseline= subtitleFontStyle=subtitleFontStyle, subtitleFontWeight=subtitleFontWeight, subtitleLineHeight=subtitleLineHeight, - subtitlePadding=subtitlePadding, **kwds) + subtitlePadding=subtitlePadding, zindex=zindex, + **kwds) class BinExtent(VegaLiteSchema): @@ -1799,7 +1720,7 @@ class BindCheckbox(Binding): Attributes ---------- - input : enum('checkbox') + input : string debounce : float @@ -1858,7 +1779,7 @@ class BindRange(Binding): Attributes ---------- - input : enum('range') + input : string debounce : float @@ -1904,29 +1825,26 @@ class BoxPlotConfig(VegaLiteSchema): Attributes ---------- - box : anyOf(boolean, :class:`MarkConfig`) - - extent : anyOf(enum('min-max'), float) - The extent of the whiskers. Available options include: + box : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) - - * ``"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* ). + 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`) + median : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) - outliers : anyOf(boolean, :class:`MarkConfig`) + outliers : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) - rule : anyOf(boolean, :class:`MarkConfig`) + rule : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) size : float Size of the box and median tick of a box plot - ticks : anyOf(boolean, :class:`MarkConfig`) + ticks : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) """ _schema = {'$ref': '#/definitions/BoxPlotConfig'} @@ -1992,227 +1910,17 @@ def __init__(self, *args, **kwds): super(Color, self).__init__(*args, **kwds) -class ColorGradientFieldDefWithCondition(VegaLiteSchema): - """ColorGradientFieldDefWithCondition schema wrapper - - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` - - Attributes - ---------- - - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). - - **Default value:** ``undefined`` (None) - - **See also:** `aggregate `__ - documentation. - 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 : :class:`ValueConditionGradientstringnull` - One or more value definition(s) with `a selection 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. - """ - _schema = {'$ref': '#/definitions/ColorGradientFieldDefWithCondition'} - - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(ColorGradientFieldDefWithCondition, self).__init__(type=type, aggregate=aggregate, - bin=bin, condition=condition, - field=field, legend=legend, - scale=scale, sort=sort, - timeUnit=timeUnit, title=title, **kwds) - - -class ColorGradientValueWithCondition(VegaLiteSchema): - """ColorGradientValueWithCondition schema wrapper - - Mapping(required=[]) - - Attributes - ---------- +class ColorDef(VegaLiteSchema): + """ColorDef schema wrapper - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, - :class:`ValueConditionGradientstringnull`) - A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(:class:`Gradient`, string, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, + :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`) """ - _schema = {'$ref': '#/definitions/ColorGradientValueWithCondition'} + _schema = {'$ref': '#/definitions/ColorDef'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ColorGradientValueWithCondition, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ColorDef, self).__init__(*args, **kwds) class ColorName(Color): @@ -2286,7 +1994,7 @@ def __init__(self, *args, **kwds): class BoxPlot(CompositeMark): """BoxPlot schema wrapper - enum('boxplot') + string """ _schema = {'$ref': '#/definitions/BoxPlot'} @@ -2314,40 +2022,34 @@ class BoxPlotDef(CompositeMarkDef): ---------- 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`) + 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:`MarkConfigExprOrSignalRef`) clip : boolean Whether a composite mark be clipped to the enclosing group’s width and height. - color : anyOf(:class:`Color`, :class:`Gradient`) + 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(enum('min-max'), 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* ). + **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`) + median : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) opacity : float The opacity (value between [0,1]) of the mark. @@ -2357,13 +2059,13 @@ class BoxPlotDef(CompositeMarkDef): when the orientation is ambiguous. **Default value:** ``"vertical"``. - outliers : anyOf(boolean, :class:`MarkConfig`) + outliers : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) - rule : anyOf(boolean, :class:`MarkConfig`) + rule : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) size : float Size of the box and median tick of a box plot - ticks : anyOf(boolean, :class:`MarkConfig`) + ticks : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) """ _schema = {'$ref': '#/definitions/BoxPlotDef'} @@ -2388,18 +2090,14 @@ class CompositionConfig(VegaLiteSchema): 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`` ). + 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) + 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`` ). @@ -2417,427 +2115,344 @@ def __init__(self, columns=Undefined, spacing=Undefined, **kwds): class ConditionalAxisColor(VegaLiteSchema): """ConditionalAxisColor schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefColornull`, - List(:class:`ConditionalPredicateValueDefColornull`)) - - value : anyOf(:class:`Color`, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisColor'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisColor, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisColor, self).__init__(*args, **kwds) class ConditionalAxisLabelAlign(VegaLiteSchema): """ConditionalAxisLabelAlign schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefAlignnull`, - List(:class:`ConditionalPredicateValueDefAlignnull`)) - - value : anyOf(:class:`Align`, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisLabelAlign'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisLabelAlign, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelAlign, self).__init__(*args, **kwds) class ConditionalAxisLabelBaseline(VegaLiteSchema): """ConditionalAxisLabelBaseline schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefTextBaselinenull`, - List(:class:`ConditionalPredicateValueDefTextBaselinenull`)) - - value : anyOf(:class:`TextBaseline`, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisLabelBaseline'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisLabelBaseline, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelBaseline, self).__init__(*args, **kwds) class ConditionalAxisLabelFontStyle(VegaLiteSchema): """ConditionalAxisLabelFontStyle schema wrapper - Mapping(required=[condition, value]) + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisLabelFontStyle'} - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefFontStylenull`, - List(:class:`ConditionalPredicateValueDefFontStylenull`)) - - value : anyOf(:class:`FontStyle`, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). - """ - _schema = {'$ref': '#/definitions/ConditionalAxisLabelFontStyle'} - - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisLabelFontStyle, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelFontStyle, self).__init__(*args, **kwds) class ConditionalAxisLabelFontWeight(VegaLiteSchema): """ConditionalAxisLabelFontWeight schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefFontWeightnull`, - List(:class:`ConditionalPredicateValueDefFontWeightnull`)) - - value : anyOf(:class:`FontWeight`, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisLabelFontWeight'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisLabelFontWeight, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelFontWeight, self).__init__(*args, **kwds) class ConditionalAxisNumber(VegaLiteSchema): """ConditionalAxisNumber schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefnumbernull`, - List(:class:`ConditionalPredicateValueDefnumbernull`)) - - value : anyOf(float, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisNumber'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisNumber, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisNumber, self).__init__(*args, **kwds) class ConditionalAxisNumberArray(VegaLiteSchema): """ConditionalAxisNumberArray schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefnumbernull`, - List(:class:`ConditionalPredicateValueDefnumbernull`)) - - value : anyOf(List(float), None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisNumberArray'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisNumberArray, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisNumberArray, self).__init__(*args, **kwds) class ConditionalAxisPropertyAlignnull(VegaLiteSchema): """ConditionalAxisPropertyAlignnull schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefAlignnull`, - List(:class:`ConditionalPredicateValueDefAlignnull`)) - - value : anyOf(:class:`Align`, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(Align|null)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisPropertyAlignnull, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyAlignnull, self).__init__(*args, **kwds) class ConditionalAxisPropertyColornull(VegaLiteSchema): """ConditionalAxisPropertyColornull schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefColornull`, - List(:class:`ConditionalPredicateValueDefColornull`)) - - value : anyOf(:class:`Color`, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(Color|null)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisPropertyColornull, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyColornull, self).__init__(*args, **kwds) class ConditionalAxisPropertyFontStylenull(VegaLiteSchema): """ConditionalAxisPropertyFontStylenull schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefFontStylenull`, - List(:class:`ConditionalPredicateValueDefFontStylenull`)) - - value : anyOf(:class:`FontStyle`, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(FontStyle|null)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisPropertyFontStylenull, self).__init__(condition=condition, value=value, - **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyFontStylenull, self).__init__(*args, **kwds) class ConditionalAxisPropertyFontWeightnull(VegaLiteSchema): """ConditionalAxisPropertyFontWeightnull schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefFontWeightnull`, - List(:class:`ConditionalPredicateValueDefFontWeightnull`)) - - value : anyOf(:class:`FontWeight`, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(FontWeight|null)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisPropertyFontWeightnull, self).__init__(condition=condition, value=value, - **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyFontWeightnull, self).__init__(*args, **kwds) class ConditionalAxisPropertyTextBaselinenull(VegaLiteSchema): """ConditionalAxisPropertyTextBaselinenull schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefTextBaselinenull`, - List(:class:`ConditionalPredicateValueDefTextBaselinenull`)) - - value : anyOf(:class:`TextBaseline`, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(TextBaseline|null)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisPropertyTextBaselinenull, self).__init__(condition=condition, value=value, - **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyTextBaselinenull, self).__init__(*args, **kwds) class ConditionalAxisPropertynumbernull(VegaLiteSchema): """ConditionalAxisPropertynumbernull schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateValueDefnumbernull`, - List(:class:`ConditionalPredicateValueDefnumbernull`)) - - value : anyOf(float, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(number|null)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisPropertynumbernull, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertynumbernull, self).__init__(*args, **kwds) class ConditionalAxisPropertystringnull(VegaLiteSchema): """ConditionalAxisPropertystringnull schema wrapper - Mapping(required=[condition, value]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalPredicateStringValueDef`, - List(:class:`ConditionalPredicateStringValueDef`)) - - value : anyOf(string, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) """ _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(string|null)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisPropertystringnull, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertystringnull, self).__init__(*args, **kwds) class ConditionalAxisString(VegaLiteSchema): """ConditionalAxisString schema wrapper - Mapping(required=[condition, value]) + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisString'} - Attributes - ---------- + def __init__(self, *args, **kwds): + super(ConditionalAxisString, self).__init__(*args, **kwds) - condition : anyOf(:class:`ConditionalPredicateStringValueDef`, - List(:class:`ConditionalPredicateStringValueDef`)) - value : anyOf(string, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). +class ConditionalMarkPropFieldOrDatumDef(VegaLiteSchema): + """ConditionalMarkPropFieldOrDatumDef schema wrapper + + anyOf(:class:`ConditionalPredicateMarkPropFieldOrDatumDef`, + :class:`ConditionalSelectionMarkPropFieldOrDatumDef`) """ - _schema = {'$ref': '#/definitions/ConditionalAxisString'} + _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldOrDatumDef'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ConditionalAxisString, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ConditionalMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) + + +class ConditionalMarkPropFieldOrDatumDefTypeForShape(VegaLiteSchema): + """ConditionalMarkPropFieldOrDatumDefTypeForShape schema wrapper + + anyOf(:class:`ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape`, + :class:`ConditionalSelectionMarkPropFieldOrDatumDefTypeForShape`) + """ + _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldOrDatumDef'} + + def __init__(self, *args, **kwds): + super(ConditionalMarkPropFieldOrDatumDefTypeForShape, 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 ConditionalMarkPropFieldDef(VegaLiteSchema): - """ConditionalMarkPropFieldDef schema wrapper +class ConditionalPredicateValueDefnumbernullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefnumbernullExprRef schema wrapper - anyOf(:class:`ConditionalPredicateMarkPropFieldDef`, - :class:`ConditionalSelectionMarkPropFieldDef`) + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) """ - _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldDef'} + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>'} def __init__(self, *args, **kwds): - super(ConditionalMarkPropFieldDef, self).__init__(*args, **kwds) + super(ConditionalPredicateValueDefnumbernullExprRef, self).__init__(*args, **kwds) -class ConditionalMarkPropFieldDefTypeForShape(VegaLiteSchema): - """ConditionalMarkPropFieldDefTypeForShape schema wrapper +class ConditionalSelectionMarkPropFieldOrDatumDef(ConditionalMarkPropFieldOrDatumDef): + """ConditionalSelectionMarkPropFieldOrDatumDef schema wrapper - anyOf(:class:`ConditionalPredicateMarkPropFieldDefTypeForShape`, - :class:`ConditionalSelectionMarkPropFieldDefTypeForShape`) + anyOf(Mapping(required=[selection]), Mapping(required=[selection])) + """ + _schema = {'$ref': '#/definitions/ConditionalSelection'} + + def __init__(self, *args, **kwds): + super(ConditionalSelectionMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) + + +class ConditionalSelectionMarkPropFieldOrDatumDefTypeForShape(ConditionalMarkPropFieldOrDatumDefTypeForShape): + """ConditionalSelectionMarkPropFieldOrDatumDefTypeForShape schema wrapper + + anyOf(Mapping(required=[selection]), Mapping(required=[selection])) """ - _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldDef'} + _schema = {'$ref': '#/definitions/ConditionalSelection>'} def __init__(self, *args, **kwds): - super(ConditionalMarkPropFieldDefTypeForShape, self).__init__(*args, **kwds) + super(ConditionalSelectionMarkPropFieldOrDatumDefTypeForShape, self).__init__(*args, **kwds) -class ConditionalNumberValueDef(VegaLiteSchema): - """ConditionalNumberValueDef schema wrapper +class ConditionalStringFieldDef(VegaLiteSchema): + """ConditionalStringFieldDef schema wrapper - anyOf(:class:`ConditionalPredicateNumberValueDef`, - :class:`ConditionalSelectionNumberValueDef`) + anyOf(:class:`ConditionalPredicateStringFieldDef`, + :class:`ConditionalSelectionStringFieldDef`) """ - _schema = {'$ref': '#/definitions/ConditionalNumberValueDef'} + _schema = {'$ref': '#/definitions/ConditionalStringFieldDef'} def __init__(self, *args, **kwds): - super(ConditionalNumberValueDef, self).__init__(*args, **kwds) + super(ConditionalStringFieldDef, self).__init__(*args, **kwds) -class ConditionalPredicateMarkPropFieldDef(ConditionalMarkPropFieldDef): - """ConditionalPredicateMarkPropFieldDef schema wrapper +class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): + """ConditionalPredicateStringFieldDef schema wrapper - Mapping(required=[test, type]) + Mapping(required=[test]) Attributes ---------- test : :class:`PredicateComposition` Predicate for triggering the condition - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -2860,85 +2475,59 @@ class ConditionalPredicateMarkPropFieldDef(ConditionalMarkPropFieldDef): 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 + 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 - `__. + **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:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. - **Default value:** If undefined, default `scale properties - `__ are applied. - **See also:** `scale `__ - documentation. - sort : :class:`Sort` - Sort order for the encoded field. + * 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 `__. - For continuous fields (quantitative or temporal), ``sort`` can be either - ``"ascending"`` or ``"descending"``. + See the `format documentation `__ + for more examples. - 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. + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. - **Default value:** ``"ascending"`` + **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 + `__. - **Note:** ``null`` and sorting by another channel is not supported for ``row`` and - ``column``. + **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``. + labelExpr : string + `Vega expression `__ for customizing + labels text. - **See also:** `sort `__ - documentation. + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -2965,75 +2554,108 @@ class ConditionalPredicateMarkPropFieldDef(ConditionalMarkPropFieldDef): 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/ConditionalPredicate'} - - def __init__(self, test=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(ConditionalPredicateMarkPropFieldDef, self).__init__(test=test, type=type, - aggregate=aggregate, bin=bin, - field=field, legend=legend, - scale=scale, sort=sort, - timeUnit=timeUnit, title=title, - **kwds) + 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``. -class ConditionalPredicateMarkPropFieldDefTypeForShape(ConditionalMarkPropFieldDefTypeForShape): - """ConditionalPredicateMarkPropFieldDefTypeForShape schema wrapper + **Default value:** - Mapping(required=[test, type]) + 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`` ). - Attributes - ---------- + **See also:** `type `__ + documentation. + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate'} - test : :class:`PredicateComposition` - Predicate for triggering the condition - type : :class:`TypeForShape` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. + def __init__(self, test=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(ConditionalPredicateStringFieldDef, self).__init__(test=test, aggregate=aggregate, + band=band, bin=bin, field=field, + format=format, formatType=formatType, + labelExpr=labelExpr, timeUnit=timeUnit, + title=title, type=type, **kwds) - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - **See also:** `type `__ - documentation. +class ConditionalSelectionStringFieldDef(ConditionalStringFieldDef): + """ConditionalSelectionStringFieldDef schema wrapper + + Mapping(required=[selection]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -3056,85 +2678,59 @@ class ConditionalPredicateMarkPropFieldDefTypeForShape(ConditionalMarkPropFieldD 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 + 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 - `__. + **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:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. - **Default value:** If undefined, default `scale properties - `__ are applied. - **See also:** `scale `__ - documentation. - sort : :class:`Sort` - Sort order for the encoded field. + * 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 `__. - For continuous fields (quantitative or temporal), ``sort`` can be either - ``"ascending"`` or ``"descending"``. + See the `format documentation `__ + for more examples. - 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. + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. - **Default value:** ``"ascending"`` + **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 + `__. - **Note:** ``null`` and sorting by another channel is not supported for ``row`` and - ``column``. + **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``. + labelExpr : string + `Vega expression `__ for customizing + labels text. - **See also:** `sort `__ - documentation. + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -3161,23 +2757,91 @@ class ConditionalPredicateMarkPropFieldDefTypeForShape(ConditionalMarkPropFieldD 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>'} + _schema = {'$ref': '#/definitions/ConditionalSelection'} - def __init__(self, test=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(ConditionalPredicateMarkPropFieldDefTypeForShape, self).__init__(test=test, type=type, - aggregate=aggregate, - bin=bin, field=field, - legend=legend, - scale=scale, sort=sort, - timeUnit=timeUnit, - title=title, **kwds) + def __init__(self, selection=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(ConditionalSelectionStringFieldDef, self).__init__(selection=selection, + aggregate=aggregate, band=band, + bin=bin, field=field, format=format, + formatType=formatType, + labelExpr=labelExpr, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class ConditionalValueDefGradientstringnullExprRef(VegaLiteSchema): + """ConditionalValueDefGradientstringnullExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefGradientstringnullExprRef`, + :class:`ConditionalSelectionValueDefGradientstringnullExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefGradientstringnullExprRef, self).__init__(*args, **kwds) -class ConditionalPredicateNumberValueDef(ConditionalNumberValueDef): - """ConditionalPredicateNumberValueDef schema wrapper +class ConditionalPredicateValueDefGradientstringnullExprRef(ConditionalValueDefGradientstringnullExprRef): + """ConditionalPredicateValueDefGradientstringnullExprRef schema wrapper Mapping(required=[test, value]) @@ -3186,40 +2850,56 @@ class ConditionalPredicateNumberValueDef(ConditionalNumberValueDef): test : :class:`PredicateComposition` Predicate for triggering the condition - value : float + 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'} + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateNumberValueDef, self).__init__(test=test, value=value, **kwds) + super(ConditionalPredicateValueDefGradientstringnullExprRef, self).__init__(test=test, + value=value, **kwds) -class ConditionalPredicateValueDefAlignnull(VegaLiteSchema): - """ConditionalPredicateValueDefAlignnull schema wrapper +class ConditionalSelectionValueDefGradientstringnullExprRef(ConditionalValueDefGradientstringnullExprRef): + """ConditionalSelectionValueDefGradientstringnullExprRef schema wrapper - Mapping(required=[test, value]) + Mapping(required=[selection, value]) Attributes ---------- - test : :class:`PredicateComposition` - Predicate for triggering the condition - value : anyOf(:class:`Align`, None) + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + 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>'} + _schema = {'$ref': '#/definitions/ConditionalSelection>'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefAlignnull, self).__init__(test=test, value=value, **kwds) + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefGradientstringnullExprRef, self).__init__(selection=selection, + value=value, **kwds) + + +class ConditionalValueDefTextExprRef(VegaLiteSchema): + """ConditionalValueDefTextExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefTextExprRef`, + :class:`ConditionalSelectionValueDefTextExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(Text|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefTextExprRef, self).__init__(*args, **kwds) -class ConditionalPredicateValueDefColornull(VegaLiteSchema): - """ConditionalPredicateValueDefColornull schema wrapper +class ConditionalPredicateValueDefTextExprRef(ConditionalValueDefTextExprRef): + """ConditionalPredicateValueDefTextExprRef schema wrapper Mapping(required=[test, value]) @@ -3228,40 +2908,55 @@ class ConditionalPredicateValueDefColornull(VegaLiteSchema): test : :class:`PredicateComposition` Predicate for triggering the condition - value : anyOf(:class:`Color`, None) + 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>'} + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefColornull, self).__init__(test=test, value=value, **kwds) + super(ConditionalPredicateValueDefTextExprRef, self).__init__(test=test, value=value, **kwds) -class ConditionalPredicateValueDefFontStylenull(VegaLiteSchema): - """ConditionalPredicateValueDefFontStylenull schema wrapper +class ConditionalSelectionValueDefTextExprRef(ConditionalValueDefTextExprRef): + """ConditionalSelectionValueDefTextExprRef schema wrapper - Mapping(required=[test, value]) + Mapping(required=[selection, value]) Attributes ---------- - test : :class:`PredicateComposition` - Predicate for triggering the condition - value : anyOf(:class:`FontStyle`, None) + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + 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>'} + _schema = {'$ref': '#/definitions/ConditionalSelection>'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefFontStylenull, self).__init__(test=test, value=value, **kwds) + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefTextExprRef, self).__init__(selection=selection, value=value, + **kwds) + + +class ConditionalValueDefnumber(VegaLiteSchema): + """ConditionalValueDefnumber schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefnumber`, + :class:`ConditionalSelectionValueDefnumber`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefnumber, self).__init__(*args, **kwds) -class ConditionalPredicateValueDefFontWeightnull(VegaLiteSchema): - """ConditionalPredicateValueDefFontWeightnull schema wrapper +class ConditionalPredicateValueDefnumber(ConditionalValueDefnumber): + """ConditionalPredicateValueDefnumber schema wrapper Mapping(required=[test, value]) @@ -3270,41 +2965,55 @@ class ConditionalPredicateValueDefFontWeightnull(VegaLiteSchema): test : :class:`PredicateComposition` Predicate for triggering the condition - value : anyOf(:class:`FontWeight`, None) + 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>'} + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefFontWeightnull, self).__init__(test=test, value=value, **kwds) + super(ConditionalPredicateValueDefnumber, self).__init__(test=test, value=value, **kwds) -class ConditionalPredicateValueDefTextBaselinenull(VegaLiteSchema): - """ConditionalPredicateValueDefTextBaselinenull schema wrapper +class ConditionalSelectionValueDefnumber(ConditionalValueDefnumber): + """ConditionalSelectionValueDefnumber schema wrapper - Mapping(required=[test, value]) + Mapping(required=[selection, value]) Attributes ---------- - test : :class:`PredicateComposition` - Predicate for triggering the condition - value : anyOf(:class:`TextBaseline`, None) + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + 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>'} + _schema = {'$ref': '#/definitions/ConditionalSelection>'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefTextBaselinenull, self).__init__(test=test, value=value, - **kwds) + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefnumber, self).__init__(selection=selection, value=value, + **kwds) -class ConditionalPredicateValueDefnumbernull(VegaLiteSchema): - """ConditionalPredicateValueDefnumbernull schema wrapper +class ConditionalValueDefnumberExprRef(VegaLiteSchema): + """ConditionalValueDefnumberExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefnumberExprRef`, + :class:`ConditionalSelectionValueDefnumberExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(number|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefnumberExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefnumberExprRef(ConditionalValueDefnumberExprRef): + """ConditionalPredicateValueDefnumberExprRef schema wrapper Mapping(required=[test, value]) @@ -3313,21 +3022,21 @@ class ConditionalPredicateValueDefnumbernull(VegaLiteSchema): test : :class:`PredicateComposition` Predicate for triggering the condition - value : anyOf(float, None) + 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>'} + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefnumbernull, self).__init__(test=test, value=value, **kwds) + super(ConditionalPredicateValueDefnumberExprRef, self).__init__(test=test, value=value, **kwds) -class ConditionalSelectionMarkPropFieldDef(ConditionalMarkPropFieldDef): - """ConditionalSelectionMarkPropFieldDef schema wrapper +class ConditionalSelectionValueDefnumberExprRef(ConditionalValueDefnumberExprRef): + """ConditionalSelectionValueDefnumberExprRef schema wrapper - Mapping(required=[selection, type]) + Mapping(required=[selection, value]) Attributes ---------- @@ -3336,394 +3045,111 @@ class ConditionalSelectionMarkPropFieldDef(ConditionalMarkPropFieldDef): A `selection name `__, or a series of `composed selections `__. - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. + 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/ConditionalSelection>'} - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefnumberExprRef, self).__init__(selection=selection, + value=value, **kwds) - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). - **Default value:** ``undefined`` (None) +class ConditionalValueDefstringExprRef(VegaLiteSchema): + """ConditionalValueDefstringExprRef schema wrapper - **See also:** `aggregate `__ - documentation. - 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"`` ). + anyOf(:class:`ConditionalPredicateValueDefstringExprRef`, + :class:`ConditionalSelectionValueDefstringExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(string|ExprRef)>'} + def __init__(self, *args, **kwds): + super(ConditionalValueDefstringExprRef, self).__init__(*args, **kwds) - 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. +class ConditionalPredicateValueDefstringExprRef(ConditionalValueDefstringExprRef): + """ConditionalPredicateValueDefstringExprRef schema wrapper - **Default value:** ``false`` + Mapping(required=[test, value]) - **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. + Attributes + ---------- - **See also:** `field `__ - documentation. + 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>'} - **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. + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefstringExprRef, self).__init__(test=test, value=value, **kwds) - **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. +class ConditionalSelectionValueDefstringExprRef(ConditionalValueDefstringExprRef): + """ConditionalSelectionValueDefstringExprRef schema wrapper - If ``null``, the scale will be `disabled and the data value will be directly encoded - `__. + Mapping(required=[selection, value]) - **Default value:** If undefined, default `scale properties - `__ are applied. + Attributes + ---------- - **See also:** `scale `__ - documentation. - sort : :class:`Sort` - Sort order for the encoded field. + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + 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/ConditionalSelection>'} - For continuous fields (quantitative or temporal), ``sort`` can be either - ``"ascending"`` or ``"descending"``. + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefstringExprRef, self).__init__(selection=selection, + value=value, **kwds) - For discrete fields, ``sort`` can be one of the following: - - - * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in - JavaScript. - * `A string indicating an encoding channel name to sort by - `__ (e.g., - ``"x"`` or ``"y"`` ) with an optional minus prefix for descending sort (e.g., - ``"-x"`` to sort by x-field, descending). This channel string is short-form of `a - sort-by-encoding definition - `__. For - example, ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": - "descending"}``. - * `A sort field definition - `__ for sorting by - another field. - * `An array specifying the field values in preferred order - `__. In this case, the - sort order will obey the values in the array, followed by any unspecified values - in their original order. For discrete time field, values in the sort array can be - `date-time definition objects `__. In addition, for time units - ``"month"`` and ``"day"``, the values can be the month or day names (case - insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - * ``null`` indicating no sort. - **Default value:** ``"ascending"`` +class ConditionalValueDefstringnullExprRef(VegaLiteSchema): + """ConditionalValueDefstringnullExprRef schema wrapper - **Note:** ``null`` and sorting by another channel is not supported for ``row`` and - ``column``. + anyOf(:class:`ConditionalPredicateValueDefstringnullExprRef`, + :class:`ConditionalSelectionValueDefstringnullExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(string|null|ExprRef)>'} - **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 - `__. + def __init__(self, *args, **kwds): + super(ConditionalValueDefstringnullExprRef, self).__init__(*args, **kwds) - **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. +class ConditionalPredicateValueDefstringnullExprRef(ConditionalValueDefstringnullExprRef): + """ConditionalPredicateValueDefstringnullExprRef schema wrapper - **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/ConditionalSelection'} - - def __init__(self, selection=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(ConditionalSelectionMarkPropFieldDef, self).__init__(selection=selection, type=type, - aggregate=aggregate, bin=bin, - field=field, legend=legend, - scale=scale, sort=sort, - timeUnit=timeUnit, title=title, - **kwds) - - -class ConditionalSelectionMarkPropFieldDefTypeForShape(ConditionalMarkPropFieldDefTypeForShape): - """ConditionalSelectionMarkPropFieldDefTypeForShape schema wrapper - - Mapping(required=[selection, type]) + Mapping(required=[test, value]) Attributes ---------- - selection : :class:`SelectionComposition` - A `selection name `__, or a - series of `composed selections - `__. - type : :class:`TypeForShape` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). - - **Default value:** ``undefined`` (None) - - **See also:** `aggregate `__ - documentation. - 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``. - 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. + 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/ConditionalSelection>'} + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} - def __init__(self, selection=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(ConditionalSelectionMarkPropFieldDefTypeForShape, self).__init__(selection=selection, - type=type, - aggregate=aggregate, - bin=bin, field=field, - legend=legend, - scale=scale, sort=sort, - timeUnit=timeUnit, - title=title, **kwds) + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefstringnullExprRef, self).__init__(test=test, value=value, + **kwds) -class ConditionalSelectionNumberValueDef(ConditionalNumberValueDef): - """ConditionalSelectionNumberValueDef schema wrapper +class ConditionalSelectionValueDefstringnullExprRef(ConditionalValueDefstringnullExprRef): + """ConditionalSelectionValueDefstringnullExprRef schema wrapper Mapping(required=[selection, value]) @@ -3734,380 +3160,16 @@ class ConditionalSelectionNumberValueDef(ConditionalNumberValueDef): A `selection name `__, or a series of `composed selections `__. - value : float + 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/ConditionalSelection'} + _schema = {'$ref': '#/definitions/ConditionalSelection>'} def __init__(self, selection=Undefined, value=Undefined, **kwds): - super(ConditionalSelectionNumberValueDef, self).__init__(selection=selection, value=value, - **kwds) - - -class ConditionalStringFieldDef(VegaLiteSchema): - """ConditionalStringFieldDef schema wrapper - - anyOf(:class:`ConditionalPredicateStringFieldDef`, - :class:`ConditionalSelectionStringFieldDef`) - """ - _schema = {'$ref': '#/definitions/ConditionalStringFieldDef'} - - def __init__(self, *args, **kwds): - super(ConditionalStringFieldDef, self).__init__(*args, **kwds) - - -class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): - """ConditionalPredicateStringFieldDef schema wrapper - - Mapping(required=[test, type]) - - Attributes - ---------- - - test : :class:`PredicateComposition` - Predicate for triggering the condition - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). - - **Default value:** ``undefined`` (None) - - **See also:** `aggregate `__ - documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), 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, Mapping(required=[])) - 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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. - - **Default value:** Derived from `numberFormat - `__ config for number - format and from `timeFormat - `__ config for time - format. - formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** - - - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. - labelExpr : string - `Vega expression `__ for customizing - labels text. - - **Note:** The label text and value can be assessed via the ``label`` and ``value`` - properties of the axis's backing ``datum`` object. - 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/ConditionalPredicate'} - - def __init__(self, test=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(ConditionalPredicateStringFieldDef, self).__init__(test=test, type=type, - aggregate=aggregate, bin=bin, - field=field, format=format, - formatType=formatType, - labelExpr=labelExpr, timeUnit=timeUnit, - title=title, **kwds) - - -class ConditionalSelectionStringFieldDef(ConditionalStringFieldDef): - """ConditionalSelectionStringFieldDef schema wrapper - - Mapping(required=[selection, type]) - - Attributes - ---------- - - selection : :class:`SelectionComposition` - A `selection name `__, or a - series of `composed selections - `__. - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). - - **Default value:** ``undefined`` (None) - - **See also:** `aggregate `__ - documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), 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, Mapping(required=[])) - 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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. - - **Default value:** Derived from `numberFormat - `__ config for number - format and from `timeFormat - `__ config for time - format. - formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** - - - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. - labelExpr : string - `Vega expression `__ for customizing - labels text. - - **Note:** The label text and value can be assessed via the ``label`` and ``value`` - properties of the axis's backing ``datum`` object. - 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/ConditionalSelection'} - - def __init__(self, selection=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(ConditionalSelectionStringFieldDef, self).__init__(selection=selection, type=type, - aggregate=aggregate, bin=bin, - field=field, format=format, - formatType=formatType, - labelExpr=labelExpr, timeUnit=timeUnit, - title=title, **kwds) + super(ConditionalSelectionValueDefstringnullExprRef, self).__init__(selection=selection, + value=value, **kwds) class Config(VegaLiteSchema): @@ -4118,13 +3180,21 @@ class Config(VegaLiteSchema): 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. + ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify + parameters for content sizing and automatic resizing. **Default value** : ``pad`` axis : :class:`AxisConfig` @@ -4174,7 +3244,7 @@ class Config(VegaLiteSchema): Config for y-quantitative axes. axisYTemporal : :class:`AxisConfig` Config for y-temporal axes. - background : :class:`Color` + background : anyOf(:class:`Color`, :class:`ExprRef`) CSS color property to use as the background of the entire view. **Default value:** ``"white"`` @@ -4191,6 +3261,10 @@ class Config(VegaLiteSchema): 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` @@ -4198,15 +3272,12 @@ class Config(VegaLiteSchema): 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"). + 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` @@ -4248,7 +3319,7 @@ class Config(VegaLiteSchema): documentation `__. line : :class:`LineConfig` Line-Specific Config - lineBreak : string + 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 @@ -4259,13 +3330,15 @@ class Config(VegaLiteSchema): numberFormat : string D3 Number format for guide labels and text marks. For example ``"s"`` for SI units. Use `D3's number format pattern `__. - padding : :class:`Padding` + 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, + 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(:class:`Parameter`) + Dynamic variables that parameterize a visualization. point : :class:`MarkConfig` Point-Specific Config projection : :class:`ProjectionConfig` @@ -4306,9 +3379,8 @@ class Config(VegaLiteSchema): 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. + **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 @@ -4322,25 +3394,27 @@ class Config(VegaLiteSchema): """ _schema = {'$ref': '#/definitions/Config'} - def __init__(self, area=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, + 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, 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, mark=Undefined, - numberFormat=Undefined, padding=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__(area=area, autosize=autosize, axis=axis, axisBand=axisBand, - axisBottom=axisBottom, axisDiscrete=axisDiscrete, - axisLeft=axisLeft, axisPoint=axisPoint, + 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, 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, @@ -4349,16 +3423,17 @@ def __init__(self, area=Undefined, autosize=Undefined, axis=Undefined, axisBand= axisYDiscrete=axisYDiscrete, axisYPoint=axisYPoint, axisYQuantitative=axisYQuantitative, axisYTemporal=axisYTemporal, background=background, bar=bar, boxplot=boxplot, circle=circle, - concat=concat, countTitle=countTitle, errorband=errorband, + 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, mark=mark, - numberFormat=numberFormat, padding=padding, 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) + 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): @@ -4420,13 +3495,12 @@ class CsvDataFormat(DataFormat): 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. + 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() `__. @@ -4439,8 +3513,7 @@ class CsvDataFormat(DataFormat): 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. + file URL. If no extension is detected, ``"json"`` will be used by default. """ _schema = {'$ref': '#/definitions/CsvDataFormat'} @@ -4514,6 +3587,17 @@ def __init__(self, **kwds): super(DictSelectionInitInterval, self).__init__(**kwds) +class Dictunknown(VegaLiteSchema): + """Dictunknown schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Dict'} + + def __init__(self, **kwds): + super(Dictunknown, self).__init__(**kwds) + + class Diverging(ColorScheme): """Diverging schema wrapper @@ -4559,12 +3643,12 @@ class DomainUnionWith(VegaLiteSchema): 1) ``domain`` for *quantitative* fields can take one of the following forms: - * a two-element array with minimum and maximum values. - * an array with more than two entries, for `Piecewise quantitative scales + * a two-element array with minimum and maximum values. - an array with more than two + entries, for `Piecewise quantitative scales `__. (Alternatively, - the ``domainMid`` property can be set for a diverging scale.) - * 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. + the ``domainMid`` property can be set for a diverging scale.) - 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) ``domain`` for *temporal* fields can be a two-element array minimum and maximum values, in the form of either timestamps or the `DateTime definition objects @@ -4593,13 +3677,12 @@ class DsvDataFormat(DataFormat): 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. + 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() `__. @@ -4608,12 +3691,11 @@ class DsvDataFormat(DataFormat): UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). See more about `UTC time `__ - type : enum('dsv') + 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. + file URL. If no extension is detected, ``"json"`` will be used by default. """ _schema = {'$ref': '#/definitions/DsvDataFormat'} @@ -4640,93 +3722,92 @@ class Encoding(VegaLiteSchema): Attributes ---------- - color : anyOf(:class:`ColorGradientFieldDefWithCondition`, - :class:`ColorGradientValueWithCondition`) + 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"``. + 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 + `__ '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 : anyOf(:class:`ColorGradientFieldDefWithCondition`, - :class:`ColorGradientValueWithCondition`) - Fill color of the marks. - **Default value:** If undefined, the default color depends on `mark config - `__ 's ``color`` property. + 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 : anyOf(:class:`NumericFieldDefWithCondition`, - :class:`NumericValueWithCondition`) + 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:`StringValueWithCondition`) + `__ '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 : anyOf(:class:`LatLongFieldDef`, :class:`NumberValueDef`) + latitude : :class:`LatLongDef` Latitude position of geographically projected marks. - latitude2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + latitude2 : :class:`Position2Def` Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. - longitude : anyOf(:class:`LatLongFieldDef`, :class:`NumberValueDef`) + longitude : :class:`LatLongDef` Longitude position of geographically projected marks. - longitude2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + longitude2 : :class:`Position2Def` Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. - opacity : anyOf(:class:`NumericFieldDefWithCondition`, :class:`NumericValueWithCondition`) + 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:`NumberValueDef`) - 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. + `__ '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. - shape : anyOf(:class:`ShapeFieldDefWithCondition`, :class:`ShapeValueWithCondition`) + 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 ``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.) @@ -4737,46 +3818,47 @@ class Encoding(VegaLiteSchema): **Default value:** If undefined, the default shape depends on `mark config `__ 's ``shape`` property. ( ``"circle"`` if unset.) - size : anyOf(:class:`NumericFieldDefWithCondition`, :class:`NumericValueWithCondition`) - 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 : anyOf(:class:`ColorGradientFieldDefWithCondition`, - :class:`ColorGradientValueWithCondition`) - Stroke color of the marks. - **Default value:** If undefined, the default color depends on `mark config - `__ 's ``color`` property. + 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 : anyOf(:class:`NumericArrayFieldDefWithCondition`, - :class:`NumericArrayValueDefWithCondition`) + strokeDash : :class:`NumericArrayMarkPropDef` Stroke dash of the marks. **Default value:** ``[1,0]`` (No dash). - strokeOpacity : anyOf(:class:`NumericFieldDefWithCondition`, - :class:`NumericValueWithCondition`) + strokeOpacity : :class:`NumericMarkPropDef` Stroke opacity of the marks. **Default value:** If undefined, the default opacity depends on `mark config - `__ 's ``strokeOpacity`` - property. - strokeWidth : anyOf(:class:`NumericFieldDefWithCondition`, - :class:`NumericValueWithCondition`) + `__ '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 : anyOf(:class:`TextFieldDefWithCondition`, :class:`TextValueWithCondition`) + `__ 's + ``strokeWidth`` property. + text : :class:`TextDef` Text of the ``text`` mark. - tooltip : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueWithCondition`, + 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 @@ -4784,58 +3866,62 @@ class Encoding(VegaLiteSchema): See the `tooltip `__ documentation for a detailed discussion about tooltip in Vega-Lite. - url : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueWithCondition`) + url : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) The URL of an image mark. - x : anyOf(:class:`PositionFieldDef`, :class:`XValueDef`) + 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 : anyOf(:class:`SecondaryFieldDef`, :class:`XValueDef`) + 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:`NumberValueDef`) + xError : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. - xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) Secondary error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. - y : anyOf(:class:`PositionFieldDef`, :class:`YValueDef`) + 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 : anyOf(:class:`SecondaryFieldDef`, :class:`YValueDef`) + 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:`NumberValueDef`) + yError : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. - yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) Secondary error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. """ _schema = {'$ref': '#/definitions/Encoding'} - def __init__(self, color=Undefined, detail=Undefined, fill=Undefined, fillOpacity=Undefined, - href=Undefined, key=Undefined, latitude=Undefined, latitude2=Undefined, - longitude=Undefined, longitude2=Undefined, opacity=Undefined, order=Undefined, + 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, tooltip=Undefined, - url=Undefined, x=Undefined, x2=Undefined, xError=Undefined, xError2=Undefined, - y=Undefined, y2=Undefined, yError=Undefined, yError2=Undefined, **kwds): - super(Encoding, self).__init__(color=color, detail=detail, fill=fill, fillOpacity=fillOpacity, - href=href, key=key, latitude=latitude, latitude2=latitude2, - longitude=longitude, longitude2=longitude2, opacity=opacity, - order=order, shape=shape, size=size, stroke=stroke, - strokeDash=strokeDash, strokeOpacity=strokeOpacity, - strokeWidth=strokeWidth, text=text, tooltip=tooltip, url=url, - x=x, x2=x2, xError=xError, xError2=xError2, y=y, y2=y2, - yError=yError, yError2=yError2, **kwds) + strokeOpacity=Undefined, strokeWidth=Undefined, text=Undefined, theta=Undefined, + theta2=Undefined, tooltip=Undefined, url=Undefined, x=Undefined, x2=Undefined, + xError=Undefined, xError2=Undefined, y=Undefined, y2=Undefined, yError=Undefined, + yError2=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, y=y, y2=y2, yError=yError, + yError2=yError2, **kwds) class EncodingSortFieldFieldName(VegaLiteSchema): @@ -4855,10 +3941,10 @@ class EncodingSortFieldFieldName(VegaLiteSchema): 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 + 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. - 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 `__. @@ -4877,7 +3963,7 @@ def __init__(self, field=Undefined, op=Undefined, order=Undefined, **kwds): class ErrorBand(CompositeMark): """ErrorBand schema wrapper - enum('errorband') + string """ _schema = {'$ref': '#/definitions/ErrorBand'} @@ -4893,45 +3979,36 @@ class ErrorBandConfig(VegaLiteSchema): Attributes ---------- - band : anyOf(boolean, :class:`MarkConfig`) + band : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) - borders : anyOf(boolean, :class:`MarkConfig`) + borders : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) 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. + 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. + 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. """ @@ -4952,64 +4029,52 @@ class ErrorBandDef(CompositeMarkDef): ---------- 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`) + 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:`MarkConfigExprOrSignalRef`) - borders : anyOf(boolean, :class:`MarkConfig`) + borders : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) clip : boolean Whether a composite mark be clipped to the enclosing group’s width and height. - color : anyOf(:class:`Color`, :class:`Gradient`) + 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``. + **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. + 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. + 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` @@ -5031,7 +4096,7 @@ def __init__(self, type=Undefined, band=Undefined, borders=Undefined, clip=Undef class ErrorBar(CompositeMark): """ErrorBar schema wrapper - enum('errorbar') + string """ _schema = {'$ref': '#/definitions/ErrorBar'} @@ -5048,26 +4113,28 @@ class ErrorBarConfig(VegaLiteSchema): ---------- 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. + 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`) + rule : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) - ticks : 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:`MarkConfigExprOrSignalRef`) """ _schema = {'$ref': '#/definitions/ErrorBarConfig'} - def __init__(self, extent=Undefined, rule=Undefined, ticks=Undefined, **kwds): - super(ErrorBarConfig, self).__init__(extent=extent, rule=rule, ticks=ticks, **kwds) + 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): @@ -5079,35 +4146,28 @@ class ErrorBarDef(CompositeMarkDef): ---------- 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"`` ). + 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`) + 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``. + **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. + 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 @@ -5115,17 +4175,23 @@ class ErrorBarDef(CompositeMarkDef): 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`) + rule : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) - ticks : 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:`MarkConfigExprOrSignalRef`) """ _schema = {'$ref': '#/definitions/ErrorBarDef'} def __init__(self, type=Undefined, clip=Undefined, color=Undefined, extent=Undefined, - opacity=Undefined, orient=Undefined, rule=Undefined, ticks=Undefined, **kwds): + 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, ticks=ticks, **kwds) + opacity=opacity, orient=orient, rule=rule, size=size, + thickness=thickness, ticks=ticks, **kwds) class ErrorBarExtent(VegaLiteSchema): @@ -5150,68 +4216,65 @@ def __init__(self, *args): super(Expr, self).__init__(*args) -class FacetEncodingFieldDef(VegaLiteSchema): - """FacetEncodingFieldDef schema wrapper +class ExprOrSignalRef(VegaLiteSchema): + """ExprOrSignalRef schema wrapper - Mapping(required=[type]) + Mapping(required=[expr]) Attributes ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. + expr : string + Vega expression (which can refer to Vega-Lite parameters). + """ + _schema = {'$ref': '#/definitions/ExprOrSignalRef'} - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + def __init__(self, expr=Undefined, **kwds): + super(ExprOrSignalRef, self).__init__(expr=expr, **kwds) + + +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 + ---------- - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + 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"``. + 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 + 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. @@ -5219,6 +4282,17 @@ class FacetEncodingFieldDef(VegaLiteSchema): be used to supply different alignments for rows and columns. **Default value:** ``"all"``. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -5246,10 +4320,10 @@ class FacetEncodingFieldDef(VegaLiteSchema): * 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. + 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`) @@ -5261,402 +4335,70 @@ class FacetEncodingFieldDef(VegaLiteSchema): **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 : :class:`Header` - 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. - """ - _schema = {'$ref': '#/definitions/FacetEncodingFieldDef'} - - def __init__(self, type=Undefined, aggregate=Undefined, align=Undefined, bin=Undefined, - bounds=Undefined, center=Undefined, columns=Undefined, field=Undefined, - header=Undefined, sort=Undefined, spacing=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(FacetEncodingFieldDef, self).__init__(type=type, aggregate=aggregate, align=align, - bin=bin, bounds=bounds, center=center, - columns=columns, field=field, header=header, - sort=sort, spacing=spacing, timeUnit=timeUnit, - title=title, **kwds) - - -class FacetFieldDef(VegaLiteSchema): - """FacetFieldDef schema wrapper - - Mapping(required=[type]) - - Attributes - ---------- - - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). - - **Default value:** ``undefined`` (None) - - **See also:** `aggregate `__ - documentation. - 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 : :class:`Header` - 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. - """ - _schema = {'$ref': '#/definitions/FacetFieldDef'} - - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(FacetFieldDef, self).__init__(type=type, aggregate=aggregate, bin=bin, field=field, - header=header, sort=sort, timeUnit=timeUnit, title=title, - **kwds) - - -class FacetFieldDefFieldName(VegaLiteSchema): - """FacetFieldDefFieldName schema wrapper - - Mapping(required=[type]) - - Attributes - ---------- - - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). - - **Default value:** ``undefined`` (None) - - **See also:** `aggregate `__ - documentation. - 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. + The number of columns to include in the view composition layout. - **Default value:** ``false`` + **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`` ). - **See also:** `bin `__ - documentation. - field : :class:`FieldName` + **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 + 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``. + **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 : :class:`Header` An object defining properties of a facet's header. - sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortFieldFieldName`, - None) + 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. + 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -5683,335 +4425,104 @@ class FacetFieldDefFieldName(VegaLiteSchema): 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/FacetFieldDef'} - - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(FacetFieldDefFieldName, self).__init__(type=type, aggregate=aggregate, bin=bin, - field=field, header=header, sort=sort, - timeUnit=timeUnit, title=title, **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) - + 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' + `__. -class FacetMappingFieldName(VegaLiteSchema): - """FacetMappingFieldName schema wrapper + 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``. - Mapping(required=[]) + **Default value:** - Attributes - ---------- + 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`` ). - column : :class:`FacetFieldDefFieldName` - A field definition for the horizontal facet of trellis plots. - row : :class:`FacetFieldDefFieldName` - A field definition for the vertical facet of trellis plots. + **See also:** `type `__ + documentation. """ - _schema = {'$ref': '#/definitions/FacetMapping'} + _schema = {'$ref': '#/definitions/FacetEncodingFieldDef'} - def __init__(self, column=Undefined, row=Undefined, **kwds): - super(FacetMappingFieldName, self).__init__(column=column, row=row, **kwds) + def __init__(self, aggregate=Undefined, align=Undefined, band=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, band=band, + bin=bin, bounds=bounds, center=center, + columns=columns, field=field, header=header, + sort=sort, spacing=spacing, timeUnit=timeUnit, + title=title, type=type, **kwds) -class FacetedEncoding(VegaLiteSchema): - """FacetedEncoding schema wrapper +class FacetFieldDef(VegaLiteSchema): + """FacetFieldDef schema wrapper Mapping(required=[]) Attributes ---------- - color : anyOf(:class:`ColorGradientFieldDefWithCondition`, - :class:`ColorGradientValueWithCondition`) - 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. - 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 : anyOf(:class:`ColorGradientFieldDefWithCondition`, - :class:`ColorGradientValueWithCondition`) - 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 : anyOf(:class:`NumericFieldDefWithCondition`, - :class:`NumericValueWithCondition`) - Fill opacity of the marks. - - **Default value:** If undefined, the default opacity depends on `mark config - `__ 's ``fillOpacity`` - property. - href : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueWithCondition`) - 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 : anyOf(:class:`LatLongFieldDef`, :class:`NumberValueDef`) - Latitude position of geographically projected marks. - latitude2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) - Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, - ``"rect"``, and ``"rule"``. - longitude : anyOf(:class:`LatLongFieldDef`, :class:`NumberValueDef`) - Longitude position of geographically projected marks. - longitude2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) - Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, - ``"rect"``, and ``"rule"``. - opacity : anyOf(:class:`NumericFieldDefWithCondition`, :class:`NumericValueWithCondition`) - 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:`NumberValueDef`) - 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. - row : :class:`RowColumnEncodingFieldDef` - A field definition for the vertical facet of trellis plots. - shape : anyOf(:class:`ShapeFieldDefWithCondition`, :class:`ShapeValueWithCondition`) - 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 : anyOf(:class:`NumericFieldDefWithCondition`, :class:`NumericValueWithCondition`) - 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 : anyOf(:class:`ColorGradientFieldDefWithCondition`, - :class:`ColorGradientValueWithCondition`) - 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 : anyOf(:class:`NumericArrayFieldDefWithCondition`, - :class:`NumericArrayValueDefWithCondition`) - Stroke dash of the marks. - - **Default value:** ``[1,0]`` (No dash). - strokeOpacity : anyOf(:class:`NumericFieldDefWithCondition`, - :class:`NumericValueWithCondition`) - Stroke opacity of the marks. - - **Default value:** If undefined, the default opacity depends on `mark config - `__ 's ``strokeOpacity`` - property. - strokeWidth : anyOf(:class:`NumericFieldDefWithCondition`, - :class:`NumericValueWithCondition`) - Stroke width of the marks. - - **Default value:** If undefined, the default stroke width depends on `mark config - `__ 's ``strokeWidth`` - property. - text : anyOf(:class:`TextFieldDefWithCondition`, :class:`TextValueWithCondition`) - Text of the ``text`` mark. - tooltip : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueWithCondition`, - 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:`StringValueWithCondition`) - The URL of an image mark. - x : anyOf(:class:`PositionFieldDef`, :class:`XValueDef`) - 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(:class:`SecondaryFieldDef`, :class:`XValueDef`) - 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:`NumberValueDef`) - Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. - xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) - Secondary error value of x coordinates for error specified ``"errorbar"`` and - ``"errorband"``. - y : anyOf(:class:`PositionFieldDef`, :class:`YValueDef`) - 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(:class:`SecondaryFieldDef`, :class:`YValueDef`) - 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:`NumberValueDef`) - Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. - yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) - Secondary error value of y coordinates for error specified ``"errorbar"`` and - ``"errorband"``. - """ - _schema = {'$ref': '#/definitions/FacetedEncoding'} - - def __init__(self, color=Undefined, column=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, row=Undefined, shape=Undefined, size=Undefined, - stroke=Undefined, strokeDash=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, - text=Undefined, tooltip=Undefined, url=Undefined, x=Undefined, x2=Undefined, - xError=Undefined, xError2=Undefined, y=Undefined, y2=Undefined, yError=Undefined, - yError2=Undefined, **kwds): - super(FacetedEncoding, self).__init__(color=color, column=column, detail=detail, facet=facet, - fill=fill, fillOpacity=fillOpacity, href=href, key=key, - latitude=latitude, latitude2=latitude2, - longitude=longitude, longitude2=longitude2, - opacity=opacity, order=order, row=row, shape=shape, - size=size, stroke=stroke, strokeDash=strokeDash, - strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, - text=text, tooltip=tooltip, url=url, x=x, x2=x2, - xError=xError, xError2=xError2, y=y, y2=y2, yError=yError, - yError2=yError2, **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 FieldDefWithConditionMarkPropFieldDefGradientstringnull(VegaLiteSchema): - """FieldDefWithConditionMarkPropFieldDefGradientstringnull schema wrapper - - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` - - Attributes - ---------- - - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -6027,100 +4538,54 @@ class FieldDefWithConditionMarkPropFieldDefGradientstringnull(VegaLiteSchema): 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 : :class:`ValueConditionGradientstringnull` - One or more value definition(s) with `a selection 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. + `__ property. - If ``null``, the scale will be `disabled and the data value will be directly encoded - `__. + **Default value:** ``false`` - **Default value:** If undefined, default `scale properties - `__ are applied. + **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:** `scale `__ + **See also:** `field `__ documentation. - sort : :class:`Sort` + + **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 : :class:`Header` + 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 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. + 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`` and sorting by another channel is not supported for ``row`` and - ``column``. - - **See also:** `sort `__ - documentation. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -6147,78 +4612,101 @@ class FieldDefWithConditionMarkPropFieldDefGradientstringnull(VegaLiteSchema): 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/FieldDefWithCondition'} + _schema = {'$ref': '#/definitions/FacetFieldDef'} - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(FieldDefWithConditionMarkPropFieldDefGradientstringnull, self).__init__(type=type, - aggregate=aggregate, - bin=bin, - condition=condition, - field=field, - legend=legend, - scale=scale, - sort=sort, - timeUnit=timeUnit, - title=title, - **kwds) - - -class FieldDefWithConditionMarkPropFieldDefTypeForShapestringnull(VegaLiteSchema): - """FieldDefWithConditionMarkPropFieldDefTypeForShapestringnull schema wrapper + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, + **kwds): + super(FacetFieldDef, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, + header=header, sort=sort, timeUnit=timeUnit, title=title, + type=type, **kwds) - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` - Attributes - ---------- +class FacetFieldDefFieldName(VegaLiteSchema): + """FacetFieldDefFieldName schema wrapper - type : :class:`TypeForShape` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. + Mapping(required=[]) - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + Attributes + ---------- - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -6240,94 +4728,49 @@ class FieldDefWithConditionMarkPropFieldDefTypeForShapestringnull(VegaLiteSchema **See also:** `bin `__ documentation. - condition : :class:`ValueConditionstringnull` - One or more value definition(s) with `a selection 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` + field : :class:`FieldName` **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 + 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` + **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 : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortFieldFieldName`, + None) Sort order for the encoded field. For continuous fields (quantitative or temporal), ``sort`` can be either ``"ascending"`` or ``"descending"``. - For discrete fields, ``sort`` can be one of the following: - - - * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in - JavaScript. - * `A string indicating an encoding channel name to sort by - `__ (e.g., - ``"x"`` or ``"y"`` ) with an optional minus prefix for descending sort (e.g., - ``"-x"`` to sort by x-field, descending). This channel string is short-form of `a - sort-by-encoding definition - `__. For - example, ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": - "descending"}``. - * `A sort field definition - `__ for sorting by - another field. - * `An array specifying the field values in preferred order - `__. In this case, the - sort order will obey the values in the array, followed by any unspecified values - in their original order. For discrete time field, values in the sort array can be - `date-time definition objects `__. In addition, for time units - ``"month"`` and ``"day"``, the values can be the month or day names (case - insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - * ``null`` indicating no sort. + 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`` and sorting by another channel is not supported for ``row`` and - ``column``. - - **See also:** `sort `__ - documentation. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -6354,282 +4797,372 @@ class FieldDefWithConditionMarkPropFieldDefTypeForShapestringnull(VegaLiteSchema 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/FieldDefWithCondition,(string|null)>'} + _schema = {'$ref': '#/definitions/FacetFieldDef'} - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(FieldDefWithConditionMarkPropFieldDefTypeForShapestringnull, self).__init__(type=type, - aggregate=aggregate, - bin=bin, - condition=condition, - field=field, - legend=legend, - scale=scale, - sort=sort, - timeUnit=timeUnit, - title=title, - **kwds) - - -class FieldDefWithConditionMarkPropFieldDefnumber(VegaLiteSchema): - """FieldDefWithConditionMarkPropFieldDefnumber schema wrapper + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, + **kwds): + super(FacetFieldDefFieldName, self).__init__(aggregate=aggregate, band=band, bin=bin, + field=field, header=header, sort=sort, + timeUnit=timeUnit, title=title, type=type, **kwds) - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` + +class FacetMapping(VegaLiteSchema): + """FacetMapping schema wrapper + + Mapping(required=[]) Attributes ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. + 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'} - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(FacetMapping, self).__init__(column=column, row=row, **kwds) - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). - **Default value:** ``undefined`` (None) +class FacetMappingFieldName(VegaLiteSchema): + """FacetMappingFieldName schema wrapper - **See also:** `aggregate `__ - documentation. - 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"`` ). + Mapping(required=[]) + Attributes + ---------- - If ``true``, default `binning parameters - `__ will be applied. + column : :class:`FacetFieldDefFieldName` + A field definition for the horizontal facet of trellis plots. + row : :class:`FacetFieldDefFieldName` + A field definition for the vertical facet of trellis plots. + """ + _schema = {'$ref': '#/definitions/FacetMapping'} - 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. + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(FacetMappingFieldName, self).__init__(column=column, row=row, **kwds) - **Default value:** ``false`` - **See also:** `bin `__ - documentation. - condition : :class:`ValueConditionnumber` - One or more value definition(s) with `a selection or a test predicate - `__. +class FacetedEncoding(VegaLiteSchema): + """FacetedEncoding schema wrapper - **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. + Mapping(required=[]) - **See also:** `field `__ - documentation. + Attributes + ---------- - **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. + 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, default `legend properties - `__ are applied. + **Default value:** If undefined, the default color depends on `mark config + `__ 's ``color`` + property. - **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. + *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 ``null``, the scale will be `disabled and the data value will be directly encoded - `__. + 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. - **Default value:** If undefined, default `scale properties - `__ are applied. + *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. - **See also:** `scale `__ - documentation. - sort : :class:`Sort` - Sort order for the encoded field. + **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. - For continuous fields (quantitative or temporal), ``sort`` can be either - ``"ascending"`` or ``"descending"``. + **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 - 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:** 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 + `__. - **Default value:** ``"ascending"`` + 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``. - **Note:** ``null`` and sorting by another channel is not supported for ``row`` and - ``column``. + 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"``. - **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 - `__. + 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"``. + y : :class:`PositionDef` + Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without + specified ``y2`` or ``height``. - **Default value:** ``undefined`` (None) + 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"``. - **See also:** `timeUnit `__ - documentation. - title : anyOf(:class:`Text`, None) - A title for the field. If ``null``, the title will be removed. + 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"``. + """ + _schema = {'$ref': '#/definitions/FacetedEncoding'} - **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. + 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, y=Undefined, + y2=Undefined, yError=Undefined, yError2=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, y=y, + y2=y2, yError=yError, yError2=yError2, **kwds) - **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 - `__. +class Field(VegaLiteSchema): + """Field schema wrapper - 2) If both field definition's ``title`` and axis, header, or legend ``title`` are - defined, axis/header/legend title will be used. + anyOf(:class:`FieldName`, :class:`RepeatRef`) """ - _schema = {'$ref': '#/definitions/FieldDefWithCondition'} + _schema = {'$ref': '#/definitions/Field'} - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(FieldDefWithConditionMarkPropFieldDefnumber, self).__init__(type=type, - aggregate=aggregate, bin=bin, - condition=condition, - field=field, legend=legend, - scale=scale, sort=sort, - timeUnit=timeUnit, - title=title, **kwds) + def __init__(self, *args, **kwds): + super(Field, self).__init__(*args, **kwds) -class FieldDefWithConditionStringFieldDefText(VegaLiteSchema): - """FieldDefWithConditionStringFieldDefText schema wrapper +class FieldDefWithoutScale(VegaLiteSchema): + """FieldDefWithoutScale schema wrapper - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` + Mapping(required=[]) + Definition object for a data field, its type and transformation of an encoding channel. Attributes ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -6650,73 +5183,24 @@ class FieldDefWithConditionStringFieldDefText(VegaLiteSchema): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionText` - One or more value definition(s) with `a selection 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 + 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, Mapping(required=[])) - 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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. - - **Default value:** Derived from `numberFormat - `__ config for number - format and from `timeFormat - `__ config for time - format. - formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** - - - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. - labelExpr : string - `Vega expression `__ for customizing - labels text. - - **Note:** The label text and value can be assessed via the ``label`` and ``value`` - properties of the axis's backing ``datum`` object. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -6743,75 +5227,113 @@ class FieldDefWithConditionStringFieldDefText(VegaLiteSchema): 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/FieldDefWithCondition'} + _schema = {'$ref': '#/definitions/FieldDefWithoutScale'} - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(FieldDefWithConditionStringFieldDefText, self).__init__(type=type, aggregate=aggregate, - bin=bin, condition=condition, - field=field, format=format, - formatType=formatType, - labelExpr=labelExpr, - timeUnit=timeUnit, title=title, - **kwds) + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(FieldDefWithoutScale, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) -class FieldDefWithConditionStringFieldDefstring(VegaLiteSchema): - """FieldDefWithConditionStringFieldDefstring schema wrapper +class FieldName(Field): + """FieldName schema wrapper - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` + string + """ + _schema = {'$ref': '#/definitions/FieldName'} - Attributes - ---------- + def __init__(self, *args): + super(FieldName, self).__init__(*args) - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). +class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): + """FieldOrDatumDefWithConditionStringFieldDefstring schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -6832,7 +5354,8 @@ class FieldDefWithConditionStringFieldDefstring(VegaLiteSchema): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionstring` + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -6841,38 +5364,36 @@ class FieldDefWithConditionStringFieldDefstring(VegaLiteSchema): 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 + 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, Mapping(required=[])) + **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:`Dictunknown`) 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 + `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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. + 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 @@ -6880,15 +5401,13 @@ class FieldDefWithConditionStringFieldDefstring(VegaLiteSchema): `__ config for time format. formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** - + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. + **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``. labelExpr : string `Vega expression `__ for customizing labels text. @@ -6897,8 +5416,7 @@ class FieldDefWithConditionStringFieldDefstring(VegaLiteSchema): properties of the axis's backing ``datum`` object. 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -6925,160 +5443,79 @@ class FieldDefWithConditionStringFieldDefstring(VegaLiteSchema): 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/FieldDefWithCondition'} - - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(FieldDefWithConditionStringFieldDefstring, self).__init__(type=type, aggregate=aggregate, - bin=bin, condition=condition, - field=field, format=format, - formatType=formatType, - labelExpr=labelExpr, - timeUnit=timeUnit, title=title, - **kwds) - - -class FieldDefWithoutScale(VegaLiteSchema): - """FieldDefWithoutScale schema wrapper - - Mapping(required=[type]) - Definition object for a data field, its type and transformation of an encoding channel. - - Attributes - ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). - - **Default value:** ``undefined`` (None) - - **See also:** `aggregate `__ - documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), 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/FieldDefWithoutScale'} - - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(FieldDefWithoutScale, self).__init__(type=type, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + 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:** -class FieldName(Field): - """FieldName schema wrapper + 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`` ). - string + **See also:** `type `__ + documentation. """ - _schema = {'$ref': '#/definitions/FieldName'} + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} - def __init__(self, *args): - super(FieldName, self).__init__(*args) + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionStringFieldDefstring, self).__init__(aggregate=aggregate, + band=band, bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + labelExpr=labelExpr, + timeUnit=timeUnit, + title=title, type=type, + **kwds) class Fit(VegaLiteSchema): @@ -7186,7 +5623,7 @@ class GraticuleGenerator(Generator): Attributes ---------- - graticule : anyOf(enum(True), :class:`GraticuleParams`) + graticule : anyOf(boolean, :class:`GraticuleParams`) Generate graticule GeoJSON data for geographic reference lines. name : string Provide a placeholder name and bind data at runtime. @@ -7244,23 +5681,23 @@ class Header(VegaLiteSchema): Attributes ---------- - format : anyOf(string, Mapping(required=[])) + format : anyOf(string, :class:`Dictunknown`) 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 + `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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. + 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 @@ -7268,16 +5705,14 @@ class Header(VegaLiteSchema): `__ config for time format. formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** - - - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. - labelAlign : :class:`Align` + 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` @@ -7288,13 +5723,13 @@ class Header(VegaLiteSchema): The rotation angle of the header labels. **Default value:** ``0`` for column header, ``-90`` for row header. - labelBaseline : :class:`TextBaseline` + 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 + ``"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 : :class:`Color` + 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 @@ -7302,26 +5737,26 @@ class Header(VegaLiteSchema): **Note:** The label text and value can be assessed via the ``label`` and ``value`` properties of the header's backing ``datum`` object. - labelFont : string + labelFont : anyOf(string, :class:`ExprRef`) The font of the header label. - labelFontSize : float + labelFontSize : anyOf(float, :class:`ExprRef`) The font size of the header label, in pixels. - labelFontStyle : :class:`FontStyle` + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) The font style of the header label. - labelFontWeight : :class:`FontWeight` + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) The font weight of the header label. - labelLimit : float + 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 : float + 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 : float + labelPadding : anyOf(float, :class:`ExprRef`) The padding, in pixel, between facet header's label and the plot. **Default value:** ``10`` @@ -7351,7 +5786,7 @@ class Header(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - titleAlign : :class:`Align` + 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 @@ -7361,39 +5796,38 @@ class Header(VegaLiteSchema): The rotation angle of the header title. **Default value:** ``0``. - titleBaseline : :class:`TextBaseline` + 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 + ``"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 : :class:`Color` + titleColor : anyOf(:class:`Color`, :class:`ExprRef`) Color of the header title, can be in hex color code or regular color name. - titleFont : string + titleFont : anyOf(string, :class:`ExprRef`) Font of the header title. (e.g., ``"Helvetica Neue"`` ). - titleFontSize : float + titleFontSize : anyOf(float, :class:`ExprRef`) Font size of the header title. - titleFontStyle : :class:`FontStyle` + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) The font style of the header title. - titleFontWeight : :class:`FontWeight` - 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 : float + 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 : float + 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 : float + titlePadding : anyOf(float, :class:`ExprRef`) The padding, in pixel, between facet header's title and the label. **Default value:** ``10`` @@ -7436,23 +5870,23 @@ class HeaderConfig(VegaLiteSchema): Attributes ---------- - format : anyOf(string, Mapping(required=[])) + format : anyOf(string, :class:`Dictunknown`) 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 + `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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. + 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 @@ -7460,16 +5894,14 @@ class HeaderConfig(VegaLiteSchema): `__ config for time format. formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** - - - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. - labelAlign : :class:`Align` + 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` @@ -7480,13 +5912,13 @@ class HeaderConfig(VegaLiteSchema): The rotation angle of the header labels. **Default value:** ``0`` for column header, ``-90`` for row header. - labelBaseline : :class:`TextBaseline` + 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 + ``"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 : :class:`Color` + 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 @@ -7494,26 +5926,26 @@ class HeaderConfig(VegaLiteSchema): **Note:** The label text and value can be assessed via the ``label`` and ``value`` properties of the header's backing ``datum`` object. - labelFont : string + labelFont : anyOf(string, :class:`ExprRef`) The font of the header label. - labelFontSize : float + labelFontSize : anyOf(float, :class:`ExprRef`) The font size of the header label, in pixels. - labelFontStyle : :class:`FontStyle` + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) The font style of the header label. - labelFontWeight : :class:`FontWeight` + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) The font weight of the header label. - labelLimit : float + 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 : float + 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 : float + labelPadding : anyOf(float, :class:`ExprRef`) The padding, in pixel, between facet header's label and the plot. **Default value:** ``10`` @@ -7525,7 +5957,7 @@ class HeaderConfig(VegaLiteSchema): Shortcut for setting both labelOrient and titleOrient. title : None Set to null to disable title for the axis, legend, or header. - titleAlign : :class:`Align` + 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 @@ -7535,39 +5967,38 @@ class HeaderConfig(VegaLiteSchema): The rotation angle of the header title. **Default value:** ``0``. - titleBaseline : :class:`TextBaseline` + 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 + ``"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 : :class:`Color` + titleColor : anyOf(:class:`Color`, :class:`ExprRef`) Color of the header title, can be in hex color code or regular color name. - titleFont : string + titleFont : anyOf(string, :class:`ExprRef`) Font of the header title. (e.g., ``"Helvetica Neue"`` ). - titleFontSize : float + titleFontSize : anyOf(float, :class:`ExprRef`) Font size of the header title. - titleFontStyle : :class:`FontStyle` + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) The font style of the header title. - titleFontWeight : :class:`FontWeight` - 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 : float + 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 : float + 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 : float + titlePadding : anyOf(float, :class:`ExprRef`) The padding, in pixel, between facet header's title and the label. **Default value:** ``10`` @@ -7643,8 +6074,8 @@ class ImputeParams(VegaLiteSchema): **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 + 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 @@ -7654,8 +6085,8 @@ class ImputeParams(VegaLiteSchema): 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"``. + 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 @@ -7679,11 +6110,10 @@ class ImputeSequence(VegaLiteSchema): stop : float The ending value(exclusive) of the sequence. start : float - The starting value of the sequence. - **Default value:** ``0`` + 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`` + The step value between sequence entries. **Default value:** ``1`` or ``-1`` if + ``stop < start`` """ _schema = {'$ref': '#/definitions/ImputeSequence'} @@ -7701,9 +6131,8 @@ class InlineData(DataSource): 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. + 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 @@ -7780,17 +6209,15 @@ class IntervalSelectionConfig(VegaLiteSchema): Attributes ---------- - bind : enum('scales') - Establishes a two-way binding between the interval selection and the scales - used within the same view. This allows a user to interactively pan and - zoom the view. + bind : string + Establishes a two-way binding between the interval selection and the scales used + within the same view. This allows a user to interactively pan and zoom the view. **See also:** `bind `__ documentation. clear : anyOf(:class:`Stream`, string, boolean) - Clears the selection, emptying it of all values. Can be a - `Event Stream `__ or ``false`` to - disable. + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. **Default value:** ``dblclick``. @@ -7800,60 +6227,59 @@ class IntervalSelectionConfig(VegaLiteSchema): By default, ``all`` data values are considered to lie within an empty selection. When set to ``none``, empty selections contain no data values. 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. + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. **See also:** `encodings `__ documentation. fields : List(:class:`FieldName`) - An array of field names whose values must match for a data tuple to - fall within the selection. + An array of field names whose values must match for a data tuple to fall within the + selection. **See also:** `fields `__ documentation. init : :class:`SelectionInitIntervalMapping` Initialize the selection with a mapping between `projected channels or field names - `__ and arrays of - initial values. + `__ and arrays of initial + values. **See also:** `init `__ 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. + 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 `__ 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 + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end `__. 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. + 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. **See also:** `resolve `__ 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. + 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. - **Default value:** ``true``, which corresponds to - ``[mousedown, window:mouseup] > window:mousemove!`` which corresponds to - clicks and dragging within an interval selection to reposition it. + **Default value:** ``true``, which corresponds to ``[mousedown, window:mouseup] > + window:mousemove!`` which corresponds to clicks and dragging within an interval + selection to reposition it. **See also:** `translate `__ 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. + 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. **Default value:** ``true``, which corresponds to ``wheel!``. @@ -7905,13 +6331,12 @@ class JsonDataFormat(DataFormat): 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. + 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() `__. @@ -7921,18 +6346,15 @@ class JsonDataFormat(DataFormat): 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 : enum('json') + 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. + file URL. If no extension is detected, ``"json"`` will be used by default. """ _schema = {'$ref': '#/definitions/JsonDataFormat'} @@ -7943,7 +6365,7 @@ def __init__(self, parse=Undefined, property=Undefined, type=Undefined, **kwds): class LabelOverlap(VegaLiteSchema): """LabelOverlap schema wrapper - anyOf(boolean, enum('parity'), enum('greedy')) + anyOf(boolean, string, string) """ _schema = {'$ref': '#/definitions/LabelOverlap'} @@ -7951,7 +6373,18 @@ def __init__(self, *args, **kwds): super(LabelOverlap, self).__init__(*args, **kwds) -class LatLongFieldDef(VegaLiteSchema): +class LatLongDef(VegaLiteSchema): + """LatLongDef schema wrapper + + anyOf(:class:`LatLongFieldDef`, :class:`DatumDef`, :class:`NumericValueDef`) + """ + _schema = {'$ref': '#/definitions/LatLongDef'} + + def __init__(self, *args, **kwds): + super(LatLongDef, self).__init__(*args, **kwds) + + +class LatLongFieldDef(LatLongDef): """LatLongFieldDef schema wrapper Mapping(required=[]) @@ -7960,13 +6393,24 @@ class LatLongFieldDef(VegaLiteSchema): ---------- aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : None A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -7990,25 +6434,22 @@ class LatLongFieldDef(VegaLiteSchema): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -8035,51 +6476,93 @@ class LatLongFieldDef(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - type : enum('quantitative') - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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, bin=Undefined, field=Undefined, timeUnit=Undefined, - title=Undefined, type=Undefined, **kwds): - super(LatLongFieldDef, self).__init__(aggregate=aggregate, bin=bin, field=field, + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(LatLongFieldDef, self).__init__(aggregate=aggregate, band=band, 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 @@ -8100,46 +6583,44 @@ class Legend(VegaLiteSchema): Attributes ---------- - clipHeight : float - The height in pixels to clip symbol legend entries and limit their size. - columnPadding : float - The horizontal padding in pixels between symbol legend entries. + 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`) - **Default value:** ``10``. - columns : float - 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. - cornerRadius : float - Corner radius for the full legend. direction : :class:`Orientation` The direction of the legend, one of ``"vertical"`` or ``"horizontal"``. - **Default value:** - + **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`) - * 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(None, :class:`Color`) - Background fill color for the full legend. - format : anyOf(string, Mapping(required=[])) + format : anyOf(string, :class:`Dictunknown`) 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 + `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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. + 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 @@ -8147,152 +6628,98 @@ class Legend(VegaLiteSchema): `__ config for time format. formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. - **Default value:** + **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`) - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. - gradientLength : float - 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. + gradientStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) - **Default value:** ``200``. - gradientOpacity : float - Opacity of the color gradient. - gradientStrokeColor : anyOf(None, :class:`Color`) - The color of the gradient stroke, can be in hex color code or regular color name. + gradientStrokeWidth : anyOf(float, :class:`ExprRef`) - **Default value:** ``"lightGray"``. - gradientStrokeWidth : float - The width of the gradient stroke, in pixels. + 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`) - **Default value:** ``0``. - gradientThickness : float - 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. - - **Default value:** ``16``. - gridAlign : :class:`LayoutAlign` - 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 `__. - - **Default value:** ``"each"``. - labelAlign : :class:`Align` - The alignment of the legend label, can be left, center, or right. - labelBaseline : :class:`TextBaseline` - The position of the baseline of legend label, can be ``"top"``, ``"middle"``, - ``"bottom"``, or ``"alphabetic"``. - - **Default value:** ``"middle"``. - labelColor : anyOf(None, :class:`Color`) - The color of the legend 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 legend's backing ``datum`` object. - labelFont : string - The font of the legend label. - labelFontSize : float - The font size of legend label. - - **Default value:** ``10``. - labelFontStyle : :class:`FontStyle` - The font style of legend label. - labelFontWeight : :class:`FontWeight` - The font weight of legend label. - labelLimit : float - Maximum allowed pixel width of legend tick labels. - - **Default value:** ``160``. - labelOffset : float - The offset of the legend label. - labelOpacity : float - Opacity of labels. - labelOverlap : :class:`LabelOverlap` - 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). + labelFont : anyOf(string, :class:`ExprRef`) - **Default value:** ``true``. - labelPadding : float - Padding in pixels between the legend and legend labels. - labelSeparation : float - 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. - legendX : float - Custom x-position for legend with orient "none". - legendY : float - Custom y-position for legend with orient "none". - offset : float - The offset in pixels by which to displace the legend from the data rectangle and - axes. + 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`) - **Default value:** ``18``. 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 : float - The padding between the border and content of the legend group. + padding : anyOf(float, :class:`ExprRef`) - **Default value:** ``0``. - rowPadding : float - The vertical padding in pixels between symbol legend entries. - - **Default value:** ``2``. - strokeColor : anyOf(None, :class:`Color`) - Border stroke color for the full legend. - symbolDash : List(float) - An array of alternating [stroke, space] lengths for dashed symbol strokes. - symbolDashOffset : float - The pixel offset at which to start drawing with the symbol stroke dash array. - symbolFillColor : anyOf(None, :class:`Color`) - The color of the legend symbol, - symbolLimit : float - The maximum number of allowed entries for a symbol legend. Additional entries will - be dropped. - symbolOffset : float - Horizontal pixel offset for legend symbols. + rowPadding : anyOf(float, :class:`ExprRef`) - **Default value:** ``0``. - symbolOpacity : float - Opacity of the legend symbols. - symbolSize : float - The size of the legend symbol, in pixels. + strokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) - **Default value:** ``100``. - symbolStrokeColor : anyOf(None, :class:`Color`) - Stroke color for legend symbols. - symbolStrokeWidth : float - The width of the symbol's stroke. + symbolDash : anyOf(List(float), :class:`ExprRef`) - **Default value:** ``1.5``. - symbolType : :class:`SymbolShape` - 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 `__ 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. - - **Default value:** ``"circle"``. - tickCount : :class:`TickCount` - The desired number of tick values for quantitative legends. - tickMinStep : float + 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 @@ -8319,81 +6746,72 @@ class Legend(VegaLiteSchema): 2) If both field definition's ``title`` and axis, header, or legend ``title`` are defined, axis/header/legend title will be used. - titleAlign : :class:`Align` - Horizontal text alignment for legend titles. + titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) - **Default value:** ``"left"``. - titleAnchor : :class:`TitleAnchor` - Text anchor position for placing legend titles. - titleBaseline : :class:`TextBaseline` - Vertical text baseline for legend titles. - - **Default value:** ``"top"``. - titleColor : anyOf(None, :class:`Color`) - The color of the legend title, can be in hex color code or regular color name. - titleFont : string - The font of the legend title. - titleFontSize : float - The font size of the legend title. - titleFontStyle : :class:`FontStyle` - The font style of the legend title. - titleFontWeight : :class:`FontWeight` - 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`` - ). - titleLimit : float - Maximum allowed pixel width of legend titles. - - **Default value:** ``180``. - titleLineHeight : float - Line height in pixels for multi-line title text. - titleOpacity : float - Opacity of the legend title. - titleOrient : :class:`Orient` - Orientation of the legend title. - titlePadding : float - The padding, in pixels, between title and legend. + 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`) - **Default value:** ``5``. 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`)) + 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. + 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, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, - cornerRadius=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__(clipHeight=clipHeight, columnPadding=columnPadding, - columns=columns, cornerRadius=cornerRadius, direction=direction, - fillColor=fillColor, format=format, formatType=formatType, + 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, @@ -8426,7 +6844,7 @@ def __init__(self, clipHeight=Undefined, columnPadding=Undefined, columns=Undefi class LegendBinding(VegaLiteSchema): """LegendBinding schema wrapper - anyOf(enum('legend'), :class:`LegendStreamBinding`) + anyOf(string, :class:`LegendStreamBinding`) """ _schema = {'$ref': '#/definitions/LegendBinding'} @@ -8442,35 +6860,31 @@ class LegendConfig(VegaLiteSchema): Attributes ---------- - clipHeight : float - The height in pixels to clip symbol legend entries and limit their size. - columnPadding : float - The horizontal padding in pixels between symbol legend entries. + aria : anyOf(boolean, :class:`ExprRef`) - **Default value:** ``10``. - columns : float - 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. - cornerRadius : float - Corner radius for the full legend. - direction : :class:`Orientation` - The direction of the legend, one of ``"vertical"`` or ``"horizontal"``. + clipHeight : anyOf(float, :class:`ExprRef`) - **Default value:** + columnPadding : anyOf(float, :class:`ExprRef`) + + columns : anyOf(float, :class:`ExprRef`) + + cornerRadius : anyOf(float, :class:`ExprRef`) + description : anyOf(string, :class:`ExprRef`) - * 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. + 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(None, :class:`Color`) - Background fill color for the full legend. - gradientDirection : :class:`Orientation` - The default direction ( ``"horizontal"`` or ``"vertical"`` ) for gradient legends. + fillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + gradientDirection : anyOf(:class:`Orientation`, :class:`ExprRef`) - **Default value:** ``"vertical"``. gradientHorizontalMaxLength : float Max legend length for a horizontal gradient when ``config.legend.gradientLength`` is undefined. @@ -8481,32 +6895,20 @@ class LegendConfig(VegaLiteSchema): undefined. **Default value:** ``100`` - gradientLabelLimit : float - The maximum allowed length in pixels of color ramp gradient labels. - gradientLabelOffset : float - Vertical offset in pixels for color ramp gradient labels. - - **Default value:** ``2``. - gradientLength : float - 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. - - **Default value:** ``200``. - gradientOpacity : float - Opacity of the color gradient. - gradientStrokeColor : anyOf(None, :class:`Color`) - The color of the gradient stroke, can be in hex color code or regular color name. - - **Default value:** ``"lightGray"``. - gradientStrokeWidth : float - The width of the gradient stroke, in pixels. + gradientLabelLimit : anyOf(float, :class:`ExprRef`) - **Default value:** ``0``. - gradientThickness : float - 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. + 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`) - **Default value:** ``16``. gradientVerticalMaxLength : float Max legend length for a vertical gradient when ``config.legend.gradientLength`` is undefined. @@ -8517,40 +6919,29 @@ class LegendConfig(VegaLiteSchema): undefined. **Default value:** ``100`` - gridAlign : :class:`LayoutAlign` - 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 `__. - - **Default value:** ``"each"``. - labelAlign : :class:`Align` - The alignment of the legend label, can be left, center, or right. - labelBaseline : :class:`TextBaseline` - The position of the baseline of legend label, can be ``"top"``, ``"middle"``, - ``"bottom"``, or ``"alphabetic"``. - - **Default value:** ``"middle"``. - labelColor : anyOf(None, :class:`Color`) - The color of the legend label, can be in hex color code or regular color name. - labelFont : string - The font of the legend label. - labelFontSize : float - The font size of legend label. - - **Default value:** ``10``. - labelFontStyle : :class:`FontStyle` - The font style of legend label. - labelFontWeight : :class:`FontWeight` - The font weight of legend label. - labelLimit : float - Maximum allowed pixel width of legend tick labels. - - **Default value:** ``160``. - labelOffset : float - The offset of the legend label. - labelOpacity : float - Opacity of labels. - labelOverlap : :class:`LabelOverlap` + 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 @@ -8558,167 +6949,127 @@ class LegendConfig(VegaLiteSchema): visible label (this often works better for log-scaled axes). **Default value:** ``"greedy"`` for ``log scales otherwise`` true`. - labelPadding : float - Padding in pixels between the legend and legend labels. - labelSeparation : float - 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. - layout : not Any - Legend orient group layout parameters. - legendX : float - Custom x-position for legend with orient "none". - legendY : float - Custom y-position for legend with orient "none". - offset : float - The offset in pixels by which to displace the legend from the data rectangle and - axes. + 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`) - **Default value:** ``18``. 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 : float - The padding between the border and content of the legend group. + padding : anyOf(float, :class:`ExprRef`) - **Default value:** ``0``. - rowPadding : float - The vertical padding in pixels between symbol legend entries. + rowPadding : anyOf(float, :class:`ExprRef`) - **Default value:** ``2``. - strokeColor : anyOf(None, :class:`Color`) - Border stroke color for the full legend. - strokeDash : List(float) - Border stroke dash pattern for the full legend. - strokeWidth : float - Border stroke width for the full legend. - symbolBaseFillColor : anyOf(None, :class:`Color`) - Default fill color for legend symbols. Only applied if there is no ``"fill"`` scale - color encoding for the legend. - - **Default value:** ``"transparent"``. - symbolBaseStrokeColor : anyOf(None, :class:`Color`) - Default stroke color for legend symbols. Only applied if there is no ``"fill"`` - scale color encoding for the legend. - - **Default value:** ``"gray"``. - symbolDash : List(float) - An array of alternating [stroke, space] lengths for dashed symbol strokes. - symbolDashOffset : float - The pixel offset at which to start drawing with the symbol stroke dash array. - symbolDirection : :class:`Orientation` - The default direction ( ``"horizontal"`` or ``"vertical"`` ) for symbol legends. + strokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) - **Default value:** ``"vertical"``. - symbolFillColor : anyOf(None, :class:`Color`) - The color of the legend symbol, - symbolLimit : float - The maximum number of allowed entries for a symbol legend. Additional entries will - be dropped. - symbolOffset : float - Horizontal pixel offset for legend symbols. + strokeDash : anyOf(List(float), :class:`ExprRef`) - **Default value:** ``0``. - symbolOpacity : float - Opacity of the legend symbols. - symbolSize : float - The size of the legend symbol, in pixels. + strokeWidth : anyOf(float, :class:`ExprRef`) - **Default value:** ``100``. - symbolStrokeColor : anyOf(None, :class:`Color`) - Stroke color for legend symbols. - symbolStrokeWidth : float - The width of the symbol's stroke. + 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`) - **Default value:** ``1.5``. - symbolType : :class:`SymbolShape` - 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 `__ 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. - - **Default value:** ``"circle"``. - tickCount : :class:`TickCount` - The desired number of tick values for quantitative legends. title : None Set to null to disable title for the axis, legend, or header. - titleAlign : :class:`Align` - Horizontal text alignment for legend titles. + titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) - **Default value:** ``"left"``. - titleAnchor : :class:`TitleAnchor` - Text anchor position for placing legend titles. - titleBaseline : :class:`TextBaseline` - Vertical text baseline for legend titles. - - **Default value:** ``"top"``. - titleColor : anyOf(None, :class:`Color`) - The color of the legend title, can be in hex color code or regular color name. - titleFont : string - The font of the legend title. - titleFontSize : float - The font size of the legend title. - titleFontStyle : :class:`FontStyle` - The font style of the legend title. - titleFontWeight : :class:`FontWeight` - 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`` - ). - titleLimit : float - Maximum allowed pixel width of legend titles. - - **Default value:** ``180``. - titleLineHeight : float - Line height in pixels for multi-line title text. - titleOpacity : float - Opacity of the legend title. - titleOrient : :class:`Orient` - Orientation of the legend title. - titlePadding : float - The padding, in pixels, between title and legend. + 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`) - **Default value:** ``5``. unselectedOpacity : float The opacity of unselected legend entries. **Default value:** 0.35. + zindex : anyOf(float, :class:`ExprRef`) + """ _schema = {'$ref': '#/definitions/LegendConfig'} - def __init__(self, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, - cornerRadius=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, **kwds): - super(LegendConfig, self).__init__(clipHeight=clipHeight, columnPadding=columnPadding, - columns=columns, cornerRadius=cornerRadius, + 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, @@ -8759,7 +7110,7 @@ def __init__(self, clipHeight=Undefined, columnPadding=Undefined, columns=Undefi titleFontWeight=titleFontWeight, titleLimit=titleLimit, titleLineHeight=titleLineHeight, titleOpacity=titleOpacity, titleOrient=titleOrient, titlePadding=titlePadding, - unselectedOpacity=unselectedOpacity, **kwds) + unselectedOpacity=unselectedOpacity, zindex=zindex, **kwds) class LegendOrient(VegaLiteSchema): @@ -8782,6 +7133,8 @@ class LegendResolveMap(VegaLiteSchema): Attributes ---------- + angle : :class:`ResolveMode` + color : :class:`ResolveMode` fill : :class:`ResolveMode` @@ -8805,13 +7158,14 @@ class LegendResolveMap(VegaLiteSchema): """ _schema = {'$ref': '#/definitions/LegendResolveMap'} - def __init__(self, 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__(color=color, fill=fill, fillOpacity=fillOpacity, - opacity=opacity, shape=shape, size=size, stroke=stroke, - strokeDash=strokeDash, strokeOpacity=strokeOpacity, - strokeWidth=strokeWidth, **kwds) + 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): @@ -8839,84 +7193,75 @@ class LineConfig(AnyMarkConfig): Attributes ---------- - align : :class:`Align` + 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"``. - angle : float - The rotation angle of the text, in degrees. - aspect : boolean - Whether to keep aspect ratio of image marks. - baseline : :class:`TextBaseline` - The vertical text baseline. 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. - blend : :class:`Blend` - The color blend mode for drawing an item on its current background. Any valid `CSS - mix-blend-mode `__ - value can be used. - - __Default value: ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`) + + **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:** + **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`) - * This property cannot be used in a `style config - `__. - * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and - will override ``color``. - cornerRadius : float - The radius in pixels of rounded rectangle corners. + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomLeft : float - The radius in pixels of rounded rectangle bottom left corner. + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomRight : float - The radius in pixels of rounded rectangle bottom right corner. + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopLeft : float - The radius in pixels of rounded rectangle top right corner. + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopRight : float - The radius in pixels of rounded rectangle top left corner. + description : anyOf(string, :class:`ExprRef`) - **Default value:** ``0`` - cursor : :class:`Cursor` - The mouse cursor used over the mark. Any valid `CSS cursor type - `__ can be used. - dir : :class:`TextDirection` - 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. - - **Default value:** ``"ltr"`` - dx : float - The horizontal offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - dy : float - The vertical offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - ellipsis : string - The ellipsis string for text truncated in response to the limit parameter. - - **Default value:** ``"…"`` - fill : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Fill Color. This property has higher precedence than ``config.color``. + 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 : float - The fill opacity (value between [0,1]). + fillOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` filled : boolean Whether the mark's color should be used as fill color instead of stroke color. @@ -8927,66 +7272,36 @@ class LineConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config `__. - font : string - The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : float - The font size, in pixels. - - **Default value:** ``11`` - fontStyle : :class:`FontStyle` - The font style (e.g., ``"italic"`` ). - fontWeight : :class:`FontWeight` - 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`` - ). - height : float - Height of the marks. - href : string - A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - interpolate : :class:`Interpolate` - The line interpolation method to use for line and area marks. One of the following: - - - * ``"linear"`` : piecewise linear segments, as in a polyline. - * ``"linear-closed"`` : close the linear segments to form a polygon. - * ``"step"`` : alternate between horizontal and vertical segments, as in a step - function. - * ``"step-before"`` : alternate between vertical and horizontal segments, as in a - step function. - * ``"step-after"`` : alternate between horizontal and vertical segments, as in a - step function. - * ``"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. + 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``. + 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`) - * 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 : float - The maximum length of the text mark in pixels. The text value will be automatically - truncated if the rendered size exceeds the limit. + lineHeight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` -- indicating no limit - lineBreak : string - 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. - lineHeight : float - The line height in pixels (the spacing between subsequent lines of text) for - multi-line text marks. - opacity : float + opacity : anyOf(float, :class:`ExprRef`) The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, @@ -8995,19 +7310,19 @@ class LineConfig(AnyMarkConfig): 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. - point : anyOf(boolean, :class:`OverlayMarkDef`, enum('transparent')) + 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``. + 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. @@ -9022,124 +7337,107 @@ class LineConfig(AnyMarkConfig): area marks. **Default value:** ``false``. - radius : float - Polar coordinate radial offset, in pixels, of the text label from the origin - determined by the ``x`` and ``y`` properties. - shape : anyOf(:class:`SymbolShape`, string) - Shape of the point marks. 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.) - - **Default value:** ``"circle"`` - size : float - Default size for marks. + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) - * 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. + 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:** + **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`) - * ``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. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Stroke Color. This property has higher precedence than ``config.color``. + 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 : string - The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or - ``"square"``. + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) - **Default value:** ``"butt"`` - strokeDash : List(float) - An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : float - The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : string - The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. - - **Default value:** ``"miter"`` - strokeMiterLimit : float - The miter limit at which to bevel a line join. - strokeOffset : float - 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. - strokeOpacity : float - The stroke opacity (value between [0,1]). + strokeDash : anyOf(List(float), :class:`ExprRef`) - **Default value:** ``1`` - strokeWidth : float - The stroke width, in pixels. - tension : float - Depending on the interpolation type, sets the tension parameter (for line and area - marks). - text : :class:`Text` - Placeholder text if the ``text`` channel is not specified - theta : float - Polar coordinate angle, in radians, of the text label from the origin determined by - the ``x`` and ``y`` properties. Values for ``theta`` follow the same convention of - ``arc`` mark ``startAngle`` and ``endAngle`` properties: angles are measured in - radians, with ``0`` indicating "north". + 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. timeUnitBand : 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. + 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. 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. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, None) + 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. + 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. + ``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`` - width : float - Width of the marks. - x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('height')) + 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 @@ -9147,43 +7445,51 @@ class LineConfig(AnyMarkConfig): """ _schema = {'$ref': '#/definitions/LineConfig'} - def __init__(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - blend=Undefined, color=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, fill=Undefined, + 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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, lineBreak=Undefined, - lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, - point=Undefined, radius=Undefined, shape=Undefined, size=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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, - y2=Undefined, **kwds): - super(LineConfig, self).__init__(align=align, angle=angle, aspect=aspect, baseline=baseline, - blend=blend, color=color, cornerRadius=cornerRadius, + 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, + timeUnitBand=Undefined, timeUnitBandPosition=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, - dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, + 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, interpolate=interpolate, - invalid=invalid, limit=limit, lineBreak=lineBreak, - lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, - size=size, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, - strokeOffset=strokeOffset, strokeOpacity=strokeOpacity, - strokeWidth=strokeWidth, tension=tension, text=text, - theta=theta, timeUnitBand=timeUnitBand, + 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, + timeUnitBand=timeUnitBand, timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) class LinearGradient(Gradient): @@ -9194,7 +7500,7 @@ class LinearGradient(Gradient): Attributes ---------- - gradient : enum('linear') + 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. @@ -9238,8 +7544,8 @@ class LookupData(VegaLiteSchema): 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. + Fields in foreign data or selection to lookup. If not specified, the entire object + is queried. """ _schema = {'$ref': '#/definitions/LookupData'} @@ -9260,8 +7566,8 @@ class LookupSelection(VegaLiteSchema): selection : string Selection name to look up. fields : List(:class:`FieldName`) - Fields in foreign data or selection to lookup. - If not specified, the entire object is queried. + Fields in foreign data or selection to lookup. If not specified, the entire object + is queried. """ _schema = {'$ref': '#/definitions/LookupSelection'} @@ -9272,8 +7578,8 @@ def __init__(self, key=Undefined, selection=Undefined, fields=Undefined, **kwds) class Mark(AnyMark): """Mark schema wrapper - enum('area', 'bar', 'line', 'image', 'trail', 'point', 'text', 'tick', 'rect', 'rule', - 'circle', 'square', 'geoshape') + enum('arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', + 'trail', 'circle', 'square', 'geoshape') All types of primitive marks. """ _schema = {'$ref': '#/definitions/Mark'} @@ -9290,84 +7596,75 @@ class MarkConfig(AnyMarkConfig): Attributes ---------- - align : :class:`Align` + 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"``. - angle : float - The rotation angle of the text, in degrees. - aspect : boolean - Whether to keep aspect ratio of image marks. - baseline : :class:`TextBaseline` - The vertical text baseline. 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. - blend : :class:`Blend` - The color blend mode for drawing an item on its current background. Any valid `CSS - mix-blend-mode `__ - value can be used. - - __Default value: ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`) + + **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:** + **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`) - * This property cannot be used in a `style config - `__. - * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and - will override ``color``. - cornerRadius : float - The radius in pixels of rounded rectangle corners. + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomLeft : float - The radius in pixels of rounded rectangle bottom left corner. + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomRight : float - The radius in pixels of rounded rectangle bottom right corner. + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopLeft : float - The radius in pixels of rounded rectangle top right corner. + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopRight : float - The radius in pixels of rounded rectangle top left corner. + description : anyOf(string, :class:`ExprRef`) - **Default value:** ``0`` - cursor : :class:`Cursor` - The mouse cursor used over the mark. Any valid `CSS cursor type - `__ can be used. - dir : :class:`TextDirection` - 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. - - **Default value:** ``"ltr"`` - dx : float - The horizontal offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - dy : float - The vertical offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - ellipsis : string - The ellipsis string for text truncated in response to the limit parameter. - - **Default value:** ``"…"`` - fill : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Fill Color. This property has higher precedence than ``config.color``. + 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 : float - The fill opacity (value between [0,1]). + fillOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` filled : boolean Whether the mark's color should be used as fill color instead of stroke color. @@ -9378,66 +7675,36 @@ class MarkConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config `__. - font : string - The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : float - The font size, in pixels. - - **Default value:** ``11`` - fontStyle : :class:`FontStyle` - The font style (e.g., ``"italic"`` ). - fontWeight : :class:`FontWeight` - 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`` - ). - height : float - Height of the marks. - href : string - A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - interpolate : :class:`Interpolate` - The line interpolation method to use for line and area marks. One of the following: - - - * ``"linear"`` : piecewise linear segments, as in a polyline. - * ``"linear-closed"`` : close the linear segments to form a polygon. - * ``"step"`` : alternate between horizontal and vertical segments, as in a step - function. - * ``"step-before"`` : alternate between vertical and horizontal segments, as in a - step function. - * ``"step-after"`` : alternate between horizontal and vertical segments, as in a - step function. - * ``"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. + 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``. + 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`) - * 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 : float - The maximum length of the text mark in pixels. The text value will be automatically - truncated if the rendered size exceeds the limit. + lineHeight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` -- indicating no limit - lineBreak : string - 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. - lineHeight : float - The line height in pixels (the spacing between subsequent lines of text) for - multi-line text marks. - opacity : float + opacity : anyOf(float, :class:`ExprRef`) The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, @@ -9446,136 +7713,119 @@ class MarkConfig(AnyMarkConfig): 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. - radius : float - Polar coordinate radial offset, in pixels, of the text label from the origin - determined by the ``x`` and ``y`` properties. - shape : anyOf(:class:`SymbolShape`, string) - Shape of the point marks. 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.) - - **Default value:** ``"circle"`` - size : float - Default size for marks. + 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``. + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + 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`) - * 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. + strokeDash : anyOf(List(float), :class:`ExprRef`) - **Default value:** + strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) - * ``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. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Stroke Color. This property has higher precedence than ``config.color``. + strokeMiterLimit : anyOf(float, :class:`ExprRef`) - **Default value:** (None) - strokeCap : string - The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or - ``"square"``. + strokeOffset : anyOf(float, :class:`ExprRef`) - **Default value:** ``"butt"`` - strokeDash : List(float) - An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : float - The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : string - The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. - - **Default value:** ``"miter"`` - strokeMiterLimit : float - The miter limit at which to bevel a line join. - strokeOffset : float - 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. - strokeOpacity : float - The stroke opacity (value between [0,1]). + strokeOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` - strokeWidth : float - The stroke width, in pixels. - tension : float - Depending on the interpolation type, sets the tension parameter (for line and area - marks). - text : :class:`Text` - Placeholder text if the ``text`` channel is not specified - theta : float - Polar coordinate angle, in radians, of the text label from the origin determined by - the ``x`` and ``y`` properties. Values for ``theta`` follow the same convention of - ``arc`` mark ``startAngle`` and ``endAngle`` properties: angles are measured in - radians, with ``0`` indicating "north". + 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. timeUnitBand : 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. + 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. 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. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, None) + 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. + 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. + ``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`` - width : float - Width of the marks. - x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('height')) + 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 @@ -9583,43 +7833,355 @@ class MarkConfig(AnyMarkConfig): """ _schema = {'$ref': '#/definitions/MarkConfig'} - def __init__(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - blend=Undefined, color=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, fill=Undefined, + 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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, lineBreak=Undefined, - lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, - radius=Undefined, shape=Undefined, size=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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, - y2=Undefined, **kwds): - super(MarkConfig, self).__init__(align=align, angle=angle, aspect=aspect, baseline=baseline, - blend=blend, color=color, cornerRadius=cornerRadius, + 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, + timeUnitBand=Undefined, timeUnitBandPosition=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, - dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, + 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, interpolate=interpolate, - invalid=invalid, limit=limit, lineBreak=lineBreak, - lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, radius=radius, shape=shape, size=size, - stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + 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, + tension=tension, text=text, theta=theta, theta2=theta2, timeUnitBand=timeUnitBand, timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class MarkConfigExprOrSignalRef(VegaLiteSchema): + """MarkConfigExprOrSignalRef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + + aria : anyOf(boolean, :class:`ExprOrSignalRef`) + + ariaRole : anyOf(string, :class:`ExprOrSignalRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprOrSignalRef`) + + aspect : anyOf(boolean, :class:`ExprOrSignalRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprOrSignalRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprOrSignalRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprOrSignalRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprOrSignalRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprOrSignalRef`) + + description : anyOf(string, :class:`ExprOrSignalRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprOrSignalRef`) + + dx : anyOf(float, :class:`ExprOrSignalRef`) + + dy : anyOf(float, :class:`ExprOrSignalRef`) + + ellipsis : anyOf(string, :class:`ExprOrSignalRef`) + + endAngle : anyOf(float, :class:`ExprOrSignalRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprOrSignalRef`) + Default fill color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove fill. + + **Default value:** (None) + fillOpacity : anyOf(float, :class:`ExprOrSignalRef`) + + 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:`ExprOrSignalRef`) + + fontSize : anyOf(float, :class:`ExprOrSignalRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprOrSignalRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprOrSignalRef`) + + height : anyOf(float, :class:`ExprOrSignalRef`) + + href : anyOf(:class:`URI`, :class:`ExprOrSignalRef`) + + innerRadius : anyOf(float, :class:`ExprOrSignalRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprOrSignalRef`) + + 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:`ExprOrSignalRef`) + + lineBreak : anyOf(string, :class:`ExprOrSignalRef`) + + lineHeight : anyOf(float, :class:`ExprOrSignalRef`) + + opacity : anyOf(float, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + padAngle : anyOf(float, :class:`ExprOrSignalRef`) + + radius : anyOf(float, :class:`ExprOrSignalRef`) + 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. + radius2 : anyOf(float, :class:`ExprOrSignalRef`) + The secondary (inner) radius in pixels of arc marks. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprOrSignalRef`) + + size : anyOf(float, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + + startAngle : anyOf(float, :class:`ExprOrSignalRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + + strokeDash : anyOf(List(float), :class:`ExprOrSignalRef`) + + strokeDashOffset : anyOf(float, :class:`ExprOrSignalRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprOrSignalRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprOrSignalRef`) + + strokeOffset : anyOf(float, :class:`ExprOrSignalRef`) + + strokeOpacity : anyOf(float, :class:`ExprOrSignalRef`) + + strokeWidth : anyOf(float, :class:`ExprOrSignalRef`) + + tension : anyOf(float, :class:`ExprOrSignalRef`) + + text : anyOf(:class:`Text`, :class:`ExprOrSignalRef`) + + theta : anyOf(float, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + timeUnitBand : 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. + 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. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprOrSignalRef`, + 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:`ExprOrSignalRef`) + + width : anyOf(float, :class:`ExprOrSignalRef`) + + x : anyOf(float, string, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + 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, + timeUnitBand=Undefined, timeUnitBandPosition=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, + **kwds): + super(MarkConfigExprOrSignalRef, 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, + timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, + tooltip=tooltip, url=url, width=width, x=x, + x2=x2, y=y, y2=y2, **kwds) class MarkDef(AnyMark): @@ -9631,98 +8193,99 @@ class MarkDef(AnyMark): ---------- 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 : :class:`Align` + 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"``. - angle : float - The rotation angle of the text, in degrees. - aspect : boolean - Whether to keep aspect ratio of image marks. - baseline : :class:`TextBaseline` - The vertical text baseline. 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. + + **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 : :class:`Blend` - The color blend mode for drawing an item on its current background. Any valid `CSS - mix-blend-mode `__ - value can be used. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) - __Default value: ``"source-over"`` clip : boolean Whether a mark be clipped to the enclosing group’s width and height. - color : anyOf(:class:`Color`, :class:`Gradient`) + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) Default color. **Default value:** :raw-html:`` ``"#4682b4"`` - **Note:** + **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`) - * This property cannot be used in a `style config - `__. - * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and - will override ``color``. - cornerRadius : float - The radius in pixels of rounded rectangle corners. + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomLeft : float - The radius in pixels of rounded rectangle bottom left corner. + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomRight : float - The radius in pixels of rounded rectangle bottom right corner. + 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`) - **Default value:** ``0`` - cornerRadiusEnd : float - * For vertical bars, top-left and top-right corner radius. - * For horizontal bars, top-right and bottom-right corner radius. - cornerRadiusTopLeft : float - The radius in pixels of rounded rectangle top right corner. + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopRight : float - The radius in pixels of rounded rectangle top left corner. + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) - **Default value:** ``0`` - cursor : :class:`Cursor` - The mouse cursor used over the mark. Any valid `CSS cursor type - `__ can be used. - dir : :class:`TextDirection` - 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. - - **Default value:** ``"ltr"`` - dx : float - The horizontal offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - dy : float - The vertical offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - ellipsis : string - The ellipsis string for text truncated in response to the limit parameter. - - **Default value:** ``"…"`` - fill : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Fill Color. This property has higher precedence than ``config.color``. + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + discreteBandSize : float + 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 : float - The fill opacity (value between [0,1]). + fillOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` filled : boolean Whether the mark's color should be used as fill color instead of stroke color. @@ -9731,61 +8294,33 @@ class MarkDef(AnyMark): `__ data sources; otherwise, ``true``. - **Note:** This property cannot be used in a `style config - `__. - font : string - The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : float - The font size, in pixels. - - **Default value:** ``11`` - fontStyle : :class:`FontStyle` - The font style (e.g., ``"italic"`` ). - fontWeight : :class:`FontWeight` - 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`` - ). - height : float - Height of the marks. - href : string - A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - interpolate : :class:`Interpolate` - The line interpolation method to use for line and area marks. One of the following: - - - * ``"linear"`` : piecewise linear segments, as in a polyline. - * ``"linear-closed"`` : close the linear segments to form a polygon. - * ``"step"`` : alternate between horizontal and vertical segments, as in a step - function. - * ``"step-before"`` : alternate between vertical and horizontal segments, as in a - step function. - * ``"step-after"`` : alternate between horizontal and vertical segments, as in a - step function. - * ``"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. + **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``. + 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 : float - The maximum length of the text mark in pixels. The text value will be automatically - truncated if the rendered size exceeds the limit. + ). - 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`) - **Default value:** ``0`` -- indicating no limit 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. @@ -9797,13 +8332,11 @@ class MarkDef(AnyMark): If this value is ``false``, no lines would be automatically added to area marks. **Default value:** ``false``. - lineBreak : string - 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. - lineHeight : float - The line height in pixels (the spacing between subsequent lines of text) for - multi-line text marks. - opacity : float + 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``, @@ -9812,19 +8345,19 @@ class MarkDef(AnyMark): 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. - point : anyOf(boolean, :class:`OverlayMarkDef`, enum('transparent')) + 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``. + 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. @@ -9839,70 +8372,52 @@ class MarkDef(AnyMark): area marks. **Default value:** ``false``. - radius : float - Polar coordinate radial offset, in pixels, of the text label from the origin - determined by the ``x`` and ``y`` properties. - shape : anyOf(:class:`SymbolShape`, string) - Shape of the point marks. 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.) - - **Default value:** ``"circle"`` - size : float - Default size for marks. + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + 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`) - * 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. + strokeDashOffset : anyOf(float, :class:`ExprRef`) - **Default value:** + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeMiterLimit : anyOf(float, :class:`ExprRef`) - * ``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. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Stroke Color. This property has higher precedence than ``config.color``. + strokeOffset : anyOf(float, :class:`ExprRef`) - **Default value:** (None) - strokeCap : string - The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or - ``"square"``. + strokeOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``"butt"`` - strokeDash : List(float) - An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : float - The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : string - The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. - - **Default value:** ``"miter"`` - strokeMiterLimit : float - The miter limit at which to bevel a line join. - strokeOffset : float - 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. - strokeOpacity : float - The stroke opacity (value between [0,1]). + strokeWidth : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` - strokeWidth : float - The stroke width, in pixels. 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 @@ -9913,126 +8428,519 @@ class MarkDef(AnyMark): 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 : float - Depending on the interpolation type, sets the tension parameter (for line and area - marks). - text : :class:`Text` - Placeholder text if the ``text`` channel is not specified - theta : float - Polar coordinate angle, in radians, of the text label from the origin determined by - the ``x`` and ``y`` properties. Values for ``theta`` follow the same convention of - ``arc`` mark ``startAngle`` and ``endAngle`` properties: angles are measured in - radians, with ``0`` indicating "north". + ``"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`` timeUnitBand : 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. + 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. 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. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, None) + 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. + 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. + ``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`` - width : float - Width of the marks. - x : anyOf(float, enum('width')) + 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, enum('width')) + 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 : float + x2Offset : anyOf(float, :class:`ExprRef`) Offset for x2-position. - xOffset : float + xOffset : anyOf(float, :class:`ExprRef`) Offset for x-position. - y : anyOf(float, enum('height')) + 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, enum('height')) + 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 : float + y2Offset : anyOf(float, :class:`ExprRef`) Offset for y2-position. - yOffset : float + yOffset : anyOf(float, :class:`ExprRef`) Offset for y-position. """ _schema = {'$ref': '#/definitions/MarkDef'} - def __init__(self, type=Undefined, align=Undefined, angle=Undefined, aspect=Undefined, - baseline=Undefined, binSpacing=Undefined, blend=Undefined, clip=Undefined, - color=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=Undefined, - stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + 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, - thickness=Undefined, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + theta2Offset=Undefined, thetaOffset=Undefined, thickness=Undefined, + timeUnitBand=Undefined, timeUnitBandPosition=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, aspect=aspect, - baseline=baseline, binSpacing=binSpacing, blend=blend, clip=clip, - color=color, cornerRadius=cornerRadius, + 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, dir=dir, - dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, - fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, - height=height, href=href, interpolate=interpolate, - invalid=invalid, limit=limit, line=line, lineBreak=lineBreak, + 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, point=point, radius=radius, shape=shape, size=size, - stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + 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, thickness=thickness, - timeUnitBand=timeUnitBand, + tension=tension, text=text, theta=theta, theta2=theta2, + theta2Offset=theta2Offset, thetaOffset=thetaOffset, + thickness=thickness, timeUnitBand=timeUnitBand, timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, - width=width, x=x, x2=x2, x2Offset=x2Offset, xOffset=xOffset, y=y, - y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + 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 + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, datum=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefGradientstringnull, self).__init__(band=band, + condition=condition, + datum=datum, + 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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 selection 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, band=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, + band=band, + 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 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): @@ -10068,17 +8976,16 @@ class MultiSelectionConfig(VegaLiteSchema): bind : :class:`LegendBinding` When set, a selection is populated by interacting with the corresponding legend. - Direct manipulation interaction is disabled by default; - to re-enable it, set the selection's `on + 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. clear : anyOf(:class:`Stream`, string, boolean) - Clears the selection, emptying it of all values. Can be a - `Event Stream `__ or ``false`` to - disable. + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. **Default value:** ``dblclick``. @@ -10088,21 +8995,21 @@ class MultiSelectionConfig(VegaLiteSchema): By default, ``all`` data values are considered to lie within an empty selection. When set to ``none``, empty selections contain no data values. 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. + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. **See also:** `encodings `__ documentation. fields : List(:class:`FieldName`) - An array of field names whose values must match for a data tuple to - fall within the selection. + An array of field names whose values must match for a data tuple to fall within the + selection. **See also:** `fields `__ documentation. init : List(:class:`SelectionInitMapping`) Initialize the selection with a mapping between `projected channels or field names - `__ and an initial - value (or array of values). + `__ and an initial value (or + array of values). **See also:** `init `__ documentation. @@ -10114,23 +9021,26 @@ class MultiSelectionConfig(VegaLiteSchema): 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 + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end `__. 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. + 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. **See also:** `resolve `__ documentation. toggle : anyOf(string, boolean) - Controls whether data values should be toggled or only ever inserted into - multi selections. Can be ``true``, ``false`` (for insertion only), or a - `Vega expression `__. + Controls whether data values should be toggled or only ever inserted into multi + selections. Can be ``true``, ``false`` (for insertion only), or a `Vega expression + `__. + + **Default value:** ``true``, which corresponds to ``event.shiftKey`` (i.e., data + values are toggled when a user interacts with the shift-key pressed). - **Default value:** ``true``, which corresponds to ``event.shiftKey`` (i.e., - data values are toggled when a user interacts with the shift-key pressed). + Setting the value to the Vega expression ``"true"`` will toggle data values without + the user pressing the shift-key. **See also:** `toggle `__ documentation. @@ -10204,15 +9114,14 @@ class NormalizedConcatSpecGenericSpec(NormalizedSpec): concat : List(:class:`NormalizedSpec`) 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"``. + 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 + 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. @@ -10226,10 +9135,10 @@ class NormalizedConcatSpecGenericSpec(NormalizedSpec): * 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. + 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`) @@ -10244,18 +9153,14 @@ class NormalizedConcatSpecGenericSpec(NormalizedSpec): 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`` ). + 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) + 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`` ). @@ -10269,9 +9174,9 @@ class NormalizedConcatSpecGenericSpec(NormalizedSpec): 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. + 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 `__ ( @@ -10303,23 +9208,22 @@ class NormalizedFacetSpec(NormalizedSpec): ---------- 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 + 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"``. + 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 + 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. @@ -10333,10 +9237,10 @@ class NormalizedFacetSpec(NormalizedSpec): * 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. + 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`) @@ -10351,18 +9255,14 @@ class NormalizedFacetSpec(NormalizedSpec): 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`` ). + 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) + 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`` ). @@ -10376,9 +9276,9 @@ class NormalizedFacetSpec(NormalizedSpec): 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. + 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 `__ ( @@ -10418,10 +9318,10 @@ class NormalizedHConcatSpecGenericSpec(NormalizedSpec): * 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. + 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 @@ -10476,10 +9376,10 @@ class NormalizedVConcatSpecGenericSpec(NormalizedSpec): * 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. + 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 @@ -10517,80 +9417,158 @@ def __init__(self, vconcat=Undefined, bounds=Undefined, center=Undefined, data=U title=title, transform=transform, **kwds) -class NumberValueDef(VegaLiteSchema): - """NumberValueDef schema wrapper +class NumericArrayMarkPropDef(VegaLiteSchema): + """NumericArrayMarkPropDef schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, + :class:`FieldOrDatumDefWithConditionDatumDefnumber`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`) + """ + _schema = {'$ref': '#/definitions/NumericArrayMarkPropDef'} + + def __init__(self, *args, **kwds): + super(NumericArrayMarkPropDef, self).__init__(*args, **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, NumericArrayMarkPropDef, NumericMarkPropDef): + """FieldOrDatumDefWithConditionDatumDefnumber schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection 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. + 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``. - Mapping(required=[value]) - Definition object for a constant value (primitive value or gradient definition) of an - encoding channel. + **Default value:** - Attributes - ---------- + 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`` ). - value : float - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + **See also:** `type `__ + documentation. """ - _schema = {'$ref': '#/definitions/NumberValueDef'} + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} - def __init__(self, value=Undefined, **kwds): - super(NumberValueDef, self).__init__(value=value, **kwds) + def __init__(self, band=Undefined, condition=Undefined, datum=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefnumber, self).__init__(band=band, condition=condition, + datum=datum, type=type, **kwds) -class NumericArrayFieldDefWithCondition(VegaLiteSchema): - """NumericArrayFieldDefWithCondition schema wrapper +class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, NumericArrayMarkPropDef, NumericMarkPropDef): + """FieldOrDatumDefWithConditionMarkPropFieldDefnumber schema wrapper - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -10612,7 +9590,8 @@ class NumericArrayFieldDefWithCondition(VegaLiteSchema): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionnumber` + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -10621,24 +9600,22 @@ class NumericArrayFieldDefWithCondition(VegaLiteSchema): 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 + 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``. + **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. + 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. @@ -10664,30 +9641,25 @@ class NumericArrayFieldDefWithCondition(VegaLiteSchema): 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. + 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"`` @@ -10698,8 +9670,196 @@ class NumericArrayFieldDefWithCondition(VegaLiteSchema): 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 + 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, band=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, + band=band, bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, sort=sort, + timeUnit=timeUnit, + title=title, type=type, + **kwds) + + +class NumericValueDef(LatLongDef): + """NumericValueDef schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + 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). + """ + _schema = {'$ref': '#/definitions/NumericValueDef'} + + def __init__(self, value=Undefined, **kwds): + super(NumericValueDef, self).__init__(value=value, **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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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) @@ -10716,896 +9876,1197 @@ class NumericArrayFieldDefWithCondition(VegaLiteSchema): parentheses (e.g., ``"Profit (binned)"``, ``"Transaction Date (year-month)"`` ). Otherwise, the title is simply the field name. - **Notes** : + **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, band=Undefined, bin=Undefined, field=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(OrderFieldDef, self).__init__(aggregate=aggregate, band=band, 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 selection 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`) - 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 - `__. + fontSize : anyOf(float, :class:`ExprRef`) - 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/NumericArrayFieldDefWithCondition'} + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(NumericArrayFieldDefWithCondition, self).__init__(type=type, aggregate=aggregate, bin=bin, - condition=condition, field=field, - legend=legend, scale=scale, sort=sort, - timeUnit=timeUnit, title=title, **kwds) + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + height : anyOf(float, :class:`ExprRef`) -class NumericArrayValueDefWithCondition(VegaLiteSchema): - """NumericArrayValueDefWithCondition schema wrapper + href : anyOf(:class:`URI`, :class:`ExprRef`) - Mapping(required=[]) + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) - Attributes - ---------- + 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`) - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionnumber`) - A field definition or one or more value definition(s) with a selection predicate. - value : List(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/NumericArrayValueDefWithCondition'} + lineBreak : anyOf(string, :class:`ExprRef`) - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(NumericArrayValueDefWithCondition, self).__init__(condition=condition, value=value, **kwds) + lineHeight : anyOf(float, :class:`ExprRef`) + opacity : anyOf(float, :class:`ExprRef`) + The overall opacity (value between [0,1]). -class NumericFieldDefWithCondition(VegaLiteSchema): - """NumericFieldDefWithCondition schema wrapper + **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``. + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + 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. - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` + **Default value:** (None) + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) - Attributes - ---------- + strokeDash : anyOf(List(float), :class:`ExprRef`) - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. + strokeDashOffset : anyOf(float, :class:`ExprRef`) - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + strokeMiterLimit : anyOf(float, :class:`ExprRef`) - **Default value:** ``undefined`` (None) + strokeOffset : anyOf(float, :class:`ExprRef`) - **See also:** `aggregate `__ - documentation. - 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"`` ). + strokeOpacity : anyOf(float, :class:`ExprRef`) + strokeWidth : anyOf(float, :class:`ExprRef`) - If ``true``, default `binning parameters - `__ will be applied. + 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. - 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:** 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. + timeUnitBand : 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. + 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. + 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. - **Default value:** ``false`` - **See also:** `bin `__ - documentation. - condition : :class:`ValueConditionnumber` - One or more value definition(s) with `a selection or a test predicate - `__. + * 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. - **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 the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. - **See also:** `field `__ - documentation. + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) - **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. + width : anyOf(float, :class:`ExprRef`) - **Default value:** If undefined, default `legend properties - `__ are applied. + x : anyOf(float, string, :class:`ExprRef`) + X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without + specified ``x2`` or ``width``. - **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. + 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"``. - If ``null``, the scale will be `disabled and the data value will be directly encoded - `__. + 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``. - **Default value:** If undefined, default `scale properties - `__ are applied. + 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"``. - **See also:** `scale `__ - documentation. - sort : :class:`Sort` - Sort order for the encoded field. + 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'} - For continuous fields (quantitative or temporal), ``sort`` can be either - ``"ascending"`` or ``"descending"``. + 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, timeUnitBand=Undefined, + timeUnitBandPosition=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, + timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, + url=url, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, + yOffset=yOffset, **kwds) - For discrete fields, ``sort`` can be one of the following: - - - * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in - JavaScript. - * `A string indicating an encoding channel name to sort by - `__ (e.g., - ``"x"`` or ``"y"`` ) with an optional minus prefix for descending sort (e.g., - ``"-x"`` to sort by x-field, descending). This channel string is short-form of `a - sort-by-encoding definition - `__. For - example, ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": - "descending"}``. - * `A sort field definition - `__ for sorting by - another field. - * `An array specifying the field values in preferred order - `__. In this case, the - sort order will obey the values in the array, followed by any unspecified values - in their original order. For discrete time field, values in the sort array can be - `date-time definition objects `__. In addition, for time units - ``"month"`` and ``"day"``, the values can be the month or day names (case - insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - * ``null`` indicating no sort. - **Default value:** ``"ascending"`` +class Padding(VegaLiteSchema): + """Padding schema wrapper - **Note:** ``null`` and sorting by another channel is not supported for ``row`` and - ``column``. + anyOf(float, Mapping(required=[])) + """ + _schema = {'$ref': '#/definitions/Padding'} - **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 - `__. + def __init__(self, *args, **kwds): + super(Padding, self).__init__(*args, **kwds) - **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. +class Parameter(VegaLiteSchema): + """Parameter schema wrapper - **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. + Mapping(required=[name]) - **Notes** : + Attributes + ---------- - 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 - `__. + name : string + Required. A unique name for the 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. + description : string + A text description of the parameter, useful for inline documentation. + 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. - 2) If both field definition's ``title`` and axis, header, or legend ``title`` are - defined, axis/header/legend title will be used. + **Default value:** ``undefined`` """ - _schema = {'$ref': '#/definitions/NumericFieldDefWithCondition'} + _schema = {'$ref': '#/definitions/Parameter'} - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(NumericFieldDefWithCondition, self).__init__(type=type, aggregate=aggregate, bin=bin, - condition=condition, field=field, - legend=legend, scale=scale, sort=sort, - timeUnit=timeUnit, title=title, **kwds) + def __init__(self, name=Undefined, bind=Undefined, description=Undefined, expr=Undefined, + value=Undefined, **kwds): + super(Parameter, self).__init__(name=name, bind=bind, description=description, expr=expr, + value=value, **kwds) -class NumericValueWithCondition(VegaLiteSchema): - """NumericValueWithCondition schema wrapper +class Parse(VegaLiteSchema): + """Parse schema wrapper Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Parse'} - Attributes - ---------- + def __init__(self, **kwds): + super(Parse, self).__init__(**kwds) - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionnumber`) - A field definition or one or more value definition(s) with a selection predicate. - value : float - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + +class ParseValue(VegaLiteSchema): + """ParseValue schema wrapper + + anyOf(None, string, string, string, string, string) """ - _schema = {'$ref': '#/definitions/NumericValueWithCondition'} + _schema = {'$ref': '#/definitions/ParseValue'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(NumericValueWithCondition, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args, **kwds): + super(ParseValue, self).__init__(*args, **kwds) -class OrderFieldDef(VegaLiteSchema): - """OrderFieldDef schema wrapper +class PolarDef(VegaLiteSchema): + """PolarDef schema wrapper - Mapping(required=[type]) + 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 ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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``. - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + **Default value:** - **Default value:** ``undefined`` (None) + 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:** `aggregate `__ + **See also:** `type `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) - A flag for binning a ``quantitative`` field, `an object defining binning parameters - `__, or indicating that the - data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( - ``"binned"`` ). + """ + _schema = {'$ref': '#/definitions/DatumDef'} + def __init__(self, band=Undefined, datum=Undefined, type=Undefined, **kwds): + super(DatumDef, self).__init__(band=band, datum=datum, type=type, **kwds) - 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. +class PositionDatumDefBase(PolarDef): + """PositionDatumDefBase schema wrapper + + Mapping(required=[]) - **Default value:** ``false`` + Attributes + ---------- - **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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. - **See also:** `field `__ - documentation. + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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. - **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 - `__. + If ``null``, the scale will be `disabled and the data value will be directly encoded + `__. - **Default value:** ``undefined`` (None) + **Default value:** If undefined, default `scale properties + `__ are applied. - **See also:** `timeUnit `__ + **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. + 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. - **Notes** : + ``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. - 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 - `__. + **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. - 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/OrderFieldDef'} + **See also:** `stack `__ + documentation. + 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' + `__. - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - sort=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(OrderFieldDef, self).__init__(type=type, aggregate=aggregate, bin=bin, field=field, - sort=sort, timeUnit=timeUnit, title=title, **kwds) + 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:** -class Orient(VegaLiteSchema): - """Orient schema wrapper + 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`` ). - enum('left', 'right', 'top', 'bottom') + **See also:** `type `__ + documentation. """ - _schema = {'$ref': '#/definitions/Orient'} + _schema = {'$ref': '#/definitions/PositionDatumDefBase'} - def __init__(self, *args): - super(Orient, self).__init__(*args) + def __init__(self, band=Undefined, datum=Undefined, scale=Undefined, stack=Undefined, + type=Undefined, **kwds): + super(PositionDatumDefBase, self).__init__(band=band, datum=datum, scale=scale, stack=stack, + type=type, **kwds) -class Orientation(VegaLiteSchema): - """Orientation schema wrapper +class PositionDef(VegaLiteSchema): + """PositionDef schema wrapper - enum('horizontal', 'vertical') + anyOf(:class:`PositionFieldDef`, :class:`PositionDatumDef`, :class:`PositionValueDef`) """ - _schema = {'$ref': '#/definitions/Orientation'} + _schema = {'$ref': '#/definitions/PositionDef'} - def __init__(self, *args): - super(Orientation, self).__init__(*args) + def __init__(self, *args, **kwds): + super(PositionDef, self).__init__(*args, **kwds) -class OverlayMarkDef(VegaLiteSchema): - """OverlayMarkDef schema wrapper +class PositionDatumDef(PositionDef): + """PositionDatumDef schema wrapper Mapping(required=[]) Attributes ---------- - align : :class:`Align` - The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). - One of ``"left"``, ``"right"``, ``"center"``. - angle : float - The rotation angle of the text, in degrees. - aspect : boolean - Whether to keep aspect ratio of image marks. - baseline : :class:`TextBaseline` - The vertical text baseline. 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. - blend : :class:`Blend` - The color blend mode for drawing an item on its current background. Any valid `CSS - mix-blend-mode `__ - value can be used. - - __Default value: ``"source-over"`` - clip : boolean - Whether a mark be clipped to the enclosing group’s width and height. - color : anyOf(:class:`Color`, :class:`Gradient`) - Default color. + 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:** :raw-html:`` - ``"#4682b4"`` + **Default value:** If undefined, default `axis properties + `__ are applied. - **Note:** + **See also:** `axis `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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. - * This property cannot be used in a `style config - `__. - * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and - will override ``color``. - cornerRadius : float - The radius in pixels of rounded rectangle corners. + **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. - **Default value:** ``0`` - cornerRadiusBottomLeft : float - The radius in pixels of rounded rectangle bottom left corner. + If ``null``, the scale will be `disabled and the data value will be directly encoded + `__. - **Default value:** ``0`` - cornerRadiusBottomRight : float - The radius in pixels of rounded rectangle bottom right corner. + **Default value:** If undefined, default `scale properties + `__ are applied. - **Default value:** ``0`` - cornerRadiusTopLeft : float - The radius in pixels of rounded rectangle top right corner. + **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. - **Default value:** ``0`` - cornerRadiusTopRight : float - The radius in pixels of rounded rectangle top left corner. + ``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:** ``0`` - cursor : :class:`Cursor` - The mouse cursor used over the mark. Any valid `CSS cursor type - `__ can be used. - dir : :class:`TextDirection` - 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. - - **Default value:** ``"ltr"`` - dx : float - The horizontal offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - dy : float - The vertical offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - ellipsis : string - The ellipsis string for text truncated in response to the limit parameter. - - **Default value:** ``"…"`` - fill : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Fill Color. This property has higher precedence than ``config.color``. + **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. - **Default value:** (None) - fillOpacity : float - The fill opacity (value between [0,1]). + **See also:** `stack `__ + documentation. + 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' + `__. - **Default value:** ``1`` - filled : boolean - Whether the mark's color should be used as fill color instead of stroke color. + 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:** ``false`` for all ``point``, ``line``, and ``rule`` marks as well - as ``geoshape`` marks for `graticule - `__ data sources; - otherwise, ``true``. + **Default value:** - **Note:** This property cannot be used in a `style config - `__. - font : string - The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : float - The font size, in pixels. - - **Default value:** ``11`` - fontStyle : :class:`FontStyle` - The font style (e.g., ``"italic"`` ). - fontWeight : :class:`FontWeight` - 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`` - ). - height : float - Height of the marks. - href : string - A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - interpolate : :class:`Interpolate` - The line interpolation method to use for line and area marks. One of the following: - - - * ``"linear"`` : piecewise linear segments, as in a polyline. - * ``"linear-closed"`` : close the linear segments to form a polygon. - * ``"step"`` : alternate between horizontal and vertical segments, as in a step - function. - * ``"step-before"`` : alternate between vertical and horizontal segments, as in a - step function. - * ``"step-after"`` : alternate between horizontal and vertical segments, as in a - step function. - * ``"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. - invalid : enum('filter', None) - Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` - ). + 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'} - * 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 : float - The maximum length of the text mark in pixels. The text value will be automatically - truncated if the rendered size exceeds the limit. + def __init__(self, axis=Undefined, band=Undefined, datum=Undefined, impute=Undefined, + scale=Undefined, stack=Undefined, type=Undefined, **kwds): + super(PositionDatumDef, self).__init__(axis=axis, band=band, datum=datum, impute=impute, + scale=scale, stack=stack, type=type, **kwds) - **Default value:** ``0`` -- indicating no limit - lineBreak : string - 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. - lineHeight : float - The line height in pixels (the spacing between subsequent lines of text) for - multi-line text marks. - opacity : float - 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. - radius : float - Polar coordinate radial offset, in pixels, of the text label from the origin - determined by the ``x`` and ``y`` properties. - shape : anyOf(:class:`SymbolShape`, string) - Shape of the point marks. 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.) - - **Default value:** ``"circle"`` - size : float - Default size for marks. +class PositionFieldDef(PositionDef): + """PositionFieldDef schema wrapper + Mapping(required=[]) - * 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. + Attributes + ---------- - **Default value:** + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + **Default value:** ``undefined`` (None) - * ``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. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Stroke Color. This property has higher precedence than ``config.color``. + **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:** (None) - strokeCap : string - The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or - ``"square"``. + **Default value:** If undefined, default `axis properties + `__ are applied. - **Default value:** ``"butt"`` - strokeDash : List(float) - An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : float - The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : string - The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. - - **Default value:** ``"miter"`` - strokeMiterLimit : float - The miter limit at which to bevel a line join. - strokeOffset : float - 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. - strokeOpacity : float - The stroke opacity (value between [0,1]). + **See also:** `axis `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. - **Default value:** ``1`` - strokeWidth : float - The stroke width, in pixels. - 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. + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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"`` ). - **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 : float - Depending on the interpolation type, sets the tension parameter (for line and area - marks). - text : :class:`Text` - Placeholder text if the ``text`` channel is not specified - theta : float - Polar coordinate angle, in radians, of the text label from the origin determined by - the ``x`` and ``y`` properties. Values for ``theta`` follow the same convention of - ``arc`` mark ``startAngle`` and ``endAngle`` properties: angles are measured in - radians, with ``0`` indicating "north". - timeUnitBand : 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. - 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. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, None) - The tooltip text string to show upon mouse hover or an object defining which fields - should the tooltip be derived from. + If ``true``, default `binning parameters + `__ will be applied. - * 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. + 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. - See the `tooltip `__ - documentation for a detailed discussion about tooltip in Vega-Lite. + **Default value:** ``false`` - **Default value:** ``null`` - width : float - Width of the marks. - x : anyOf(float, enum('width')) - X coordinates of the marks, or width of horizontal ``"bar"`` and ``"area"`` without - specified ``x2`` or ``width``. + **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. - The ``value`` of this channel can be a number or a string ``"width"`` for the width - of the plot. - x2 : anyOf(float, enum('width')) - X2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + **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"``. - The ``value`` of this channel can be a number or a string ``"width"`` for the width - of the plot. - x2Offset : float - Offset for x2-position. - xOffset : float - Offset for x-position. - y : anyOf(float, enum('height')) - Y coordinates of the marks, or height of vertical ``"bar"`` and ``"area"`` without - specified ``y2`` or ``height``. + 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. - The ``value`` of this channel can be a number or a string ``"height"`` for the - height of the plot. - y2 : anyOf(float, enum('height')) - Y2 coordinates for ranged ``"area"``, ``"bar"``, ``"rect"``, and ``"rule"``. + **Default value:** ``"ascending"`` - The ``value`` of this channel can be a number or a string ``"height"`` for the - height of the plot. - y2Offset : float - Offset for y2-position. - yOffset : float - Offset for y-position. - """ - _schema = {'$ref': '#/definitions/OverlayMarkDef'} + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. - def __init__(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - blend=Undefined, clip=Undefined, color=Undefined, cornerRadius=Undefined, - cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, lineBreak=Undefined, - lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, - radius=Undefined, shape=Undefined, size=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, timeUnitBand=Undefined, - timeUnitBandPosition=Undefined, tooltip=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, aspect=aspect, baseline=baseline, - blend=blend, clip=clip, color=color, - cornerRadius=cornerRadius, - cornerRadiusBottomLeft=cornerRadiusBottomLeft, - cornerRadiusBottomRight=cornerRadiusBottomRight, - cornerRadiusTopLeft=cornerRadiusTopLeft, - cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, - dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, - fontSize=fontSize, fontStyle=fontStyle, - fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, - lineBreak=lineBreak, lineHeight=lineHeight, - opacity=opacity, order=order, orient=orient, radius=radius, - shape=shape, size=size, 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, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, - width=width, x=x, x2=x2, x2Offset=x2Offset, - xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, - yOffset=yOffset, **kwds) + **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. -class Padding(VegaLiteSchema): - """Padding schema wrapper + **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. - anyOf(float, Mapping(required=[])) - """ - _schema = {'$ref': '#/definitions/Padding'} + **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 + `__. - def __init__(self, *args, **kwds): - super(Padding, self).__init__(*args, **kwds) + **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. -class Parse(VegaLiteSchema): - """Parse schema wrapper + **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. - Mapping(required=[]) - """ - _schema = {'$ref': '#/definitions/Parse'} + **Notes** : - def __init__(self, **kwds): - super(Parse, self).__init__(**kwds) + 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``. -class ParseValue(VegaLiteSchema): - """ParseValue schema wrapper + **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`` ). - anyOf(None, string, enum('string'), enum('boolean'), enum('date'), enum('number')) + **See also:** `type `__ + documentation. """ - _schema = {'$ref': '#/definitions/ParseValue'} + _schema = {'$ref': '#/definitions/PositionFieldDef'} - def __init__(self, *args, **kwds): - super(ParseValue, self).__init__(*args, **kwds) + def __init__(self, aggregate=Undefined, axis=Undefined, band=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, band=band, bin=bin, + field=field, impute=impute, scale=scale, sort=sort, + stack=stack, timeUnit=timeUnit, title=title, type=type, + **kwds) -class PositionFieldDef(VegaLiteSchema): - """PositionFieldDef schema wrapper +class PositionFieldDefBase(PolarDef): + """PositionFieldDefBase schema wrapper - Mapping(required=[type]) + Mapping(required=[]) Attributes ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + 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. band : float For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to - bandwidth of `band scales `__ - or time units. If set to ``1``, the mark size is set to the bandwidth or the time + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time unit interval. For other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to ``0``, the marks will be positioned at the beginning of the band. If set to ``0.5``, the marks will be positioned in the middle of the band. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + 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 ( @@ -11628,30 +11089,19 @@ class PositionFieldDef(VegaLiteSchema): 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 + 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. + **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 @@ -11671,30 +11121,25 @@ class PositionFieldDef(VegaLiteSchema): 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. + 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"`` @@ -11704,40 +11149,33 @@ class PositionFieldDef(VegaLiteSchema): **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`` and ``y`` channels with continuous domains. - For example, ``stack`` of ``y`` can be used to customize stacking for a vertical bar + 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. + ``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`` or ``area`` ; - (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. + (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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -11764,16 +11202,93 @@ class PositionFieldDef(VegaLiteSchema): 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'} + _schema = {'$ref': '#/definitions/PositionFieldDefBase'} - def __init__(self, type=Undefined, aggregate=Undefined, axis=Undefined, band=Undefined, - bin=Undefined, field=Undefined, impute=Undefined, scale=Undefined, sort=Undefined, - stack=Undefined, timeUnit=Undefined, title=Undefined, **kwds): - super(PositionFieldDef, self).__init__(type=type, aggregate=aggregate, axis=axis, band=band, - bin=bin, field=field, impute=impute, scale=scale, - sort=sort, stack=stack, timeUnit=timeUnit, title=title, - **kwds) + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, title=Undefined, + type=Undefined, **kwds): + super(PositionFieldDefBase, self).__init__(aggregate=aggregate, band=band, 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): @@ -11861,7 +11376,7 @@ class FieldEqualPredicate(Predicate): Attributes ---------- - equal : anyOf(string, float, boolean, :class:`DateTime`) + 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. @@ -11884,7 +11399,7 @@ class FieldGTEPredicate(Predicate): field : :class:`FieldName` Field to be tested. - gte : anyOf(string, float, :class:`DateTime`) + 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. @@ -11905,7 +11420,7 @@ class FieldGTPredicate(Predicate): field : :class:`FieldName` Field to be tested. - gt : anyOf(string, float, :class:`DateTime`) + 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. @@ -11926,7 +11441,7 @@ class FieldLTEPredicate(Predicate): field : :class:`FieldName` Field to be tested. - lte : anyOf(string, float, :class:`DateTime`) + 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. @@ -11947,7 +11462,7 @@ class FieldLTPredicate(Predicate): field : :class:`FieldName` Field to be tested. - lt : anyOf(string, float, :class:`DateTime`) + 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. @@ -11969,8 +11484,8 @@ class FieldOneOfPredicate(Predicate): 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. + 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. """ @@ -11990,9 +11505,10 @@ class FieldRangePredicate(Predicate): field : :class:`FieldName` Field to be tested. - range : List(anyOf(float, :class:`DateTime`, None)) - An array of inclusive minimum and maximum values - for a field value of a data item to be included in the filtered data. + 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. """ @@ -12264,7 +11780,7 @@ class RadialGradient(Gradient): Attributes ---------- - gradient : enum('radial') + 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. @@ -12317,19 +11833,19 @@ class RangeConfig(VegaLiteSchema): Attributes ---------- - category : anyOf(:class:`RangeScheme`, List(string)) + category : anyOf(:class:`RangeScheme`, List(:class:`Color`)) Default `color scheme `__ for categorical data. - diverging : anyOf(:class:`RangeScheme`, List(string)) + diverging : anyOf(:class:`RangeScheme`, List(:class:`Color`)) Default `color scheme `__ for diverging quantitative ramps. - heatmap : anyOf(:class:`RangeScheme`, List(string)) + heatmap : anyOf(:class:`RangeScheme`, List(:class:`Color`)) Default `color scheme `__ for quantitative heatmaps. - ordinal : anyOf(:class:`RangeScheme`, List(string)) + ordinal : anyOf(:class:`RangeScheme`, List(:class:`Color`)) Default `color scheme `__ for rank-ordered data. - ramp : anyOf(:class:`RangeScheme`, List(string)) + ramp : anyOf(:class:`RangeScheme`, List(:class:`Color`)) Default `color scheme `__ for sequential quantitative ramps. symbol : List(:class:`SymbolShape`) @@ -12396,96 +11912,87 @@ class RectConfig(AnyMarkConfig): Attributes ---------- - align : :class:`Align` + 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"``. - angle : float - The rotation angle of the text, in degrees. - aspect : boolean - Whether to keep aspect ratio of image marks. - baseline : :class:`TextBaseline` - The vertical text baseline. 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. + + **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 : :class:`Blend` - The color blend mode for drawing an item on its current background. Any valid `CSS - mix-blend-mode `__ - value can be used. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) - __Default value: ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`) + 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``. + **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 : float - The radius in pixels of rounded rectangle corners. + cornerRadius : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomLeft : float - The radius in pixels of rounded rectangle bottom left corner. + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomRight : float - The radius in pixels of rounded rectangle bottom right corner. + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopLeft : float - The radius in pixels of rounded rectangle top right corner. + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopRight : float - The radius in pixels of rounded rectangle top left corner. + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cursor : :class:`Cursor` - The mouse cursor used over the mark. Any valid `CSS cursor type - `__ can be used. - dir : :class:`TextDirection` - 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. + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) - **Default value:** ``"ltr"`` discreteBandSize : float 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 : float - The horizontal offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - dy : float - The vertical offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - ellipsis : string - The ellipsis string for text truncated in response to the limit parameter. - - **Default value:** ``"…"`` - fill : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Fill Color. This property has higher precedence than ``config.color``. + 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 : float - The fill opacity (value between [0,1]). + fillOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` filled : boolean Whether the mark's color should be used as fill color instead of stroke color. @@ -12496,66 +12003,36 @@ class RectConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config `__. - font : string - The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : float - The font size, in pixels. - - **Default value:** ``11`` - fontStyle : :class:`FontStyle` - The font style (e.g., ``"italic"`` ). - fontWeight : :class:`FontWeight` - 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`` - ). - height : float - Height of the marks. - href : string - A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - interpolate : :class:`Interpolate` - The line interpolation method to use for line and area marks. One of the following: - - - * ``"linear"`` : piecewise linear segments, as in a polyline. - * ``"linear-closed"`` : close the linear segments to form a polygon. - * ``"step"`` : alternate between horizontal and vertical segments, as in a step - function. - * ``"step-before"`` : alternate between vertical and horizontal segments, as in a - step function. - * ``"step-after"`` : alternate between horizontal and vertical segments, as in a - step function. - * ``"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. + 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``. + 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`) - * 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 : float - The maximum length of the text mark in pixels. The text value will be automatically - truncated if the rendered size exceeds the limit. + lineHeight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` -- indicating no limit - lineBreak : string - 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. - lineHeight : float - The line height in pixels (the spacing between subsequent lines of text) for - multi-line text marks. - opacity : float + opacity : anyOf(float, :class:`ExprRef`) The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, @@ -12564,136 +12041,119 @@ class RectConfig(AnyMarkConfig): 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. - radius : float - Polar coordinate radial offset, in pixels, of the text label from the origin - determined by the ``x`` and ``y`` properties. - shape : anyOf(:class:`SymbolShape`, string) - Shape of the point marks. 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.) - - **Default value:** ``"circle"`` - size : float - Default size for marks. + 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``. + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + 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`) - * 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. + strokeDashOffset : anyOf(float, :class:`ExprRef`) - **Default value:** + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + strokeMiterLimit : anyOf(float, :class:`ExprRef`) - * ``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. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Stroke Color. This property has higher precedence than ``config.color``. + strokeOffset : anyOf(float, :class:`ExprRef`) - **Default value:** (None) - strokeCap : string - The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or - ``"square"``. + strokeOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``"butt"`` - strokeDash : List(float) - An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : float - The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : string - The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. - - **Default value:** ``"miter"`` - strokeMiterLimit : float - The miter limit at which to bevel a line join. - strokeOffset : float - 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. - strokeOpacity : float - The stroke opacity (value between [0,1]). + strokeWidth : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` - strokeWidth : float - The stroke width, in pixels. - tension : float - Depending on the interpolation type, sets the tension parameter (for line and area - marks). - text : :class:`Text` - Placeholder text if the ``text`` channel is not specified - theta : float - Polar coordinate angle, in radians, of the text label from the origin determined by - the ``x`` and ``y`` properties. Values for ``theta`` follow the same convention of - ``arc`` mark ``startAngle`` and ``endAngle`` properties: angles are measured in - radians, with ``0`` indicating "north". + 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. timeUnitBand : 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. + 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. 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. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, None) + 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. + 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. + ``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`` - width : float - Width of the marks. - x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('height')) + 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 @@ -12701,46 +12161,54 @@ class RectConfig(AnyMarkConfig): """ _schema = {'$ref': '#/definitions/RectConfig'} - def __init__(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, + 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, dir=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, interpolate=Undefined, invalid=Undefined, limit=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, radius=Undefined, shape=Undefined, size=Undefined, stroke=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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, - y2=Undefined, **kwds): - super(RectConfig, self).__init__(align=align, angle=angle, aspect=aspect, baseline=baseline, - binSpacing=binSpacing, blend=blend, color=color, - continuousBandSize=continuousBandSize, + theta=Undefined, theta2=Undefined, timeUnitBand=Undefined, + timeUnitBandPosition=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, - 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, interpolate=interpolate, invalid=invalid, - limit=limit, lineBreak=lineBreak, lineHeight=lineHeight, - opacity=opacity, order=order, orient=orient, radius=radius, - shape=shape, size=size, stroke=stroke, strokeCap=strokeCap, - strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, - strokeOffset=strokeOffset, strokeOpacity=strokeOpacity, - strokeWidth=strokeWidth, tension=tension, text=text, - theta=theta, timeUnitBand=timeUnitBand, + 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, + timeUnitBand=timeUnitBand, timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) class RepeatMapping(VegaLiteSchema): @@ -12771,7 +12239,7 @@ class RepeatRef(Field): Attributes ---------- - repeat : enum('row', 'column', 'repeat') + repeat : enum('row', 'column', 'repeat', 'layer') """ _schema = {'$ref': '#/definitions/RepeatRef'} @@ -12875,69 +12343,43 @@ def __init__(self, column=Undefined, row=Undefined, **kwds): class RowColumnEncodingFieldDef(VegaLiteSchema): """RowColumnEncodingFieldDef schema wrapper - Mapping(required=[type]) + Mapping(required=[]) Attributes ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + 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"``. + 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 + 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"``. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -12966,21 +12408,19 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): **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 + 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``. + **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 : :class:`Header` An object defining properties of a facet's header. sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) @@ -12989,22 +12429,18 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): 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. + 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"`` @@ -13017,8 +12453,7 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): ``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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -13045,16 +12480,74 @@ class RowColumnEncodingFieldDef(VegaLiteSchema): 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, type=Undefined, aggregate=Undefined, align=Undefined, bin=Undefined, + def __init__(self, aggregate=Undefined, align=Undefined, band=Undefined, bin=Undefined, center=Undefined, field=Undefined, header=Undefined, sort=Undefined, spacing=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(RowColumnEncodingFieldDef, self).__init__(type=type, aggregate=aggregate, align=align, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(RowColumnEncodingFieldDef, self).__init__(aggregate=aggregate, align=align, band=band, bin=bin, center=center, field=field, header=header, sort=sort, spacing=spacing, - timeUnit=timeUnit, title=title, **kwds) + timeUnit=timeUnit, title=title, type=type, + **kwds) class Scale(VegaLiteSchema): @@ -13065,7 +12558,7 @@ class Scale(VegaLiteSchema): Attributes ---------- - align : float + 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 @@ -13073,37 +12566,34 @@ class Scale(VegaLiteSchema): shift the bands to one side, say to position them adjacent to an axis. **Default value:** ``0.5`` - base : float + 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 : boolean + 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 : float + 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`)), - enum('unaggregated'), :class:`SelectionExtent`, :class:`DomainUnionWith`) + domain : anyOf(List(anyOf(None, string, float, boolean, :class:`DateTime`, + :class:`ExprRef`)), string, :class:`SelectionExtent`, :class:`DomainUnionWith`, + :class:`ExprRef`) Customized domain values in the form of constant values or dynamic values driven by a selection. @@ -13112,11 +12602,11 @@ class Scale(VegaLiteSchema): * 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. + 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 @@ -13135,16 +12625,23 @@ class Scale(VegaLiteSchema): `interactively determines `__ the scale domain. - domainMid : float + 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. - exponent : float + 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:`ScaleInterpolateParams`) + 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 @@ -13157,7 +12654,8 @@ class Scale(VegaLiteSchema): * **Default value:** ``hcl`` - nice : anyOf(boolean, float, :class:`TimeInterval`, :class:`TimeIntervalStep`) + 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 @@ -13178,7 +12676,7 @@ class Scale(VegaLiteSchema): Apr, Jul, Oct) boundaries. **Default value:** ``true`` for unbinned *quantitative* fields; ``false`` otherwise. - padding : float + 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 @@ -13194,10 +12692,10 @@ class Scale(VegaLiteSchema): **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 : float + ``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]. @@ -13207,16 +12705,16 @@ class Scale(VegaLiteSchema): **Default value:** derived from the `scale config `__ 's ``bandPaddingInner``. - paddingOuter : float - 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]. + 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)))) + 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`)), + Mapping(required=[field])) The range of the scale. One of: @@ -13232,7 +12730,9 @@ class Scale(VegaLiteSchema): For `discrete `__ and `discretizing `__ - scales, an array of desired output values. + 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:** @@ -13242,15 +12742,22 @@ class Scale(VegaLiteSchema): 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`` ). - reverse : boolean - If true, reverses the order of the scale range. - **Default value:** ``false``. - round : boolean + 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`) + scheme : anyOf(string, :class:`SchemeParams`, :class:`ExprRef`) A string indicating a color `scheme `__ name (e.g., ``"category10"`` or ``"blues"`` ) or a `scheme parameter object @@ -13293,7 +12800,7 @@ class Scale(VegaLiteSchema): **Default value:** please see the `scale type table `__. - zero : boolean + 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 @@ -13304,16 +12811,18 @@ class Scale(VegaLiteSchema): _schema = {'$ref': '#/definitions/Scale'} def __init__(self, align=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, - constant=Undefined, domain=Undefined, domainMid=Undefined, exponent=Undefined, - interpolate=Undefined, nice=Undefined, padding=Undefined, paddingInner=Undefined, - paddingOuter=Undefined, range=Undefined, reverse=Undefined, round=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, domainMid=domainMid, exponent=exponent, - interpolate=interpolate, nice=nice, padding=padding, - paddingInner=paddingInner, paddingOuter=paddingOuter, range=range, - reverse=reverse, round=round, scheme=scheme, type=type, zero=zero, - **kwds) + 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): @@ -13360,27 +12869,24 @@ class ScaleConfig(VegaLiteSchema): Attributes ---------- - bandPaddingInner : float + bandPaddingInner : anyOf(float, :class:`ExprRef`) Default inner padding for ``x`` and ``y`` band-ordinal scales. - **Default value:** - - - * ``barBandPaddingInner`` for bar marks ( ``0.1`` by default) - * ``rectBandPaddingInner`` for rect and other marks ( ``0`` by default) - bandPaddingOuter : float + **Default value:** - ``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-ordinal scales. **Default value:** ``paddingInner/2`` (which makes *width/height = number of unique values * step* ) - barBandPaddingInner : float + barBandPaddingInner : anyOf(float, :class:`ExprRef`) Default inner padding for ``x`` and ``y`` band-ordinal scales of ``"bar"`` marks. **Default value:** ``0.1`` - clamp : boolean + clamp : anyOf(boolean, :class:`ExprRef`) If true, values that exceed the data domain are clamped to either the minimum or maximum range value - continuousPadding : float + continuousPadding : anyOf(float, :class:`ExprRef`) Default padding for continuous scales. **Default:** ``5`` for continuous x-scale of a vertical bar and continuous y-scale @@ -13427,7 +12933,7 @@ class ScaleConfig(VegaLiteSchema): of size for trail marks with zero=false. **Default value:** ``1`` - pointPadding : float + 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 * @@ -13442,14 +12948,13 @@ class ScaleConfig(VegaLiteSchema): `__ scale. **Default value:** ``4`` - rectBandPaddingInner : float + rectBandPaddingInner : anyOf(float, :class:`ExprRef`) Default inner padding for ``x`` and ``y`` band-ordinal scales of ``"rect"`` marks. **Default value:** ``0`` - round : boolean - 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.) + 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. @@ -13463,7 +12968,7 @@ class ScaleConfig(VegaLiteSchema): raw data domain (e.g. ``"count"``, ``"sum"`` ), this property is ignored. **Default value:** ``false`` - xReverse : boolean + xReverse : anyOf(boolean, :class:`ExprRef`) Reverse x-scale by default (useful for right-to-left charts). """ _schema = {'$ref': '#/definitions/ScaleConfig'} @@ -13529,6 +13034,8 @@ class ScaleResolveMap(VegaLiteSchema): Attributes ---------- + angle : :class:`ResolveMode` + color : :class:`ResolveMode` fill : :class:`ResolveMode` @@ -13537,6 +13044,8 @@ class ScaleResolveMap(VegaLiteSchema): opacity : :class:`ResolveMode` + radius : :class:`ResolveMode` + shape : :class:`ResolveMode` size : :class:`ResolveMode` @@ -13549,6 +13058,8 @@ class ScaleResolveMap(VegaLiteSchema): strokeWidth : :class:`ResolveMode` + theta : :class:`ResolveMode` + x : :class:`ResolveMode` y : :class:`ResolveMode` @@ -13556,13 +13067,15 @@ class ScaleResolveMap(VegaLiteSchema): """ _schema = {'$ref': '#/definitions/ScaleResolveMap'} - def __init__(self, color=Undefined, fill=Undefined, fillOpacity=Undefined, opacity=Undefined, - shape=Undefined, size=Undefined, stroke=Undefined, strokeDash=Undefined, - strokeOpacity=Undefined, strokeWidth=Undefined, x=Undefined, y=Undefined, **kwds): - super(ScaleResolveMap, self).__init__(color=color, fill=fill, fillOpacity=fillOpacity, - opacity=opacity, shape=shape, size=size, stroke=stroke, + 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, y=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, x=x, y=y, **kwds) + strokeWidth=strokeWidth, theta=theta, x=x, y=y, **kwds) class ScaleType(VegaLiteSchema): @@ -13605,7 +13118,7 @@ def __init__(self, name=Undefined, count=Undefined, extent=Undefined, **kwds): super(SchemeParams, self).__init__(name=name, count=count, extent=extent, **kwds) -class SecondaryFieldDef(VegaLiteSchema): +class SecondaryFieldDef(Position2Def): """SecondaryFieldDef schema wrapper Mapping(required=[]) @@ -13616,13 +13129,24 @@ class SecondaryFieldDef(VegaLiteSchema): ---------- aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : None A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -13646,25 +13170,22 @@ class SecondaryFieldDef(VegaLiteSchema): 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 + 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``. + **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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -13694,9 +13215,9 @@ class SecondaryFieldDef(VegaLiteSchema): """ _schema = {'$ref': '#/definitions/SecondaryFieldDef'} - def __init__(self, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(SecondaryFieldDef, self).__init__(aggregate=aggregate, bin=bin, field=field, + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(SecondaryFieldDef, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, timeUnit=timeUnit, title=title, **kwds) @@ -13739,26 +13260,24 @@ class SelectionConfig(VegaLiteSchema): interval : :class:`IntervalSelectionConfig` The default definition for an `interval `__ selection. All - properties and transformations - for an interval selection definition (except ``type`` ) may be specified here. + 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. + to move interval selections by default. multi : :class:`MultiSelectionConfig` The default definition for a `multi `__ selection. All - properties and transformations - for a multi selection definition (except ``type`` ) may be specified here. + properties and transformations for a multi selection definition (except ``type`` ) + may be specified here. For instance, setting ``multi`` to ``{"toggle": "event.altKey"}`` adds additional - values to - multi selections when clicking with the alt-key pressed by default. + values to multi selections when clicking with the alt-key pressed by default. single : :class:`SingleSelectionConfig` The default definition for a `single `__ selection. All - properties and transformations - for a single selection definition (except ``type`` ) may be specified here. + properties and transformations for a single selection definition (except ``type`` + ) may be specified here. For instance, setting ``single`` to ``{"on": "dblclick"}`` populates single selections on double-click by default. @@ -13788,26 +13307,24 @@ class IntervalSelection(SelectionDef): Attributes ---------- - type : enum('interval') + type : string Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types: - * ``"single"`` -- to select a single discrete data value on ``click``. - * ``"multi"`` -- to select multiple discrete data value; 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 : enum('scales') - Establishes a two-way binding between the interval selection and the scales - used within the same view. This allows a user to interactively pan and - zoom the view. + * ``"single"`` -- to select a single discrete data value on ``click``. - ``"multi"`` + -- to select multiple discrete data value; 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 : string + Establishes a two-way binding between the interval selection and the scales used + within the same view. This allows a user to interactively pan and zoom the view. **See also:** `bind `__ documentation. clear : anyOf(:class:`Stream`, string, boolean) - Clears the selection, emptying it of all values. Can be a - `Event Stream `__ or ``false`` to - disable. + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. **Default value:** ``dblclick``. @@ -13817,60 +13334,59 @@ class IntervalSelection(SelectionDef): By default, ``all`` data values are considered to lie within an empty selection. When set to ``none``, empty selections contain no data values. 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. + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. **See also:** `encodings `__ documentation. fields : List(:class:`FieldName`) - An array of field names whose values must match for a data tuple to - fall within the selection. + An array of field names whose values must match for a data tuple to fall within the + selection. **See also:** `fields `__ documentation. init : :class:`SelectionInitIntervalMapping` Initialize the selection with a mapping between `projected channels or field names - `__ and arrays of - initial values. + `__ and arrays of initial + values. **See also:** `init `__ 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. + 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 `__ 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 + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end `__. 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. + 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. **See also:** `resolve `__ 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. + 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. - **Default value:** ``true``, which corresponds to - ``[mousedown, window:mouseup] > window:mousemove!`` which corresponds to - clicks and dragging within an interval selection to reposition it. + **Default value:** ``true``, which corresponds to ``[mousedown, window:mouseup] > + window:mousemove!`` which corresponds to clicks and dragging within an interval + selection to reposition it. **See also:** `translate `__ 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. + 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. **Default value:** ``true``, which corresponds to ``wheel!``. @@ -13896,28 +13412,27 @@ class MultiSelection(SelectionDef): Attributes ---------- - type : enum('multi') + type : string Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types: - * ``"single"`` -- to select a single discrete data value on ``click``. - * ``"multi"`` -- to select multiple discrete data value; 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``. + * ``"single"`` -- to select a single discrete data value on ``click``. - ``"multi"`` + -- to select multiple discrete data value; 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 : :class:`LegendBinding` When set, a selection is populated by interacting with the corresponding legend. - Direct manipulation interaction is disabled by default; - to re-enable it, set the selection's `on + 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. clear : anyOf(:class:`Stream`, string, boolean) - Clears the selection, emptying it of all values. Can be a - `Event Stream `__ or ``false`` to - disable. + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. **Default value:** ``dblclick``. @@ -13927,21 +13442,21 @@ class MultiSelection(SelectionDef): By default, ``all`` data values are considered to lie within an empty selection. When set to ``none``, empty selections contain no data values. 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. + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. **See also:** `encodings `__ documentation. fields : List(:class:`FieldName`) - An array of field names whose values must match for a data tuple to - fall within the selection. + An array of field names whose values must match for a data tuple to fall within the + selection. **See also:** `fields `__ documentation. init : List(:class:`SelectionInitMapping`) Initialize the selection with a mapping between `projected channels or field names - `__ and an initial - value (or array of values). + `__ and an initial value (or + array of values). **See also:** `init `__ documentation. @@ -13953,23 +13468,26 @@ class MultiSelection(SelectionDef): 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 + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end `__. 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. + 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. **See also:** `resolve `__ documentation. toggle : anyOf(string, boolean) - Controls whether data values should be toggled or only ever inserted into - multi selections. Can be ``true``, ``false`` (for insertion only), or a - `Vega expression `__. + Controls whether data values should be toggled or only ever inserted into multi + selections. Can be ``true``, ``false`` (for insertion only), or a `Vega expression + `__. + + **Default value:** ``true``, which corresponds to ``event.shiftKey`` (i.e., data + values are toggled when a user interacts with the shift-key pressed). - **Default value:** ``true``, which corresponds to ``event.shiftKey`` (i.e., - data values are toggled when a user interacts with the shift-key pressed). + Setting the value to the Vega expression ``"true"`` will toggle data values without + the user pressing the shift-key. **See also:** `toggle `__ documentation. @@ -13999,7 +13517,7 @@ def __init__(self, *args, **kwds): class SelectionInit(VegaLiteSchema): """SelectionInit schema wrapper - anyOf(:class:`Value`, :class:`DateTime`) + anyOf(:class:`PrimitiveValue`, :class:`DateTime`) """ _schema = {'$ref': '#/definitions/SelectionInit'} @@ -14011,10 +13529,9 @@ 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. + 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 ---------- @@ -14022,10 +13539,9 @@ class DateTime(SelectionInit): 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"`` ). + 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``. @@ -14036,11 +13552,9 @@ class DateTime(SelectionInit): 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"`` ). + 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 @@ -14061,6 +13575,17 @@ def __init__(self, date=Undefined, day=Undefined, hours=Undefined, milliseconds= 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 @@ -14206,26 +13731,45 @@ def __init__(self, start=Undefined, stop=Undefined, step=Undefined, **kwds): class SequentialMultiHue(ColorScheme): """SequentialMultiHue schema wrapper - enum('viridis', 'inferno', 'magma', 'plasma', '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', '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', + 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') + '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'} @@ -14236,7 +13780,8 @@ def __init__(self, *args): class SequentialSingleHue(ColorScheme): """SequentialSingleHue schema wrapper - enum('blues', 'greens', 'greys', 'purples', 'reds', 'oranges') + enum('blues', 'tealblues', 'teals', 'greens', 'browns', 'greys', 'purples', 'warmgreys', + 'reds', 'oranges') """ _schema = {'$ref': '#/definitions/SequentialSingleHue'} @@ -14244,59 +13789,147 @@ def __init__(self, *args): super(SequentialSingleHue, self).__init__(*args) -class ShapeFieldDefWithCondition(VegaLiteSchema): - """ShapeFieldDefWithCondition schema wrapper +class ShapeDef(VegaLiteSchema): + """ShapeDef schema wrapper - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` + 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 ---------- - type : :class:`TypeForShape` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a selection 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. + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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, band=Undefined, condition=Undefined, datum=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefstringnull, self).__init__(band=band, + condition=condition, + datum=datum, 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"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. bin : anyOf(boolean, :class:`BinParams`, None) A flag for binning a ``quantitative`` field, `an object defining binning parameters `__, or indicating that the @@ -14318,7 +13951,8 @@ class ShapeFieldDefWithCondition(VegaLiteSchema): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionstringnull` + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -14327,24 +13961,22 @@ class ShapeFieldDefWithCondition(VegaLiteSchema): 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 + 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``. + **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. + 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. @@ -14370,30 +14002,25 @@ class ShapeFieldDefWithCondition(VegaLiteSchema): 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. + 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"`` @@ -14404,8 +14031,7 @@ class ShapeFieldDefWithCondition(VegaLiteSchema): 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -14432,46 +14058,209 @@ class ShapeFieldDefWithCondition(VegaLiteSchema): 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/ShapeFieldDefWithCondition'} + 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' + `__. - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(ShapeFieldDefWithCondition, self).__init__(type=type, aggregate=aggregate, bin=bin, - condition=condition, field=field, - legend=legend, scale=scale, sort=sort, - timeUnit=timeUnit, title=title, **kwds) + 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`` ). -class ShapeValueWithCondition(VegaLiteSchema): - """ShapeValueWithCondition schema wrapper + **See also:** `type `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition,(string|null)>'} + + def __init__(self, aggregate=Undefined, band=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, + band=band, + 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 ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDefTypeForShape`, - :class:`ValueConditionstringnull`) - A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + 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=[]) + + y : Mapping(required=[]) + + y2 : Mapping(required=[]) + + yError : Mapping(required=[]) + + yError2 : Mapping(required=[]) + """ - _schema = {'$ref': '#/definitions/ShapeValueWithCondition'} + _schema = {'$ref': '#/definitions/SharedEncoding'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ShapeValueWithCondition, self).__init__(condition=condition, value=value, **kwds) + 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, y=Undefined, y2=Undefined, yError=Undefined, + yError2=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, y=y, y2=y2, yError=yError, + yError2=yError2, **kwds) class SingleDefUnitChannel(VegaLiteSchema): """SingleDefUnitChannel schema wrapper - enum('x', 'y', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'color', - 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'strokeDash', - 'size', 'shape', 'key', 'text', 'href', 'url') + enum('x', 'y', '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'} @@ -14487,21 +14276,19 @@ class SingleSelection(SelectionDef): Attributes ---------- - type : enum('single') + type : string Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types: - * ``"single"`` -- to select a single discrete data value on ``click``. - * ``"multi"`` -- to select multiple discrete data value; 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``. + * ``"single"`` -- to select a single discrete data value on ``click``. - ``"multi"`` + -- to select multiple discrete data value; 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`) 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 + 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. @@ -14509,15 +14296,14 @@ class SingleSelection(SelectionDef): 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. + `__ or can be a mapping between + projected field/encodings and binding definitions. **See also:** `bind `__ documentation. clear : anyOf(:class:`Stream`, string, boolean) - Clears the selection, emptying it of all values. Can be a - `Event Stream `__ or ``false`` to - disable. + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. **Default value:** ``dblclick``. @@ -14527,14 +14313,14 @@ class SingleSelection(SelectionDef): By default, ``all`` data values are considered to lie within an empty selection. When set to ``none``, empty selections contain no data values. 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. + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. **See also:** `encodings `__ documentation. fields : List(:class:`FieldName`) - An array of field names whose values must match for a data tuple to - fall within the selection. + An array of field names whose values must match for a data tuple to fall within the + selection. **See also:** `fields `__ documentation. @@ -14552,13 +14338,13 @@ class SingleSelection(SelectionDef): 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 + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end `__. 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. + 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. **See also:** `resolve `__ documentation. @@ -14583,10 +14369,8 @@ class SingleSelectionConfig(VegaLiteSchema): bind : anyOf(:class:`Binding`, Mapping(required=[]), :class:`LegendBinding`) 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 + 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. @@ -14594,15 +14378,14 @@ class SingleSelectionConfig(VegaLiteSchema): 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. + `__ or can be a mapping between + projected field/encodings and binding definitions. **See also:** `bind `__ documentation. clear : anyOf(:class:`Stream`, string, boolean) - Clears the selection, emptying it of all values. Can be a - `Event Stream `__ or ``false`` to - disable. + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. **Default value:** ``dblclick``. @@ -14612,14 +14395,14 @@ class SingleSelectionConfig(VegaLiteSchema): By default, ``all`` data values are considered to lie within an empty selection. When set to ``none``, empty selections contain no data values. 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. + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. **See also:** `encodings `__ documentation. fields : List(:class:`FieldName`) - An array of field names whose values must match for a data tuple to - fall within the selection. + An array of field names whose values must match for a data tuple to fall within the + selection. **See also:** `fields `__ documentation. @@ -14637,13 +14420,13 @@ class SingleSelectionConfig(VegaLiteSchema): 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 + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end `__. 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. + 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. **See also:** `resolve `__ documentation. @@ -14698,10 +14481,10 @@ class EncodingSortField(Sort): 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 + 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. - 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 `__. @@ -14832,15 +14615,14 @@ class ConcatSpecGenericSpec(Spec): 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"``. + 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 + 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. @@ -14854,10 +14636,10 @@ class ConcatSpecGenericSpec(Spec): * 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. + 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`) @@ -14872,18 +14654,14 @@ class ConcatSpecGenericSpec(Spec): 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`` ). + 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) + 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`` ). @@ -14897,9 +14675,9 @@ class ConcatSpecGenericSpec(Spec): 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. + 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 `__ ( @@ -14931,23 +14709,22 @@ class FacetSpec(Spec): ---------- facet : anyOf(:class:`FacetFieldDefFieldName`, :class:`FacetMappingFieldName`) - 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 + 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"``. + 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 + 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. @@ -14961,10 +14738,10 @@ class FacetSpec(Spec): * 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. + 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`) @@ -14979,18 +14756,14 @@ class FacetSpec(Spec): 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`` ). + 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) + 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`` ). @@ -15004,9 +14777,9 @@ class FacetSpec(Spec): 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. + 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 `__ ( @@ -15040,21 +14813,45 @@ class FacetedUnitSpec(NormalizedSpec, Spec): 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 `__. + ``"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. + 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. @@ -15062,16 +14859,15 @@ class FacetedUnitSpec(NormalizedSpec, Spec): Description of this mark for commenting purpose. encoding : :class:`FacetedEncoding` A key-value mapping between encoding channels and definition of fields. - height : anyOf(float, enum('container'), :class:`Step`) + 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"``. + * 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. @@ -15086,12 +14882,20 @@ class FacetedUnitSpec(NormalizedSpec, Spec): Name of the visualization for later reference. 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. + ``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. selection : Mapping(required=[]) A key-value mapping between selection names and definitions. + 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`) @@ -15100,20 +14904,18 @@ class FacetedUnitSpec(NormalizedSpec, Spec): An object defining the view background's fill and stroke. **Default value:** none (transparent) - width : anyOf(float, enum('container'), :class:`Step`) + 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"``. + * 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. + **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 @@ -15124,15 +14926,17 @@ class FacetedUnitSpec(NormalizedSpec, Spec): """ _schema = {'$ref': '#/definitions/FacetedUnitSpec'} - def __init__(self, mark=Undefined, bounds=Undefined, data=Undefined, description=Undefined, - encoding=Undefined, height=Undefined, name=Undefined, projection=Undefined, - resolve=Undefined, selection=Undefined, title=Undefined, transform=Undefined, - view=Undefined, width=Undefined, **kwds): - super(FacetedUnitSpec, self).__init__(mark=mark, bounds=bounds, data=data, - description=description, encoding=encoding, height=height, - name=name, projection=projection, resolve=resolve, - selection=selection, title=title, transform=transform, - view=view, width=width, **kwds) + def __init__(self, mark=Undefined, align=Undefined, bounds=Undefined, center=Undefined, + data=Undefined, description=Undefined, encoding=Undefined, height=Undefined, + name=Undefined, projection=Undefined, resolve=Undefined, selection=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, projection=projection, + resolve=resolve, selection=selection, spacing=spacing, + title=title, transform=transform, view=view, width=width, + **kwds) class HConcatSpecGenericSpec(Spec): @@ -15152,10 +14956,10 @@ class HConcatSpecGenericSpec(Spec): * 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. + 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 @@ -15214,19 +15018,18 @@ class LayerSpec(NormalizedSpec, Spec): source. If no data is set, it is derived from the parent. description : string Description of this mark for commenting purpose. - encoding : :class:`Encoding` + encoding : :class:`SharedEncoding` A shared key-value mapping between encoding channels and definition of fields in the underlying layers. - height : anyOf(float, enum('container'), :class:`Step`) + 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"``. + * 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. @@ -15235,58 +15038,170 @@ class LayerSpec(NormalizedSpec, Spec): `__, this represents the height of a single view and the ``"container"`` option cannot be used. - **See also:** `height `__ - documentation. + **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(NormalizedSpec, Spec): + """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. - 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. + 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, enum('container'), :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'} + _schema = {'$ref': '#/definitions/LayerRepeatSpec'} - 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) + 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 RepeatSpec(NormalizedSpec, Spec): - """RepeatSpec schema wrapper +class NonLayerRepeatSpec(RepeatSpec): + """NonLayerRepeatSpec schema wrapper Mapping(required=[repeat, spec]) Base interface for a repeat specification. @@ -15295,25 +15210,24 @@ class RepeatSpec(NormalizedSpec, Spec): ---------- 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. + 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:`Spec` 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"``. + 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 + 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. @@ -15327,10 +15241,10 @@ class RepeatSpec(NormalizedSpec, Spec): * 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. + 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`) @@ -15345,18 +15259,14 @@ class RepeatSpec(NormalizedSpec, Spec): 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`` ). + 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) + 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`` ). @@ -15370,9 +15280,9 @@ class RepeatSpec(NormalizedSpec, Spec): 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. + 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 `__ ( @@ -15382,16 +15292,17 @@ class RepeatSpec(NormalizedSpec, Spec): transform : List(:class:`Transform`) An array of data transformations such as filter and new field calculation. """ - _schema = {'$ref': '#/definitions/RepeatSpec'} + _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(RepeatSpec, 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) + 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): @@ -15402,7 +15313,7 @@ class SphereGenerator(Generator): Attributes ---------- - sphere : anyOf(enum(True), Mapping(required=[])) + sphere : anyOf(boolean, Mapping(required=[])) Generate sphere GeoJSON data for the full globe. name : string Provide a placeholder name and bind data at runtime. @@ -15545,56 +15456,31 @@ def __init__(self, merge=Undefined, between=Undefined, consume=Undefined, deboun class StringFieldDef(VegaLiteSchema): """StringFieldDef schema wrapper - Mapping(required=[type]) + Mapping(required=[]) Attributes ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -15617,38 +15503,36 @@ class StringFieldDef(VegaLiteSchema): 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 + 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, Mapping(required=[])) + **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:`Dictunknown`) 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 + `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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. + 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 @@ -15656,15 +15540,13 @@ class StringFieldDef(VegaLiteSchema): `__ config for time format. formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** - + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. + **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``. labelExpr : string `Vega expression `__ for customizing labels text. @@ -15673,8 +15555,7 @@ class StringFieldDef(VegaLiteSchema): properties of the axis's backing ``datum`` object. 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -15701,71 +15582,104 @@ class StringFieldDef(VegaLiteSchema): 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, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, timeUnit=Undefined, - title=Undefined, **kwds): - super(StringFieldDef, self).__init__(type=type, aggregate=aggregate, bin=bin, field=field, + title=Undefined, type=Undefined, **kwds): + super(StringFieldDef, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, format=format, formatType=formatType, labelExpr=labelExpr, - timeUnit=timeUnit, title=title, **kwds) + timeUnit=timeUnit, title=title, type=type, **kwds) class StringFieldDefWithCondition(VegaLiteSchema): """StringFieldDefWithCondition schema wrapper - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. - - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). - - **See also:** `type `__ - documentation. aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -15786,7 +15700,8 @@ class StringFieldDefWithCondition(VegaLiteSchema): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionstring` + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -15795,38 +15710,36 @@ class StringFieldDefWithCondition(VegaLiteSchema): 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 + 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, Mapping(required=[])) + **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:`Dictunknown`) 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 + `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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. + 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 @@ -15834,15 +15747,13 @@ class StringFieldDefWithCondition(VegaLiteSchema): `__ config for time format. formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** - + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. + **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``. labelExpr : string `Vega expression `__ for customizing labels text. @@ -15851,8 +15762,7 @@ class StringFieldDefWithCondition(VegaLiteSchema): properties of the axis's backing ``datum`` object. 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -15879,61 +15789,119 @@ class StringFieldDefWithCondition(VegaLiteSchema): 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, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(StringFieldDefWithCondition, self).__init__(type=type, aggregate=aggregate, bin=bin, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(StringFieldDefWithCondition, self).__init__(aggregate=aggregate, band=band, bin=bin, condition=condition, field=field, format=format, formatType=formatType, labelExpr=labelExpr, timeUnit=timeUnit, - title=title, **kwds) + title=title, type=type, **kwds) -class StringValueWithCondition(VegaLiteSchema): - """StringValueWithCondition schema wrapper +class StringValueDefWithCondition(VegaLiteSchema): + """StringValueDefWithCondition schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionstringnull`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) + 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/StringValueWithCondition'} + _schema = {'$ref': '#/definitions/StringValueDefWithCondition'} def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(StringValueWithCondition, self).__init__(condition=condition, value=value, **kwds) + super(StringValueDefWithCondition, self).__init__(condition=condition, value=value, **kwds) -class StringValueWithConditionTypeForShape(VegaLiteSchema): - """StringValueWithConditionTypeForShape schema wrapper +class StrokeCap(VegaLiteSchema): + """StrokeCap schema wrapper - Mapping(required=[]) + enum('butt', 'round', 'square') + """ + _schema = {'$ref': '#/definitions/StrokeCap'} - Attributes - ---------- + def __init__(self, *args): + super(StrokeCap, self).__init__(*args) - condition : anyOf(:class:`ConditionalMarkPropFieldDefTypeForShape`, - :class:`ValueConditionstringnull`) - A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + +class StrokeJoin(VegaLiteSchema): + """StrokeJoin schema wrapper + + enum('miter', 'round', 'bevel') """ - _schema = {'$ref': '#/definitions/StringValueWithCondition'} + _schema = {'$ref': '#/definitions/StrokeJoin'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(StringValueWithConditionTypeForShape, self).__init__(condition=condition, value=value, - **kwds) + def __init__(self, *args): + super(StrokeJoin, self).__init__(*args) class StyleConfigIndex(VegaLiteSchema): @@ -15944,6 +15912,8 @@ class StyleConfigIndex(VegaLiteSchema): Attributes ---------- + arc : :class:`RectConfig` + Arc-specific Config area : :class:`AreaConfig` Area-Specific Config bar : :class:`BarConfig` @@ -15983,14 +15953,14 @@ class StyleConfigIndex(VegaLiteSchema): """ _schema = {'$ref': '#/definitions/StyleConfigIndex'} - def __init__(self, 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__(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) + 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): @@ -16018,7 +15988,7 @@ def __init__(self, *args, **kwds): class TextBaseline(VegaLiteSchema): """TextBaseline schema wrapper - anyOf(enum('alphabetic'), :class:`Baseline`, enum('line-top'), enum('line-bottom')) + anyOf(string, :class:`Baseline`, string, string) """ _schema = {'$ref': '#/definitions/TextBaseline'} @@ -16037,71 +16007,188 @@ def __init__(self, *args): super(Baseline, self).__init__(*args) -class TextDirection(VegaLiteSchema): - """TextDirection schema wrapper +class TextDef(VegaLiteSchema): + """TextDef schema wrapper - enum('ltr', 'rtl') + anyOf(:class:`FieldOrDatumDefWithConditionStringFieldDefText`, + :class:`FieldOrDatumDefWithConditionStringDatumDefText`, + :class:`ValueDefWithConditionStringFieldDefText`) """ - _schema = {'$ref': '#/definitions/TextDirection'} + _schema = {'$ref': '#/definitions/TextDef'} - def __init__(self, *args): - super(TextDirection, self).__init__(*args) + def __init__(self, *args, **kwds): + super(TextDef, self).__init__(*args, **kwds) -class TextFieldDefWithCondition(VegaLiteSchema): - """TextFieldDefWithCondition schema wrapper +class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): + """FieldOrDatumDefWithConditionStringDatumDefText schema wrapper - Mapping(required=[type]) - A FieldDef with Condition :raw-html:`` + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } Attributes ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) + One or more value definition(s) with `a selection 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:`Dictunknown`) + 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``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + 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' `__. - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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, band=Undefined, condition=Undefined, datum=Undefined, format=Undefined, + formatType=Undefined, labelExpr=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionStringDatumDefText, self).__init__(band=band, + condition=condition, + datum=datum, format=format, + formatType=formatType, + labelExpr=labelExpr, + 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"`` ). + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). **Default value:** ``undefined`` (None) **See also:** `aggregate `__ documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 ( @@ -16122,7 +16209,8 @@ class TextFieldDefWithCondition(VegaLiteSchema): **See also:** `bin `__ documentation. - condition : :class:`ValueConditionText` + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -16131,38 +16219,36 @@ class TextFieldDefWithCondition(VegaLiteSchema): 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 + 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, Mapping(required=[])) + **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:`Dictunknown`) 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 + `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" - `__ that takes - ``datum.value`` and format parameter as input), this property represents the format - parameter. + 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 @@ -16170,15 +16256,13 @@ class TextFieldDefWithCondition(VegaLiteSchema): `__ config for time format. formatType : string - The format type for labels ( ``"number"`` or ``"time"`` or a `registered custom - format type `__ ). - - **Default value:** + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. - - * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. - * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without - ``timeUnit``. + **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``. labelExpr : string `Vega expression `__ for customizing labels text. @@ -16187,8 +16271,7 @@ class TextFieldDefWithCondition(VegaLiteSchema): properties of the axis's backing ``datum`` object. 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 + field. or `a temporal field that gets casted as ordinal `__. **Default value:** ``undefined`` (None) @@ -16215,37 +16298,89 @@ class TextFieldDefWithCondition(VegaLiteSchema): 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/TextFieldDefWithCondition'} + 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' + `__. - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, - field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(TextFieldDefWithCondition, self).__init__(type=type, aggregate=aggregate, bin=bin, - condition=condition, field=field, format=format, - formatType=formatType, labelExpr=labelExpr, - timeUnit=timeUnit, title=title, **kwds) + 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:** -class TextValueWithCondition(VegaLiteSchema): - """TextValueWithCondition schema wrapper + 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`` ). - Mapping(required=[]) + **See also:** `type `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} - Attributes - ---------- + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionStringFieldDefText, self).__init__(aggregate=aggregate, + band=band, bin=bin, + condition=condition, + field=field, format=format, + formatType=formatType, + labelExpr=labelExpr, + timeUnit=timeUnit, + title=title, type=type, + **kwds) - condition : anyOf(:class:`ConditionalStringFieldDef`, :class:`ValueConditionText`) - A field definition or one or more value definition(s) with a selection predicate. - value : :class:`Text` - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + +class TextDirection(VegaLiteSchema): + """TextDirection schema wrapper + + enum('ltr', 'rtl') """ - _schema = {'$ref': '#/definitions/TextValueWithCondition'} + _schema = {'$ref': '#/definitions/TextDirection'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(TextValueWithCondition, self).__init__(condition=condition, value=value, **kwds) + def __init__(self, *args): + super(TextDirection, self).__init__(*args) class TickConfig(AnyMarkConfig): @@ -16256,89 +16391,80 @@ class TickConfig(AnyMarkConfig): Attributes ---------- - align : :class:`Align` + 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"``. - angle : float - The rotation angle of the text, in degrees. - aspect : boolean - Whether to keep aspect ratio of image marks. + + **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 : :class:`TextBaseline` - The vertical text baseline. 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. - blend : :class:`Blend` - The color blend mode for drawing an item on its current background. Any valid `CSS - mix-blend-mode `__ - value can be used. - - __Default value: ``"source-over"`` - color : anyOf(:class:`Color`, :class:`Gradient`) + 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:** + **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`) - * This property cannot be used in a `style config - `__. - * The ``fill`` and ``stroke`` properties have higher precedence than ``color`` and - will override ``color``. - cornerRadius : float - The radius in pixels of rounded rectangle corners. + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomLeft : float - The radius in pixels of rounded rectangle bottom left corner. + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusBottomRight : float - The radius in pixels of rounded rectangle bottom right corner. + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopLeft : float - The radius in pixels of rounded rectangle top right corner. + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) - **Default value:** ``0`` - cornerRadiusTopRight : float - The radius in pixels of rounded rectangle top left corner. + description : anyOf(string, :class:`ExprRef`) - **Default value:** ``0`` - cursor : :class:`Cursor` - The mouse cursor used over the mark. Any valid `CSS cursor type - `__ can be used. - dir : :class:`TextDirection` - 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. - - **Default value:** ``"ltr"`` - dx : float - The horizontal offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - dy : float - The vertical offset, in pixels, between the text label and its anchor point. The - offset is applied after rotation by the *angle* property. - ellipsis : string - The ellipsis string for text truncated in response to the limit parameter. - - **Default value:** ``"…"`` - fill : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Fill Color. This property has higher precedence than ``config.color``. + 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 : float - The fill opacity (value between [0,1]). + fillOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` filled : boolean Whether the mark's color should be used as fill color instead of stroke color. @@ -16349,66 +16475,36 @@ class TickConfig(AnyMarkConfig): **Note:** This property cannot be used in a `style config `__. - font : string - The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). - fontSize : float - The font size, in pixels. - - **Default value:** ``11`` - fontStyle : :class:`FontStyle` - The font style (e.g., ``"italic"`` ). - fontWeight : :class:`FontWeight` - 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`` - ). - height : float - Height of the marks. - href : string - A URL to load upon mouse click. If defined, the mark acts as a hyperlink. - interpolate : :class:`Interpolate` - The line interpolation method to use for line and area marks. One of the following: - - - * ``"linear"`` : piecewise linear segments, as in a polyline. - * ``"linear-closed"`` : close the linear segments to form a polygon. - * ``"step"`` : alternate between horizontal and vertical segments, as in a step - function. - * ``"step-before"`` : alternate between vertical and horizontal segments, as in a - step function. - * ``"step-after"`` : alternate between horizontal and vertical segments, as in a - step function. - * ``"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. + 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``. + 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`) - * 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 : float - The maximum length of the text mark in pixels. The text value will be automatically - truncated if the rendered size exceeds the limit. + lineHeight : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` -- indicating no limit - lineBreak : string - 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. - lineHeight : float - The line height in pixels (the spacing between subsequent lines of text) for - multi-line text marks. - opacity : float + opacity : anyOf(float, :class:`ExprRef`) The overall opacity (value between [0,1]). **Default value:** ``0.7`` for non-aggregate plots with ``point``, ``tick``, @@ -16417,140 +16513,123 @@ class TickConfig(AnyMarkConfig): 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. - radius : float - Polar coordinate radial offset, in pixels, of the text label from the origin - determined by the ``x`` and ``y`` properties. - shape : anyOf(:class:`SymbolShape`, string) - Shape of the point marks. 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.) - - **Default value:** ``"circle"`` - size : float - Default size for marks. + 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``. + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + 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`) - * 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. + strokeDash : anyOf(List(float), :class:`ExprRef`) - **Default value:** + strokeDashOffset : anyOf(float, :class:`ExprRef`) + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) - * ``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. - stroke : anyOf(:class:`Color`, :class:`Gradient`, None) - Default Stroke Color. This property has higher precedence than ``config.color``. + strokeMiterLimit : anyOf(float, :class:`ExprRef`) - **Default value:** (None) - strokeCap : string - The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or - ``"square"``. + strokeOffset : anyOf(float, :class:`ExprRef`) - **Default value:** ``"butt"`` - strokeDash : List(float) - An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : float - The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : string - The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. - - **Default value:** ``"miter"`` - strokeMiterLimit : float - The miter limit at which to bevel a line join. - strokeOffset : float - 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. - strokeOpacity : float - The stroke opacity (value between [0,1]). + strokeOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` - strokeWidth : float - The stroke width, in pixels. - tension : float - Depending on the interpolation type, sets the tension parameter (for line and area - marks). - text : :class:`Text` - Placeholder text if the ``text`` channel is not specified - theta : float - Polar coordinate angle, in radians, of the text label from the origin determined by - the ``x`` and ``y`` properties. Values for ``theta`` follow the same convention of - ``arc`` mark ``startAngle`` and ``endAngle`` properties: angles are measured in - radians, with ``0`` indicating "north". + 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`` timeUnitBand : 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. + 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. 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. - tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, None) + 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. + 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. + ``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`` - width : float - Width of the marks. - x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('height')) + 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 @@ -16558,50 +16637,57 @@ class TickConfig(AnyMarkConfig): """ _schema = {'$ref': '#/definitions/TickConfig'} - def __init__(self, align=Undefined, angle=Undefined, aspect=Undefined, bandSize=Undefined, + 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, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, lineBreak=Undefined, - lineHeight=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, - radius=Undefined, shape=Undefined, size=Undefined, stroke=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, thickness=Undefined, timeUnitBand=Undefined, - timeUnitBandPosition=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, - x2=Undefined, y=Undefined, y2=Undefined, **kwds): - super(TickConfig, self).__init__(align=align, angle=angle, aspect=aspect, bandSize=bandSize, - baseline=baseline, blend=blend, color=color, + theta=Undefined, theta2=Undefined, thickness=Undefined, timeUnitBand=Undefined, + timeUnitBandPosition=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, - dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, + 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, interpolate=interpolate, - invalid=invalid, limit=limit, lineBreak=lineBreak, - lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, radius=radius, shape=shape, size=size, - stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + 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, thickness=thickness, - timeUnitBand=timeUnitBand, + tension=tension, text=text, theta=theta, theta2=theta2, + thickness=thickness, timeUnitBand=timeUnitBand, timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, - width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) class TickCount(VegaLiteSchema): """TickCount schema wrapper - anyOf(float, :class:`TimeInterval`) + anyOf(float, :class:`TimeInterval`, :class:`TimeIntervalStep`) """ _schema = {'$ref': '#/definitions/TickCount'} @@ -16620,7 +16706,7 @@ def __init__(self, *args): super(TimeInterval, self).__init__(*args) -class TimeIntervalStep(VegaLiteSchema): +class TimeIntervalStep(TickCount): """TimeIntervalStep schema wrapper Mapping(required=[interval, step]) @@ -16665,9 +16751,12 @@ class LocalMultiTimeUnit(MultiTimeUnit): """LocalMultiTimeUnit schema wrapper enum('yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', - 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'quartermonth', - 'monthdate', 'monthdatehours', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', - 'secondsmilliseconds') + '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'} @@ -16689,960 +16778,329 @@ def __init__(self, *args, **kwds): class LocalSingleTimeUnit(SingleTimeUnit): """LocalSingleTimeUnit schema wrapper - enum('year', 'quarter', 'month', 'day', '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 : :class:`TitleAnchor` - 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. - angle : float - Angle in degrees of title and subtitle text. - baseline : :class:`TextBaseline` - Vertical text baseline for title and subtitle text. One of ``"top"``, ``"middle"``, - ``"bottom"``, or ``"alphabetic"``. - color : anyOf(None, :class:`Color`) - Text color for title text. - dx : float - Delta offset for title and subtitle text x-coordinate. - dy : float - Delta offset for title and subtitle text y-coordinate. - font : string - Font name for title text. - fontSize : float - Font size in pixels for title text. - fontStyle : :class:`FontStyle` - Font style for title text. - fontWeight : :class:`FontWeight` - 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`` - ). - frame : anyOf(:class:`TitleFrame`, string) - 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). - limit : float - The maximum allowed length in pixels of title and subtitle text. - lineHeight : float - Line height in pixels for multi-line title text. - offset : float - The orthogonal offset in pixels by which to displace the title group from its - position along the edge of the chart. - orient : :class:`TitleOrient` - Default title orientation ( ``"top"``, ``"bottom"``, ``"left"``, or ``"right"`` ) - subtitleColor : anyOf(None, :class:`Color`) - Text color for subtitle text. - subtitleFont : string - Font name for subtitle text. - subtitleFontSize : float - Font size in pixels for subtitle text. - subtitleFontStyle : :class:`FontStyle` - Font style for subtitle text. - subtitleFontWeight : :class:`FontWeight` - 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`` - ). - subtitleLineHeight : float - Line height in pixels for multi-line subtitle text. - subtitlePadding : float - The padding in pixels between title and subtitle text. - """ - _schema = {'$ref': '#/definitions/TitleConfig'} - - def __init__(self, align=Undefined, anchor=Undefined, angle=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, - **kwds): - super(TitleConfig, self).__init__(align=align, anchor=anchor, angle=angle, 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, **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 : :class:`Text` - 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 : float - Angle in degrees of title and subtitle text. - baseline : :class:`TextBaseline` - Vertical text baseline for title and subtitle text. One of ``"top"``, ``"middle"``, - ``"bottom"``, or ``"alphabetic"``. - color : anyOf(None, :class:`Color`) - Text color for title text. - dx : float - Delta offset for title and subtitle text x-coordinate. - dy : float - Delta offset for title and subtitle text y-coordinate. - font : string - Font name for title text. - fontSize : float - Font size in pixels for title text. - fontStyle : :class:`FontStyle` - Font style for title text. - fontWeight : :class:`FontWeight` - 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`` - ). - frame : anyOf(:class:`TitleFrame`, string) - 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). - limit : float - The maximum allowed length in pixels of title and subtitle text. - lineHeight : float - Line height in pixels for multi-line title text. - offset : float - The orthogonal offset in pixels by which to displace the title group from its - position along the edge of the chart. - orient : :class:`TitleOrient` - Default title orientation ( ``"top"``, ``"bottom"``, ``"left"``, or ``"right"`` ) - 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(None, :class:`Color`) - Text color for subtitle text. - subtitleFont : string - Font name for subtitle text. - subtitleFontSize : float - Font size in pixels for subtitle text. - subtitleFontStyle : :class:`FontStyle` - Font style for subtitle text. - subtitleFontWeight : :class:`FontWeight` - 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`` - ). - subtitleLineHeight : float - Line height in pixels for multi-line subtitle text. - subtitlePadding : float - The padding in pixels between title and subtitle text. - 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, - 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, - 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 TopLevelSpec(VegaLiteSchema): - """TopLevelSpec schema wrapper - - anyOf(:class:`TopLevelUnitSpec`, :class:`TopLevelFacetSpec`, :class:`TopLevelLayerSpec`, - :class:`TopLevelRepeatSpec`, :class:`TopLevelNormalizedConcatSpecGenericSpec`, - :class:`TopLevelNormalizedVConcatSpecGenericSpec`, - :class:`TopLevelNormalizedHConcatSpecGenericSpec`) - 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 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 : :class:`Color` - 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. + enum('year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', + 'seconds', 'milliseconds') + """ + _schema = {'$ref': '#/definitions/LocalSingleTimeUnit'} - An object value of the form ``{"row": boolean, "column": boolean}`` can be used to - supply different centering values for rows and columns. + def __init__(self, *args): + super(LocalSingleTimeUnit, self).__init__(*args) - **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`` ). +class TimeUnitParams(VegaLiteSchema): + """TimeUnitParams schema wrapper - **Note** : + Mapping(required=[]) - 1) This property is only for: + 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'} - * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) - * the ``facet`` and ``repeat`` operator with one field/repetition definition - (without row/column nesting) + 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) - 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 : :class:`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`` - 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. +class TitleAnchor(VegaLiteSchema): + """TitleAnchor schema wrapper - **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 : Mapping(required=[]) - 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/v4.json``. Setting the ``$schema`` - property allows automatic validation and autocomplete in editors that support JSON - schema. + enum(None, 'start', 'middle', 'end') """ - _schema = {'$ref': '#/definitions/TopLevelFacetSpec'} + _schema = {'$ref': '#/definitions/TitleAnchor'} - 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, 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, resolve=resolve, spacing=spacing, - title=title, transform=transform, usermeta=usermeta, - **kwds) + def __init__(self, *args): + super(TitleAnchor, self).__init__(*args) -class TopLevelLayerSpec(TopLevelSpec): - """TopLevelLayerSpec schema wrapper +class TitleConfig(VegaLiteSchema): + """TitleConfig schema wrapper - Mapping(required=[layer]) + Mapping(required=[]) Attributes ---------- - layer : List(anyOf(:class:`LayerSpec`, :class:`UnitSpec`)) - Layer or single view specifications to be layered. + align : :class:`Align` + Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or + ``"right"``. + anchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) - **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. + angle : anyOf(float, :class:`ExprRef`) - **Default value** : ``pad`` - background : :class:`Color` - CSS color property to use as the background of the entire view. + aria : anyOf(boolean, :class:`ExprRef`) - **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:`Encoding` - A shared key-value mapping between encoding channels and definition of fields in the - underlying layers. - height : anyOf(float, enum('container'), :class:`Step`) - The height of a visualization. + 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`) - * 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"``. + dy : anyOf(float, :class:`ExprRef`) - **Default value:** Based on ``config.view.continuousHeight`` for a plot with a - continuous y-field and ``config.view.discreteHeight`` otherwise. + font : anyOf(string, :class:`ExprRef`) - **Note:** For plots with `row and column channels - `__, this represents the - height of a single view and the ``"container"`` option cannot be used. + fontSize : anyOf(float, :class:`ExprRef`) - **See also:** `height `__ - documentation. - name : string - Name of the visualization for later reference. - padding : :class:`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. + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) - **Default value** : ``5`` - 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 : Mapping(required=[]) - 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. + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) - **Default value:** none (transparent) - width : anyOf(float, enum('container'), :class:`Step`) - The width of a visualization. + frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) + limit : anyOf(float, :class:`ExprRef`) - * 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"``. + lineHeight : anyOf(float, :class:`ExprRef`) - **Default value:** - Based on ``config.view.continuousWidth`` for a plot with a continuous x-field and - ``config.view.discreteWidth`` otherwise. + offset : anyOf(float, :class:`ExprRef`) - **Note:** For plots with `row and column channels - `__, this represents the - width of a single view and the ``"container"`` option cannot be used. + orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) - **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/v4.json``. Setting the ``$schema`` - property allows automatic validation and autocomplete in editors that support JSON - schema. - """ - _schema = {'$ref': '#/definitions/TopLevelLayerSpec'} + subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) - 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, 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, - projection=projection, resolve=resolve, title=title, - transform=transform, usermeta=usermeta, view=view, - width=width, **kwds) + subtitleFont : anyOf(string, :class:`ExprRef`) + subtitleFontSize : anyOf(float, :class:`ExprRef`) -class TopLevelNormalizedConcatSpecGenericSpec(TopLevelSpec): - """TopLevelNormalizedConcatSpecGenericSpec schema wrapper + subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) - Mapping(required=[concat]) + subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) - Attributes - ---------- + subtitleLineHeight : anyOf(float, :class:`ExprRef`) - concat : List(:class:`NormalizedSpec`) - 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"``. + subtitlePadding : anyOf(float, :class:`ExprRef`) + zindex : anyOf(float, :class:`ExprRef`) - * 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. + """ + _schema = {'$ref': '#/definitions/TitleConfig'} - Alternatively, an object value of the form ``{"row": string, "column": string}`` can - be used to supply different alignments for rows and columns. + 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) - **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 : :class:`Color` - CSS color property to use as the background of the entire view. +class TitleFrame(VegaLiteSchema): + """TitleFrame schema wrapper - **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``. + enum('bounds', 'group') + """ + _schema = {'$ref': '#/definitions/TitleFrame'} + def __init__(self, *args): + super(TitleFrame, self).__init__(*args) - * 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. +class TitleOrient(VegaLiteSchema): + """TitleOrient schema wrapper - An object value of the form ``{"row": boolean, "column": boolean}`` can be used to - supply different centering values for rows and columns. + enum('none', 'left', 'right', 'top', 'bottom') + """ + _schema = {'$ref': '#/definitions/TitleOrient'} - **Default value:** ``false`` - columns : float - The number of columns to include in the view composition layout. + def __init__(self, *args): + super(TitleOrient, self).__init__(*args) - **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** : +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. - 1) This property is only for: + **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`) - * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) - * the ``facet`` and ``repeat`` operator with one field/repetition definition - (without row/column nesting) + aria : anyOf(boolean, :class:`ExprRef`) - 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 : :class:`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. + 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`) - **Default value** : ``5`` - 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. + dy : anyOf(float, :class:`ExprRef`) - **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 : Mapping(required=[]) - 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/v4.json``. Setting the ``$schema`` - property allows automatic validation and autocomplete in editors that support JSON - schema. - """ - _schema = {'$ref': '#/definitions/TopLevelNormalizedConcatSpec'} + font : anyOf(string, :class:`ExprRef`) - 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, resolve=Undefined, spacing=Undefined, title=Undefined, - transform=Undefined, usermeta=Undefined, **kwds): - super(TopLevelNormalizedConcatSpecGenericSpec, 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, - resolve=resolve, spacing=spacing, - title=title, transform=transform, - usermeta=usermeta, **kwds) + fontSize : anyOf(float, :class:`ExprRef`) + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) -class TopLevelNormalizedHConcatSpecGenericSpec(TopLevelSpec): - """TopLevelNormalizedHConcatSpecGenericSpec schema wrapper + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) - Mapping(required=[hconcat]) + frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) - Attributes - ---------- + limit : anyOf(float, :class:`ExprRef`) - hconcat : List(:class:`NormalizedSpec`) - 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. + lineHeight : anyOf(float, :class:`ExprRef`) - **Default value** : ``pad`` - background : :class:`Color` - CSS color property to use as the background of the entire view. + offset : anyOf(float, :class:`ExprRef`) - **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``. + orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) + style : anyOf(string, List(string)) + A `mark style property `__ + to apply to the title text mark. - * 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:** ``"group-title"``. + subtitle : :class:`Text` + The subtitle Text. + subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) - **Default value:** ``"full"`` - center : boolean - Boolean flag indicating if subviews should be centered relative to their respective - rows or columns. + subtitleFont : anyOf(string, :class:`ExprRef`) - **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 : :class:`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. + subtitleFontSize : anyOf(float, :class:`ExprRef`) - **Default value** : ``5`` - 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. + subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) - **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 : Mapping(required=[]) - 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/v4.json``. Setting the ``$schema`` - property allows automatic validation and autocomplete in editors that support JSON - schema. - """ - _schema = {'$ref': '#/definitions/TopLevelNormalizedHConcatSpec'} + subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) - 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, resolve=Undefined, - spacing=Undefined, title=Undefined, transform=Undefined, usermeta=Undefined, **kwds): - super(TopLevelNormalizedHConcatSpecGenericSpec, self).__init__(hconcat=hconcat, - autosize=autosize, - background=background, - bounds=bounds, center=center, - config=config, data=data, - datasets=datasets, - description=description, - name=name, padding=padding, - resolve=resolve, spacing=spacing, - title=title, transform=transform, - usermeta=usermeta, **kwds) + subtitleLineHeight : anyOf(float, :class:`ExprRef`) + subtitlePadding : anyOf(float, :class:`ExprRef`) -class TopLevelNormalizedVConcatSpecGenericSpec(TopLevelSpec): - """TopLevelNormalizedVConcatSpecGenericSpec schema wrapper + zindex : float + The integer z-index indicating the layering of the title group relative to other + axis, mark and legend groups. - Mapping(required=[vconcat]) + **Default value:** ``0``. + """ + _schema = {'$ref': '#/definitions/TitleParams'} - Attributes - ---------- + 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) - vconcat : List(:class:`NormalizedSpec`) - 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 : :class:`Color` - CSS color property to use as the background of the entire view. +class TooltipContent(VegaLiteSchema): + """TooltipContent schema wrapper - **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``. + Mapping(required=[content]) + Attributes + ---------- - * 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. + content : enum('encoding', 'data') - **Default value:** ``"full"`` - center : boolean - Boolean flag indicating if subviews should be centered relative to their respective - rows or columns. + """ + _schema = {'$ref': '#/definitions/TooltipContent'} - **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 : :class:`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. + def __init__(self, content=Undefined, **kwds): + super(TooltipContent, self).__init__(content=content, **kwds) - **Default value** : ``5`` - 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 : Mapping(required=[]) - 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/v4.json``. Setting the ``$schema`` - property allows automatic validation and autocomplete in editors that support JSON - schema. +class TopLevelSpec(VegaLiteSchema): + """TopLevelSpec schema wrapper + + anyOf(:class:`TopLevelUnitSpec`, :class:`TopLevelFacetSpec`, :class:`TopLevelLayerSpec`, + :class:`TopLevelRepeatSpec`, :class:`TopLevelNormalizedConcatSpecGenericSpec`, + :class:`TopLevelNormalizedVConcatSpecGenericSpec`, + :class:`TopLevelNormalizedHConcatSpecGenericSpec`) + 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/TopLevelNormalizedVConcatSpec'} + _schema = {'$ref': '#/definitions/TopLevelSpec'} - 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, resolve=Undefined, - spacing=Undefined, title=Undefined, transform=Undefined, usermeta=Undefined, **kwds): - super(TopLevelNormalizedVConcatSpecGenericSpec, self).__init__(vconcat=vconcat, - autosize=autosize, - background=background, - bounds=bounds, center=center, - config=config, data=data, - datasets=datasets, - description=description, - name=name, padding=padding, - resolve=resolve, spacing=spacing, - title=title, transform=transform, - usermeta=usermeta, **kwds) + def __init__(self, *args, **kwds): + super(TopLevelSpec, self).__init__(*args, **kwds) -class TopLevelRepeatSpec(TopLevelSpec): - """TopLevelRepeatSpec schema wrapper +class TopLevelFacetSpec(TopLevelSpec): + """TopLevelFacetSpec schema wrapper - Mapping(required=[repeat, spec]) + Mapping(required=[data, facet, spec]) 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:`Spec` - A specification of the view that gets repeated. + 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"``. + 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 + 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. @@ -17652,12 +17110,11 @@ class TopLevelRepeatSpec(TopLevelSpec): **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. + ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify + parameters for content sizing and automatic resizing. **Default value** : ``pad`` - background : :class:`Color` + background : anyOf(:class:`Color`, :class:`ExprRef`) CSS color property to use as the background of the entire view. **Default value:** ``"white"`` @@ -17667,10 +17124,10 @@ class TopLevelRepeatSpec(TopLevelSpec): * 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. + 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`) @@ -17685,49 +17142,43 @@ class TopLevelRepeatSpec(TopLevelSpec): 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`` ). + 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) + 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. + 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 : :class:`Padding` + 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, + 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(:class:`Parameter`) + Dynamic variables 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. + 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 `__ ( @@ -17736,10 +17187,9 @@ class TopLevelRepeatSpec(TopLevelSpec): Title for the plot. transform : List(:class:`Transform`) An array of data transformations such as filter and new field calculation. - usermeta : Mapping(required=[]) - 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. + usermeta : :class:`Dictunknown` + 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 @@ -17747,83 +17197,71 @@ class TopLevelRepeatSpec(TopLevelSpec): property allows automatic validation and autocomplete in editors that support JSON schema. """ - _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} + _schema = {'$ref': '#/definitions/TopLevelFacetSpec'} - 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, resolve=Undefined, spacing=Undefined, - title=Undefined, transform=Undefined, usermeta=Undefined, **kwds): - super(TopLevelRepeatSpec, 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, - resolve=resolve, spacing=spacing, title=title, - transform=transform, usermeta=usermeta, **kwds) + 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 TopLevelUnitSpec(TopLevelSpec): - """TopLevelUnitSpec schema wrapper +class TopLevelLayerSpec(TopLevelSpec): + """TopLevelLayerSpec schema wrapper - Mapping(required=[data, mark]) + Mapping(required=[layer]) 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 `__. + 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. + ``"pad"``, ``"fit"`` or ``"none"``. Object values can additionally specify + parameters for content sizing and automatic resizing. **Default value** : ``pad`` - background : :class:`Color` + 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"`` 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. + 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, enum('container'), :class:`Step`) + 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"``. + * 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. @@ -17836,47 +17274,43 @@ class TopLevelUnitSpec(TopLevelSpec): documentation. name : string Name of the visualization for later reference. - padding : :class:`Padding` + 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, + 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(:class:`Parameter`) + Dynamic variables that parameterize a visualization. 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. + An object defining properties of the geographic projection shared by underlying + layers. resolve : :class:`Resolve` Scale, axis, and legend resolutions for view composition specifications. - selection : Mapping(required=[]) - A key-value mapping between selection names and definitions. 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 : Mapping(required=[]) - 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. + usermeta : :class:`Dictunknown` + 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, enum('container'), :class:`Step`) + 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"``. + * 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. + **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 @@ -17891,1474 +17325,1696 @@ class TopLevelUnitSpec(TopLevelSpec): property allows automatic validation and autocomplete in editors that support JSON schema. """ - _schema = {'$ref': '#/definitions/TopLevelUnitSpec'} - - def __init__(self, data=Undefined, mark=Undefined, autosize=Undefined, background=Undefined, - bounds=Undefined, config=Undefined, datasets=Undefined, description=Undefined, - encoding=Undefined, height=Undefined, name=Undefined, padding=Undefined, - projection=Undefined, resolve=Undefined, selection=Undefined, title=Undefined, - transform=Undefined, usermeta=Undefined, view=Undefined, width=Undefined, **kwds): - super(TopLevelUnitSpec, self).__init__(data=data, mark=mark, autosize=autosize, - background=background, bounds=bounds, config=config, - datasets=datasets, description=description, - encoding=encoding, height=height, name=name, - padding=padding, projection=projection, resolve=resolve, - selection=selection, title=title, transform=transform, - usermeta=usermeta, view=view, width=width, **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 : enum('topojson') - 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'} + _schema = {'$ref': '#/definitions/TopLevelLayerSpec'} - def __init__(self, aggregate=Undefined, groupby=Undefined, **kwds): - super(AggregateTransform, self).__init__(aggregate=aggregate, groupby=groupby, **kwds) + 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 BinTransform(Transform): - """BinTransform schema wrapper +class TopLevelNormalizedConcatSpecGenericSpec(TopLevelSpec): + """TopLevelNormalizedConcatSpecGenericSpec schema wrapper - Mapping(required=[bin, field, as]) + Mapping(required=[concat]) Attributes ---------- - bin : anyOf(enum(True), :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'} + concat : List(:class:`NormalizedSpec`) + 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"``. - def __init__(self, bin=Undefined, field=Undefined, **kwds): - super(BinTransform, self).__init__(bin=bin, field=field, **kwds) + * 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. -class CalculateTransform(Transform): - """CalculateTransform schema wrapper + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. - Mapping(required=[calculate, as]) + **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. - Attributes - ---------- + **Default value** : ``pad`` + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. - 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'} + **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``. - def __init__(self, calculate=Undefined, **kwds): - super(CalculateTransform, self).__init__(calculate=calculate, **kwds) + * 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. -class DensityTransform(Transform): - """DensityTransform schema wrapper + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. - Mapping(required=[density]) + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. - Attributes - ---------- + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. - 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** : ``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`` ). - **Default value:** ``false`` - cumulative : boolean - A boolean flag indicating whether to produce density estimates (false) or cumulative - density estimates (true). + **Note** : - **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(: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. + 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) - **Default value:** ``200`` - minsteps : float - The minimum number of samples to take along the extent domain for plotting the - density. + 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:** ``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`, :class:`FieldName`]) - The output fields for the sample value and corresponding density estimate. + **Default value** : ``5`` + params : List(:class:`Parameter`) + Dynamic variables 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:** ``["value", "density"]`` + **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:`Dictunknown` + 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/v4.json``. Setting the ``$schema`` + property allows automatic validation and autocomplete in editors that support JSON + schema. """ - _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) + _schema = {'$ref': '#/definitions/TopLevelNormalizedConcatSpec'} + 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(TopLevelNormalizedConcatSpecGenericSpec, 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 FilterTransform(Transform): - """FilterTransform schema wrapper - Mapping(required=[filter]) +class TopLevelNormalizedHConcatSpecGenericSpec(TopLevelSpec): + """TopLevelNormalizedHConcatSpecGenericSpec schema wrapper + + Mapping(required=[hconcat]) Attributes ---------- - filter : :class:`PredicateComposition` - The ``filter`` property must be a predication definition, which can takes one of the - following forms: + hconcat : List(:class:`NormalizedSpec`) + 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. - 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. + **Default value** : ``pad`` + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. - 2) one of the `field predicates - `__ : `equal - `__, - `lt `__, - `lte `__, - `gt `__, - `gte `__, - `range `__, - `oneOf `__, - or `valid `__, + **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``. - 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). + * 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(:class:`Parameter`) + Dynamic variables 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:`Dictunknown` + 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/v4.json``. Setting the ``$schema`` + property allows automatic validation and autocomplete in editors that support JSON + schema. """ - _schema = {'$ref': '#/definitions/FilterTransform'} + _schema = {'$ref': '#/definitions/TopLevelNormalizedHConcatSpec'} - def __init__(self, filter=Undefined, **kwds): - super(FilterTransform, self).__init__(filter=filter, **kwds) + 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(TopLevelNormalizedHConcatSpecGenericSpec, 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 FlattenTransform(Transform): - """FlattenTransform schema wrapper +class TopLevelNormalizedVConcatSpecGenericSpec(TopLevelSpec): + """TopLevelNormalizedVConcatSpecGenericSpec schema wrapper - Mapping(required=[flatten]) + Mapping(required=[vconcat]) 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. + vconcat : List(:class:`NormalizedSpec`) + 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:** The field name of the corresponding array field - """ - _schema = {'$ref': '#/definitions/FlattenTransform'} + **Default value** : ``pad`` + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. - def __init__(self, flatten=Undefined, **kwds): - super(FlattenTransform, self).__init__(flatten=flatten, **kwds) + **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``. -class FoldTransform(Transform): - """FoldTransform schema wrapper + * 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. - Mapping(required=[fold]) + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. - Attributes - ---------- + **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. - fold : List(:class:`FieldName`) - An array of data fields indicating the properties to fold. - as : List([:class:`FieldName`, :class:`FieldName`]) - The output field names for the key and value properties produced by the fold - transform. - **Default value:** ``["key", "value"]`` + **Default value** : ``5`` + params : List(:class:`Parameter`) + Dynamic variables 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:`Dictunknown` + 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/v4.json``. Setting the ``$schema`` + property allows automatic validation and autocomplete in editors that support JSON + schema. """ - _schema = {'$ref': '#/definitions/FoldTransform'} + _schema = {'$ref': '#/definitions/TopLevelNormalizedVConcatSpec'} - def __init__(self, fold=Undefined, **kwds): - super(FoldTransform, self).__init__(fold=fold, **kwds) + 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(TopLevelNormalizedVConcatSpecGenericSpec, 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 ImputeTransform(Transform): - """ImputeTransform schema wrapper +class TopLevelRepeatSpec(TopLevelSpec): + """TopLevelRepeatSpec schema wrapper - Mapping(required=[impute, key]) + anyOf(Mapping(required=[repeat, spec]), Mapping(required=[repeat, spec])) + """ + _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} - Attributes - ---------- + def __init__(self, *args, **kwds): + super(TopLevelRepeatSpec, self).__init__(*args, **kwds) - 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), 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 - `__. +class TopLevelUnitSpec(TopLevelSpec): + """TopLevelUnitSpec schema wrapper - 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. + Mapping(required=[data, mark]) - 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"``. + Attributes + ---------- - **Default value:** ``"value"`` - value : Any - The field value to use when the imputation ``method`` is ``"value"``. - """ - _schema = {'$ref': '#/definitions/ImputeTransform'} + 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"``. - 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) + * 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. -class JoinAggregateTransform(Transform): - """JoinAggregateTransform schema wrapper + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. - Mapping(required=[joinaggregate]) + **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. - Attributes - ---------- + **Default value** : ``pad`` + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. - 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'} + **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``. - def __init__(self, joinaggregate=Undefined, groupby=Undefined, **kwds): - super(JoinAggregateTransform, self).__init__(joinaggregate=joinaggregate, groupby=groupby, - **kwds) + * 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. -class LoessTransform(Transform): - """LoessTransform schema wrapper + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. - Mapping(required=[loess, on]) + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. - Attributes - ---------- + **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. - 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`, :class:`FieldName`]) - The output field names for the smoothed points generated by the loess transform. + * 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:** The field names of the input x and y values. - """ - _schema = {'$ref': '#/definitions/LoessTransform'} + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. - 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) + **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. -class LookupTransform(Transform): - """LookupTransform schema wrapper + **Default value** : ``5`` + params : List(:class:`Parameter`) + Dynamic variables that parameterize a visualization. + 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. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + 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. - Mapping(required=[lookup, from]) + **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:`Dictunknown` + 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. - Attributes - ---------- + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. - lookup : string - Key in primary data source. - default : string - 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 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"``. - 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. + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. - 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. + **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/v4.json``. Setting the ``$schema`` + property allows automatic validation and autocomplete in editors that support JSON + schema. """ - _schema = {'$ref': '#/definitions/LookupTransform'} + _schema = {'$ref': '#/definitions/TopLevelUnitSpec'} - def __init__(self, lookup=Undefined, default=Undefined, **kwds): - super(LookupTransform, self).__init__(lookup=lookup, default=default, **kwds) + 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, selection=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, + selection=selection, spacing=spacing, title=title, + transform=transform, usermeta=usermeta, view=view, + width=width, **kwds) -class PivotTransform(Transform): - """PivotTransform schema wrapper +class TopoDataFormat(DataFormat): + """TopoDataFormat schema wrapper - Mapping(required=[pivot, value]) + Mapping(required=[]) 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 : string - 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) + 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"``. -class QuantileTransform(Transform): - """QuantileTransform schema wrapper + **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'} - Mapping(required=[quantile]) + 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) - 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`, :class:`FieldName`]) - The output field names for the probability and quantile values. +class Transform(VegaLiteSchema): + """Transform schema wrapper - **Default value:** ``["prob", "value"]`` + 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/QuantileTransform'} + _schema = {'$ref': '#/definitions/Transform'} - 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) + def __init__(self, *args, **kwds): + super(Transform, self).__init__(*args, **kwds) -class RegressionTransform(Transform): - """RegressionTransform schema wrapper +class AggregateTransform(Transform): + """AggregateTransform schema wrapper - Mapping(required=[regression, on]) + Mapping(required=[aggregate]) 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, float]) - A [min, max] domain over the independent (x) field for the starting and ending - points of the generated trend line. + 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. - 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`, :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'} + _schema = {'$ref': '#/definitions/AggregateTransform'} - 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) + def __init__(self, aggregate=Undefined, groupby=Undefined, **kwds): + super(AggregateTransform, self).__init__(aggregate=aggregate, groupby=groupby, **kwds) -class SampleTransform(Transform): - """SampleTransform schema wrapper +class BinTransform(Transform): + """BinTransform schema wrapper - Mapping(required=[sample]) + Mapping(required=[bin, field, as]) Attributes ---------- - sample : float - The maximum number of data objects to include in the sample. - - **Default value:** ``1000`` + 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/SampleTransform'} - - def __init__(self, sample=Undefined, **kwds): - super(SampleTransform, self).__init__(sample=sample, **kwds) + _schema = {'$ref': '#/definitions/BinTransform'} + def __init__(self, bin=Undefined, field=Undefined, **kwds): + super(BinTransform, self).__init__(bin=bin, field=field, **kwds) -class StackTransform(Transform): - """StackTransform schema wrapper - Mapping(required=[stack, groupby, as]) +class CalculateTransform(Transform): + """CalculateTransform schema wrapper - Attributes - ---------- + Mapping(required=[calculate, as]) - 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]``. + Attributes + ---------- - **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`, :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"``. + 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/StackTransform'} + _schema = {'$ref': '#/definitions/CalculateTransform'} - 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) + def __init__(self, calculate=Undefined, **kwds): + super(CalculateTransform, self).__init__(calculate=calculate, **kwds) -class TimeUnitTransform(Transform): - """TimeUnitTransform schema wrapper +class DensityTransform(Transform): + """DensityTransform schema wrapper - Mapping(required=[timeUnit, field, as]) + Mapping(required=[density]) 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'} + 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). - def __init__(self, field=Undefined, timeUnit=Undefined, **kwds): - super(TimeUnitTransform, self).__init__(field=field, timeUnit=timeUnit, **kwds) + **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(: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. -class TypeForShape(VegaLiteSchema): - """TypeForShape schema wrapper + **Default value:** ``200`` + minsteps : float + The minimum number of samples to take along the extent domain for plotting the + density. - enum('nominal', 'ordinal', 'geojson') + **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`, :class:`FieldName`]) + The output fields for the sample value and corresponding density estimate. + + **Default value:** ``["value", "density"]`` """ - _schema = {'$ref': '#/definitions/TypeForShape'} + _schema = {'$ref': '#/definitions/DensityTransform'} - def __init__(self, *args): - super(TypeForShape, self).__init__(*args) + 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 TypedFieldDef(VegaLiteSchema): - """TypedFieldDef schema wrapper +class FilterTransform(Transform): + """FilterTransform schema wrapper - Mapping(required=[type]) - Definition object for a data field, its type and transformation of an encoding channel. + Mapping(required=[filter]) Attributes ---------- - type : :class:`StandardType` - The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, - ``"ordinal"``, or ``"nominal"`` ). - It can also be a ``"geojson"`` type for encoding `'geoshape' - `__. + filter : :class:`PredicateComposition` + The ``filter`` property must be a predication definition, which can take one of the + following forms: - **Note:** - - - * 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`` ). - * 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. - * 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"`` (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", "type": "quantitative"}``. The ``"type"`` of the aggregate output - is ``"quantitative"``. - * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have - ``type`` as they have exactly the same type as their primary channels (e.g., - ``x``, ``y`` ). + 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. - **See also:** `type `__ - documentation. - aggregate : :class:`Aggregate` - Aggregation function for the field - (e.g., ``"mean"``, ``"sum"``, ``"median"``, ``"min"``, ``"max"``, ``"count"`` ). + 2) one of the `field predicates + `__ : `equal + `__, `lt + `__, `lte + `__, `gt + `__, `gte + `__, `range + `__, `oneOf + `__, or + `valid `__, - **Default value:** ``undefined`` (None) + 3) a `selection predicate + `__, which + define the names of a selection that the data point should belong to (or a logical + composition of selections). - **See also:** `aggregate `__ - documentation. - bin : anyOf(boolean, :class:`BinParams`, enum('binned'), 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"`` ). + 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) - 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. +class FlattenTransform(Transform): + """FlattenTransform schema wrapper - **Default value:** ``false`` + Mapping(required=[flatten]) - **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. + Attributes + ---------- - **See also:** `field `__ - documentation. + 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. - **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:** The field name of the corresponding array field + """ + _schema = {'$ref': '#/definitions/FlattenTransform'} - **Default value:** ``undefined`` (None) + def __init__(self, flatten=Undefined, **kwds): + super(FlattenTransform, self).__init__(flatten=flatten, **kwds) - **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. +class FoldTransform(Transform): + """FoldTransform schema wrapper - **Notes** : + Mapping(required=[fold]) - 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 - `__. + Attributes + ---------- - 2) If both field definition's ``title`` and axis, header, or legend ``title`` are - defined, axis/header/legend title will be used. + fold : List(:class:`FieldName`) + An array of data fields indicating the properties to fold. + as : List([:class:`FieldName`, :class:`FieldName`]) + The output field names for the key and value properties produced by the fold + transform. **Default value:** ``["key", "value"]`` """ - _schema = {'$ref': '#/definitions/TypedFieldDef'} + _schema = {'$ref': '#/definitions/FoldTransform'} - def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, - timeUnit=Undefined, title=Undefined, **kwds): - super(TypedFieldDef, self).__init__(type=type, aggregate=aggregate, bin=bin, field=field, - timeUnit=timeUnit, title=title, **kwds) + def __init__(self, fold=Undefined, **kwds): + super(FoldTransform, self).__init__(fold=fold, **kwds) -class UnitSpec(VegaLiteSchema): - """UnitSpec schema wrapper +class ImputeTransform(Transform): + """ImputeTransform schema wrapper - Mapping(required=[mark]) - A unit specification, which can contain either `primitive marks or composite marks - `__. + Mapping(required=[impute, key]) 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, enum('container'), :class:`Step`) - **Deprecated:** Please avoid using width in a unit spec that's a part of a layer - spec. - name : string - Name of the visualization for later reference. - 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. - selection : Mapping(required=[]) - A key-value mapping between selection names and definitions. - 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` - **Deprecated:** Please avoid using width in a unit spec that's a part of a layer - spec. - width : anyOf(float, enum('container'), :class:`Step`) - **Deprecated:** Please avoid using width in a unit spec that's a part of a layer - spec. - """ - _schema = {'$ref': '#/definitions/UnitSpec'} + 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), 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. - def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, - height=Undefined, name=Undefined, projection=Undefined, selection=Undefined, - title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds): - super(UnitSpec, self).__init__(mark=mark, data=data, description=description, encoding=encoding, - height=height, name=name, projection=projection, - selection=selection, title=title, transform=transform, view=view, - width=width, **kwds) + **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 UnitSpecWithFrame(VegaLiteSchema): - """UnitSpecWithFrame schema wrapper +class JoinAggregateTransform(Transform): + """JoinAggregateTransform schema wrapper - Mapping(required=[mark]) + Mapping(required=[joinaggregate]) 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, enum('container'), :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. + 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'} - **Note:** For plots with `row and column channels - `__, this represents the - height of a single view and the ``"container"`` option cannot be used. + def __init__(self, joinaggregate=Undefined, groupby=Undefined, **kwds): + super(JoinAggregateTransform, self).__init__(joinaggregate=joinaggregate, groupby=groupby, + **kwds) - **See also:** `height `__ - documentation. - name : string - Name of the visualization for later reference. - 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. - selection : Mapping(required=[]) - A key-value mapping between selection names and definitions. - 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, enum('container'), :class:`Step`) - The width of a visualization. +class LoessTransform(Transform): + """LoessTransform schema wrapper + Mapping(required=[loess, on]) - * 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"``. + Attributes + ---------- - **Default value:** - Based on ``config.view.continuousWidth`` for a plot with a continuous x-field and - ``config.view.discreteWidth`` otherwise. + 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. - **Note:** For plots with `row and column channels - `__, this represents the - width of a single view and the ``"container"`` option cannot be used. + **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`, :class:`FieldName`]) + The output field names for the smoothed points generated by the loess transform. - **See also:** `width `__ - documentation. + **Default value:** The field names of the input x and y values. """ - _schema = {'$ref': '#/definitions/UnitSpecWithFrame'} + _schema = {'$ref': '#/definitions/LoessTransform'} - def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, - height=Undefined, name=Undefined, projection=Undefined, selection=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, - projection=projection, selection=selection, title=title, - transform=transform, view=view, width=width, **kwds) + 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 UrlData(DataSource): - """UrlData schema wrapper +class LookupTransform(Transform): + """LookupTransform schema wrapper - Mapping(required=[url]) + Mapping(required=[lookup, from]) 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) + lookup : string + Key in primary data source. + default : string + 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. -class UtcMultiTimeUnit(MultiTimeUnit): - """UtcMultiTimeUnit schema wrapper + 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. - enum('utcyearquarter', 'utcyearquartermonth', 'utcyearmonth', 'utcyearmonthdate', - 'utcyearmonthdatehours', 'utcyearmonthdatehoursminutes', - 'utcyearmonthdatehoursminutesseconds', 'utcquartermonth', 'utcmonthdate', - 'utcmonthdatehours', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', - 'utcsecondsmilliseconds') + 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/UtcMultiTimeUnit'} + _schema = {'$ref': '#/definitions/LookupTransform'} - def __init__(self, *args): - super(UtcMultiTimeUnit, self).__init__(*args) + def __init__(self, lookup=Undefined, default=Undefined, **kwds): + super(LookupTransform, self).__init__(lookup=lookup, default=default, **kwds) -class UtcSingleTimeUnit(SingleTimeUnit): - """UtcSingleTimeUnit schema wrapper +class PivotTransform(Transform): + """PivotTransform schema wrapper + + Mapping(required=[pivot, value]) + + Attributes + ---------- - enum('utcyear', 'utcquarter', 'utcmonth', 'utcday', 'utcdate', 'utchours', 'utcminutes', - 'utcseconds', 'utcmilliseconds') + 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 : string + The aggregation operation to apply to grouped ``value`` field values. **Default + value:** ``sum`` """ - _schema = {'$ref': '#/definitions/UtcSingleTimeUnit'} + _schema = {'$ref': '#/definitions/PivotTransform'} - def __init__(self, *args): - super(UtcSingleTimeUnit, self).__init__(*args) + 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 VConcatSpecGenericSpec(Spec): - """VConcatSpecGenericSpec schema wrapper +class QuantileTransform(Transform): + """QuantileTransform schema wrapper - Mapping(required=[vconcat]) - Base interface for a vertical concatenation specification. + Mapping(required=[quantile]) 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``. + 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`, :class:`FieldName`]) + The output field names for the probability and quantile values. + **Default value:** ``["prob", "value"]`` + """ + _schema = {'$ref': '#/definitions/QuantileTransform'} - * 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. + 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) - **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. +class RegressionTransform(Transform): + """RegressionTransform schema wrapper - **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'} + Mapping(required=[regression, on]) - 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) + 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, 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. -class Value(SelectionInit): - """Value schema wrapper + **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). - anyOf(float, string, boolean, List(float), None) - """ - _schema = {'$ref': '#/definitions/Value'} + **Default value:** ``false`` + as : List([:class:`FieldName`, :class:`FieldName`]) + The output field names for the smoothed points generated by the regression + transform. - def __init__(self, *args, **kwds): - super(Value, self).__init__(*args, **kwds) + **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 ValueConditionGradientstringnull(VegaLiteSchema): - """ValueConditionGradientstringnull schema wrapper - anyOf(:class:`ConditionalValueDefGradientstringnull`, - List(:class:`ConditionalValueDefGradientstringnull`)) - """ - _schema = {'$ref': '#/definitions/ValueCondition<(Gradient|string|null)>'} +class SampleTransform(Transform): + """SampleTransform schema wrapper - def __init__(self, *args, **kwds): - super(ValueConditionGradientstringnull, self).__init__(*args, **kwds) + Mapping(required=[sample]) + Attributes + ---------- -class ConditionalValueDefGradientstringnull(ValueConditionGradientstringnull): - """ConditionalValueDefGradientstringnull schema wrapper + sample : float + The maximum number of data objects to include in the sample. - anyOf(:class:`ConditionalPredicateValueDefGradientstringnull`, - :class:`ConditionalSelectionValueDefGradientstringnull`) + **Default value:** ``1000`` """ - _schema = {'$ref': '#/definitions/ConditionalValueDef<(Gradient|string|null)>'} + _schema = {'$ref': '#/definitions/SampleTransform'} - def __init__(self, *args, **kwds): - super(ConditionalValueDefGradientstringnull, self).__init__(*args, **kwds) + def __init__(self, sample=Undefined, **kwds): + super(SampleTransform, self).__init__(sample=sample, **kwds) -class ConditionalPredicateValueDefGradientstringnull(ConditionalValueDefGradientstringnull): - """ConditionalPredicateValueDefGradientstringnull schema wrapper +class StackTransform(Transform): + """StackTransform schema wrapper - Mapping(required=[test, value]) + Mapping(required=[stack, groupby, as]) Attributes ---------- - test : :class:`PredicateComposition` - Predicate for triggering the condition - value : anyOf(:class:`Gradient`, string, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + 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`, :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/ConditionalPredicate>'} + _schema = {'$ref': '#/definitions/StackTransform'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefGradientstringnull, self).__init__(test=test, value=value, - **kwds) + 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 ConditionalSelectionValueDefGradientstringnull(ConditionalValueDefGradientstringnull): - """ConditionalSelectionValueDefGradientstringnull schema wrapper +class TimeUnitTransform(Transform): + """TimeUnitTransform schema wrapper - Mapping(required=[selection, value]) + Mapping(required=[timeUnit, field, as]) Attributes ---------- - selection : :class:`SelectionComposition` - A `selection name `__, or a - series of `composed selections - `__. - value : anyOf(:class:`Gradient`, string, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + 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/ConditionalSelection>'} + _schema = {'$ref': '#/definitions/TimeUnitTransform'} - def __init__(self, selection=Undefined, value=Undefined, **kwds): - super(ConditionalSelectionValueDefGradientstringnull, self).__init__(selection=selection, - value=value, **kwds) + def __init__(self, field=Undefined, timeUnit=Undefined, **kwds): + super(TimeUnitTransform, self).__init__(field=field, timeUnit=timeUnit, **kwds) -class ValueConditionText(VegaLiteSchema): - """ValueConditionText schema wrapper +class Type(VegaLiteSchema): + """Type schema wrapper - anyOf(:class:`ConditionalValueDefText`, List(:class:`ConditionalValueDefText`)) + enum('quantitative', 'ordinal', 'temporal', 'nominal', 'geojson') + Data type based on level of measurement """ - _schema = {'$ref': '#/definitions/ValueCondition'} + _schema = {'$ref': '#/definitions/Type'} - def __init__(self, *args, **kwds): - super(ValueConditionText, self).__init__(*args, **kwds) + def __init__(self, *args): + super(Type, self).__init__(*args) -class ConditionalValueDefText(ValueConditionText): - """ConditionalValueDefText schema wrapper +class TypeForShape(VegaLiteSchema): + """TypeForShape schema wrapper - anyOf(:class:`ConditionalPredicateValueDefText`, :class:`ConditionalSelectionValueDefText`) + enum('nominal', 'ordinal', 'geojson') """ - _schema = {'$ref': '#/definitions/ConditionalValueDef'} + _schema = {'$ref': '#/definitions/TypeForShape'} - def __init__(self, *args, **kwds): - super(ConditionalValueDefText, self).__init__(*args, **kwds) + def __init__(self, *args): + super(TypeForShape, self).__init__(*args) -class ConditionalPredicateValueDefText(ConditionalValueDefText): - """ConditionalPredicateValueDefText schema wrapper +class TypedFieldDef(VegaLiteSchema): + """TypedFieldDef schema wrapper - Mapping(required=[test, value]) + Mapping(required=[]) + Definition object for a data field, its type and transformation of an encoding channel. Attributes ---------- - test : :class:`PredicateComposition` - Predicate for triggering the condition - value : :class:`Text` - 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>'} + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefText, self).__init__(test=test, value=value, **kwds) + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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"`` ). -class ConditionalSelectionValueDefText(ConditionalValueDefText): - """ConditionalSelectionValueDefText schema wrapper - Mapping(required=[selection, value]) + If ``true``, default `binning parameters + `__ will be applied. - Attributes - ---------- + 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. - selection : :class:`SelectionComposition` - A `selection name `__, or a - series of `composed selections - `__. - value : :class:`Text` - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). - """ - _schema = {'$ref': '#/definitions/ConditionalSelection>'} + **Default value:** ``false`` - def __init__(self, selection=Undefined, value=Undefined, **kwds): - super(ConditionalSelectionValueDefText, self).__init__(selection=selection, value=value, **kwds) + **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. -class ValueConditionnumber(VegaLiteSchema): - """ValueConditionnumber schema wrapper + **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 + `__. - anyOf(:class:`ConditionalValueDefnumber`, List(:class:`ConditionalValueDefnumber`)) - """ - _schema = {'$ref': '#/definitions/ValueCondition'} + **Default value:** ``undefined`` (None) - def __init__(self, *args, **kwds): - super(ValueConditionnumber, self).__init__(*args, **kwds) + **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. -class ConditionalValueDefnumber(ValueConditionnumber): - """ConditionalValueDefnumber schema wrapper + **Notes** : - anyOf(:class:`ConditionalPredicateValueDefnumber`, - :class:`ConditionalSelectionValueDefnumber`) - """ - _schema = {'$ref': '#/definitions/ConditionalValueDef'} + 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 + `__. - def __init__(self, *args, **kwds): - super(ConditionalValueDefnumber, self).__init__(*args, **kwds) + 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``. -class ConditionalPredicateValueDefnumber(ConditionalValueDefnumber): - """ConditionalPredicateValueDefnumber schema wrapper + **Default value:** - Mapping(required=[test, 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`` ). - Attributes - ---------- + **See also:** `type `__ + documentation. + """ + _schema = {'$ref': '#/definitions/TypedFieldDef'} - test : :class:`PredicateComposition` - Predicate for triggering the condition - value : List(float) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(TypedFieldDef, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class URI(VegaLiteSchema): + """URI schema wrapper + + string """ - _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + _schema = {'$ref': '#/definitions/URI'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefnumber, self).__init__(test=test, value=value, **kwds) + def __init__(self, *args): + super(URI, self).__init__(*args) -class ConditionalSelectionValueDefnumber(ConditionalValueDefnumber): - """ConditionalSelectionValueDefnumber schema wrapper +class UnitSpec(VegaLiteSchema): + """UnitSpec schema wrapper - Mapping(required=[selection, value]) + Mapping(required=[mark]) + A unit specification, which can contain either `primitive marks or composite marks + `__. Attributes ---------- - selection : :class:`SelectionComposition` - A `selection name `__, or a - series of `composed selections - `__. - value : List(float) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + 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`) + **Deprecated:** Please avoid using width in a unit spec that's a part of a layer + spec. + name : string + Name of the visualization for later reference. + 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. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + 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` + **Deprecated:** Please avoid using width in a unit spec that's a part of a layer + spec. + width : anyOf(float, string, :class:`Step`) + **Deprecated:** Please avoid using width in a unit spec that's a part of a layer + spec. """ - _schema = {'$ref': '#/definitions/ConditionalSelection>'} + _schema = {'$ref': '#/definitions/UnitSpec'} - def __init__(self, selection=Undefined, value=Undefined, **kwds): - super(ConditionalSelectionValueDefnumber, self).__init__(selection=selection, value=value, - **kwds) + def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, projection=Undefined, selection=Undefined, + title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds): + super(UnitSpec, self).__init__(mark=mark, data=data, description=description, encoding=encoding, + height=height, name=name, projection=projection, + selection=selection, title=title, transform=transform, view=view, + width=width, **kwds) + + +class UnitSpecWithFrame(VegaLiteSchema): + """UnitSpecWithFrame schema wrapper + + Mapping(required=[mark]) + Attributes + ---------- -class ValueConditionstring(VegaLiteSchema): - """ValueConditionstring schema wrapper + 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. - anyOf(:class:`ConditionalValueDefstring`, List(:class:`ConditionalValueDefstring`)) - """ - _schema = {'$ref': '#/definitions/ValueCondition'} - def __init__(self, *args, **kwds): - super(ValueConditionstring, self).__init__(*args, **kwds) + * 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. -class ConditionalValueDefstring(ValueConditionstring): - """ConditionalValueDefstring schema wrapper + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. - anyOf(:class:`ConditionalPredicateValueDefstring`, - :class:`ConditionalSelectionValueDefstring`) - """ - _schema = {'$ref': '#/definitions/ConditionalValueDef'} + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + 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. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + 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. - def __init__(self, *args, **kwds): - super(ConditionalValueDefstring, self).__init__(*args, **kwds) + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. -class ConditionalPredicateValueDefstring(ConditionalValueDefstring): - """ConditionalPredicateValueDefstring schema wrapper + * 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"``. - Mapping(required=[test, value]) + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. - Attributes - ---------- + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. - test : :class:`PredicateComposition` - Predicate for triggering the condition - value : string - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + **See also:** `width `__ + documentation. """ - _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + _schema = {'$ref': '#/definitions/UnitSpecWithFrame'} - def __init__(self, test=Undefined, value=Undefined, **kwds): - super(ConditionalPredicateValueDefstring, self).__init__(test=test, value=value, **kwds) + def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, projection=Undefined, selection=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, + projection=projection, selection=selection, title=title, + transform=transform, view=view, width=width, **kwds) -class ConditionalSelectionValueDefstring(ConditionalValueDefstring): - """ConditionalSelectionValueDefstring schema wrapper +class UrlData(DataSource): + """UrlData schema wrapper - Mapping(required=[selection, value]) + Mapping(required=[url]) Attributes ---------- - selection : :class:`SelectionComposition` - A `selection name `__, or a - series of `composed selections - `__. - value : string - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + 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/ConditionalSelection>'} + _schema = {'$ref': '#/definitions/UrlData'} - def __init__(self, selection=Undefined, value=Undefined, **kwds): - super(ConditionalSelectionValueDefstring, self).__init__(selection=selection, value=value, - **kwds) + def __init__(self, url=Undefined, format=Undefined, name=Undefined, **kwds): + super(UrlData, self).__init__(url=url, format=format, name=name, **kwds) -class ValueConditionstringnull(VegaLiteSchema): - """ValueConditionstringnull schema wrapper +class UtcMultiTimeUnit(MultiTimeUnit): + """UtcMultiTimeUnit schema wrapper - anyOf(:class:`ConditionalStringValueDef`, List(:class:`ConditionalStringValueDef`)) + 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/ValueCondition<(string|null)>'} + _schema = {'$ref': '#/definitions/UtcMultiTimeUnit'} - def __init__(self, *args, **kwds): - super(ValueConditionstringnull, self).__init__(*args, **kwds) + def __init__(self, *args): + super(UtcMultiTimeUnit, self).__init__(*args) -class ConditionalStringValueDef(ValueConditionstringnull): - """ConditionalStringValueDef schema wrapper +class UtcSingleTimeUnit(SingleTimeUnit): + """UtcSingleTimeUnit schema wrapper - anyOf(:class:`ConditionalPredicateStringValueDef`, - :class:`ConditionalSelectionStringValueDef`) + enum('utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', + 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds') """ - _schema = {'$ref': '#/definitions/ConditionalStringValueDef'} + _schema = {'$ref': '#/definitions/UtcSingleTimeUnit'} - def __init__(self, *args, **kwds): - super(ConditionalStringValueDef, self).__init__(*args, **kwds) + def __init__(self, *args): + super(UtcSingleTimeUnit, self).__init__(*args) -class ConditionalPredicateStringValueDef(ConditionalStringValueDef): - """ConditionalPredicateStringValueDef schema wrapper +class VConcatSpecGenericSpec(Spec): + """VConcatSpecGenericSpec schema wrapper - Mapping(required=[test, value]) + Mapping(required=[vconcat]) + Base interface for a vertical concatenation specification. Attributes ---------- - test : :class:`PredicateComposition` - Predicate for triggering the condition - value : anyOf(string, None) - 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(ConditionalPredicateStringValueDef, self).__init__(test=test, value=value, **kwds) + 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``. -class ConditionalSelectionStringValueDef(ConditionalStringValueDef): - """ConditionalSelectionStringValueDef schema wrapper + * 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. - Mapping(required=[selection, value]) + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. - Attributes - ---------- + **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. - selection : :class:`SelectionComposition` - A `selection name `__, or a - series of `composed selections - `__. - value : anyOf(string, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). + **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/ConditionalSelection'} + _schema = {'$ref': '#/definitions/VConcatSpec'} - def __init__(self, selection=Undefined, value=Undefined, **kwds): - super(ConditionalSelectionStringValueDef, self).__init__(selection=selection, value=value, - **kwds) + 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 ValueDefWithConditionMarkPropFieldDefGradientstringnull(VegaLiteSchema): - """ValueDefWithConditionMarkPropFieldDefGradientstringnull schema wrapper +class ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull(ColorDef, MarkPropDefGradientstringnull): + """ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, - :class:`ValueConditionGradientstringnull`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(:class:`Gradient`, string, None) + 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'} + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueDefWithConditionMarkPropFieldDefGradientstringnull, self).__init__(condition=condition, - value=value, - **kwds) + super(ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, self).__init__(condition=condition, + value=value, + **kwds) -class ValueDefWithConditionMarkPropFieldDefTypeForShapestringnull(VegaLiteSchema): - """ValueDefWithConditionMarkPropFieldDefTypeForShapestringnull schema wrapper +class ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull(MarkPropDefstringnullTypeForShape, ShapeDef): + """ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDefTypeForShape`, - :class:`ValueConditionstringnull`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) + 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)>'} + _schema = {'$ref': '#/definitions/ValueDefWithCondition,(string|null)>'} def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueDefWithConditionMarkPropFieldDefTypeForShapestringnull, self).__init__(condition=condition, - value=value, - **kwds) + super(ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull, self).__init__(condition=condition, + value=value, + **kwds) -class ValueDefWithConditionMarkPropFieldDefnumber(VegaLiteSchema): - """ValueDefWithConditionMarkPropFieldDefnumber schema wrapper +class ValueDefWithConditionMarkPropFieldOrDatumDefnumber(MarkPropDefnumber, NumericArrayMarkPropDef, NumericMarkPropDef): + """ValueDefWithConditionMarkPropFieldOrDatumDefnumber schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionnumber`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : List(float) + 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'} + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueDefWithConditionMarkPropFieldDefnumber, self).__init__(condition=condition, - value=value, **kwds) + super(ValueDefWithConditionMarkPropFieldOrDatumDefnumber, self).__init__(condition=condition, + value=value, **kwds) -class ValueDefWithConditionMarkPropFieldDefstringnull(VegaLiteSchema): - """ValueDefWithConditionMarkPropFieldDefstringnull schema wrapper +class ValueDefWithConditionMarkPropFieldOrDatumDefstringnull(VegaLiteSchema): + """ValueDefWithConditionMarkPropFieldOrDatumDefstringnull schema wrapper Mapping(required=[]) Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionstringnull`) + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) + 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'} + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueDefWithConditionMarkPropFieldDefstringnull, self).__init__(condition=condition, - value=value, **kwds) + super(ValueDefWithConditionMarkPropFieldOrDatumDefstringnull, self).__init__(condition=condition, + value=value, **kwds) -class ValueDefWithConditionStringFieldDefText(VegaLiteSchema): +class ValueDefWithConditionStringFieldDefText(TextDef): """ValueDefWithConditionStringFieldDefText schema wrapper Mapping(required=[]) @@ -19366,9 +19022,10 @@ class ValueDefWithConditionStringFieldDefText(VegaLiteSchema): Attributes ---------- - condition : anyOf(:class:`ConditionalStringFieldDef`, :class:`ValueConditionText`) + condition : anyOf(:class:`ConditionalStringFieldDef`, + :class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : :class:`Text` + 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). @@ -19380,117 +19037,67 @@ def __init__(self, condition=Undefined, value=Undefined, **kwds): **kwds) -class ValueWithConditionMarkPropFieldDefGradientstringnull(VegaLiteSchema): - """ValueWithConditionMarkPropFieldDefGradientstringnull schema wrapper - - Mapping(required=[]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, - :class:`ValueConditionGradientstringnull`) - A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(:class:`Gradient`, string, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). - """ - _schema = {'$ref': '#/definitions/ValueWithCondition'} - - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueWithConditionMarkPropFieldDefGradientstringnull, self).__init__(condition=condition, - value=value, **kwds) - - -class ValueWithConditionMarkPropFieldDefTypeForShapestringnull(VegaLiteSchema): - """ValueWithConditionMarkPropFieldDefTypeForShapestringnull schema wrapper - - Mapping(required=[]) - - Attributes - ---------- - - condition : anyOf(:class:`ConditionalMarkPropFieldDefTypeForShape`, - :class:`ValueConditionstringnull`) - A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). - """ - _schema = {'$ref': '#/definitions/ValueWithCondition,(string|null)>'} - - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueWithConditionMarkPropFieldDefTypeForShapestringnull, self).__init__(condition=condition, - value=value, - **kwds) - +class ValueDefnumber(VegaLiteSchema): + """ValueDefnumber schema wrapper -class ValueWithConditionMarkPropFieldDefnumber(VegaLiteSchema): - """ValueWithConditionMarkPropFieldDefnumber schema wrapper - - Mapping(required=[]) + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionnumber`) - A field definition or one or more value definition(s) with a selection predicate. 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/ValueWithCondition'} + _schema = {'$ref': '#/definitions/ValueDef'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueWithConditionMarkPropFieldDefnumber, self).__init__(condition=condition, value=value, - **kwds) + def __init__(self, value=Undefined, **kwds): + super(ValueDefnumber, self).__init__(value=value, **kwds) -class ValueWithConditionMarkPropFieldDefstringnull(VegaLiteSchema): - """ValueWithConditionMarkPropFieldDefstringnull schema wrapper +class ValueDefnumberExprRef(VegaLiteSchema): + """ValueDefnumberExprRef schema wrapper - Mapping(required=[]) + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. Attributes ---------- - condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ValueConditionstringnull`) - A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(string, None) + 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/ValueWithCondition'} + _schema = {'$ref': '#/definitions/ValueDef<(number|ExprRef)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueWithConditionMarkPropFieldDefstringnull, self).__init__(condition=condition, - value=value, **kwds) + def __init__(self, value=Undefined, **kwds): + super(ValueDefnumberExprRef, self).__init__(value=value, **kwds) -class ValueWithConditionStringFieldDefText(VegaLiteSchema): - """ValueWithConditionStringFieldDefText schema wrapper +class ValueDefnumberwidthheightExprRef(VegaLiteSchema): + """ValueDefnumberwidthheightExprRef schema wrapper - Mapping(required=[]) + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. Attributes ---------- - condition : anyOf(:class:`ConditionalStringFieldDef`, :class:`ValueConditionText`) - A field definition or one or more value definition(s) with a selection predicate. - value : :class:`Text` + 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/ValueWithCondition'} + _schema = {'$ref': '#/definitions/ValueDef<(number|"width"|"height"|ExprRef)>'} - def __init__(self, condition=Undefined, value=Undefined, **kwds): - super(ValueWithConditionStringFieldDefText, self).__init__(condition=condition, value=value, - **kwds) + def __init__(self, value=Undefined, **kwds): + super(ValueDefnumberwidthheightExprRef, self).__init__(value=value, **kwds) class Vector2DateTime(SelectionInitInterval): @@ -19567,51 +19174,40 @@ class ViewBackground(VegaLiteSchema): Attributes ---------- - cornerRadius : float - The radius in pixels of rounded rectangle corners. + cornerRadius : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` cursor : :class:`Cursor` The mouse cursor used over the view. Any valid `CSS cursor type `__ can be used. - fill : anyOf(:class:`Color`, None) + fill : anyOf(:class:`Color`, None, :class:`ExprRef`) The fill color. **Default value:** ``undefined`` - fillOpacity : float - The fill opacity (value between [0,1]). + fillOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` - opacity : float + 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) + stroke : anyOf(:class:`Color`, None, :class:`ExprRef`) The stroke color. **Default value:** ``"#ddd"`` - strokeCap : string - The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or - ``"square"``. + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) - **Default value:** ``"butt"`` - strokeDash : List(float) - An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : float - The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : string - The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + strokeDash : anyOf(List(float), :class:`ExprRef`) - **Default value:** ``"miter"`` - strokeMiterLimit : float - The miter limit at which to bevel a line join. - strokeOpacity : float - The stroke opacity (value between [0,1]). + 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`) - **Default value:** ``1`` - strokeWidth : float - The stroke width, in pixels. 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 @@ -19619,8 +19215,8 @@ class ViewBackground(VegaLiteSchema): `__. 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. + **Default value:** ``"cell"`` **Note:** Any specified view background properties + will augment the default style. """ _schema = {'$ref': '#/definitions/ViewBackground'} @@ -19648,77 +19244,68 @@ class ViewConfig(VegaLiteSchema): clip : boolean Whether the view should be clipped. continuousHeight : float - The default height when the plot has a continuous y-field. + 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 x-field. + The default width when the plot has a continuous field for x or longitude, or has + arc marks. **Default value:** ``200`` - cornerRadius : float - The radius in pixels of rounded rectangle corners. + cornerRadius : anyOf(float, :class:`ExprRef`) - **Default value:** ``0`` 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 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. + 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 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. + 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) + fill : anyOf(:class:`Color`, None, :class:`ExprRef`) The fill color. **Default value:** ``undefined`` - fillOpacity : float - The fill opacity (value between [0,1]). + fillOpacity : anyOf(float, :class:`ExprRef`) - **Default value:** ``1`` height : float Default height **Deprecated:** Since Vega-Lite 4.0. Please use continuousHeight and discreteHeight instead. - opacity : float + 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) + stroke : anyOf(:class:`Color`, None, :class:`ExprRef`) The stroke color. **Default value:** ``"#ddd"`` - strokeCap : string - The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or - ``"square"``. + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) - **Default value:** ``"butt"`` - strokeDash : List(float) - An array of alternating stroke, space lengths for creating dashed or dotted lines. - strokeDashOffset : float - The offset (in pixels) into which to begin drawing with the stroke dash array. - strokeJoin : string - The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + strokeDash : anyOf(List(float), :class:`ExprRef`) - **Default value:** ``"miter"`` - strokeMiterLimit : float - The miter limit at which to bevel a line join. - strokeOpacity : float - The stroke opacity (value between [0,1]). + 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`) - **Default value:** ``1`` - strokeWidth : float - The stroke width, in pixels. width : float Default width @@ -19866,45 +19453,3 @@ def __init__(self, window=Undefined, frame=Undefined, groupby=Undefined, ignoreP super(WindowTransform, self).__init__(window=window, frame=frame, groupby=groupby, ignorePeers=ignorePeers, sort=sort, **kwds) - -class XValueDef(VegaLiteSchema): - """XValueDef schema wrapper - - Mapping(required=[value]) - Definition object for a constant value (primitive value or gradient definition) of an - encoding channel. - - Attributes - ---------- - - value : anyOf(float, enum('width')) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). - """ - _schema = {'$ref': '#/definitions/XValueDef'} - - def __init__(self, value=Undefined, **kwds): - super(XValueDef, self).__init__(value=value, **kwds) - - -class YValueDef(VegaLiteSchema): - """YValueDef schema wrapper - - Mapping(required=[value]) - Definition object for a constant value (primitive value or gradient definition) of an - encoding channel. - - Attributes - ---------- - - value : anyOf(float, enum('height')) - A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient - definition `__ for color, - values between ``0`` to ``1`` for opacity). - """ - _schema = {'$ref': '#/definitions/YValueDef'} - - def __init__(self, value=Undefined, **kwds): - super(YValueDef, self).__init__(value=value, **kwds) - diff --git a/altair/vegalite/v4/schema/mixins.py b/altair/vegalite/v4/schema/mixins.py index 569692d74..bb1860f29 100644 --- a/altair/vegalite/v4/schema/mixins.py +++ b/altair/vegalite/v4/schema/mixins.py @@ -8,47 +8,117 @@ class MarkMethodMixin(object): """A mixin class that defines mark methods""" - def mark_area(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=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, + 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, + timeUnitBand=Undefined, timeUnitBandPosition=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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, - xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, - **kwds): + 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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) @@ -56,47 +126,58 @@ def mark_area(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline copy.mark = "area" return copy - def mark_bar(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=Undefined, - stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + 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, - thickness=Undefined, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, + theta2Offset=Undefined, thetaOffset=Undefined, thickness=Undefined, + timeUnitBand=Undefined, timeUnitBandPosition=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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) @@ -104,431 +185,530 @@ def mark_bar(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline= copy.mark = "bar" return copy - def mark_line(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=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, - thickness=Undefined, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=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' + 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, timeUnitBand=Undefined, timeUnitBandPosition=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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + copy.mark = core.MarkDef(type="image", **kwds) else: - copy.mark = "line" + copy.mark = "image" return copy - def mark_image(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=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, - thickness=Undefined, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=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' + 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, timeUnitBand=Undefined, timeUnitBandPosition=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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + copy.mark = core.MarkDef(type="line", **kwds) else: - copy.mark = "image" + copy.mark = "line" return copy - def mark_trail(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=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, + 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=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' + 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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + copy.mark = core.MarkDef(type="point", **kwds) else: - copy.mark = "trail" + copy.mark = "point" return copy - def mark_point(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=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, - thickness=Undefined, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=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' + 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, timeUnitBand=Undefined, timeUnitBandPosition=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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + copy.mark = core.MarkDef(type="rect", **kwds) else: - copy.mark = "point" + copy.mark = "rect" return copy - def mark_text(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=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, + 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=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' + 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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + copy.mark = core.MarkDef(type="rule", **kwds) else: - copy.mark = "text" + copy.mark = "rule" return copy - def mark_tick(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=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, + 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=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' + 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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + copy.mark = core.MarkDef(type="text", **kwds) else: - copy.mark = "tick" + copy.mark = "text" return copy - def mark_rect(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=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, + 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=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' + 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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + copy.mark = core.MarkDef(type="tick", **kwds) else: - copy.mark = "rect" + copy.mark = "tick" return copy - def mark_rule(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, size=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, - thickness=Undefined, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=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' + 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, timeUnitBand=Undefined, timeUnitBandPosition=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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + copy.mark = core.MarkDef(type="trail", **kwds) else: - copy.mark = "rule" + copy.mark = "trail" return copy - def mark_circle(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, - size=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, + 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, - xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, - **kwds): + 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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) @@ -536,47 +716,58 @@ def mark_circle(self, align=Undefined, angle=Undefined, aspect=Undefined, baseli copy.mark = "circle" return copy - def mark_square(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, - size=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, + 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, - xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, - **kwds): + 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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) @@ -584,47 +775,59 @@ def mark_square(self, align=Undefined, angle=Undefined, aspect=Undefined, baseli copy.mark = "square" return copy - def mark_geoshape(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, - binSpacing=Undefined, blend=Undefined, clip=Undefined, color=Undefined, - cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, - cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, - cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, - dir=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, - interpolate=Undefined, invalid=Undefined, limit=Undefined, line=Undefined, - lineBreak=Undefined, lineHeight=Undefined, opacity=Undefined, order=Undefined, - orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, - size=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, - thickness=Undefined, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, - tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, + 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, + timeUnitBand=Undefined, timeUnitBandPosition=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, aspect=aspect, baseline=baseline, binSpacing=binSpacing, - blend=blend, clip=clip, color=color, cornerRadius=cornerRadius, + 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, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, - fillOpacity=fillOpacity, filled=filled, font=font, fontSize=fontSize, - fontStyle=fontStyle, fontWeight=fontWeight, height=height, href=href, - interpolate=interpolate, invalid=invalid, limit=limit, line=line, - lineBreak=lineBreak, lineHeight=lineHeight, opacity=opacity, order=order, - orient=orient, point=point, radius=radius, shape=shape, size=size, stroke=stroke, - strokeCap=strokeCap, strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, - strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + 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, thickness=thickness, timeUnitBand=timeUnitBand, - timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, width=width, x=x, x2=x2, - x2Offset=x2Offset, xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, - **kwds) + text=text, theta=theta, theta2=theta2, theta2Offset=theta2Offset, + thetaOffset=thetaOffset, thickness=thickness, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) @@ -649,13 +852,14 @@ def mark_boxplot(self, box=Undefined, clip=Undefined, color=Undefined, extent=Un return copy def mark_errorbar(self, clip=Undefined, color=Undefined, extent=Undefined, opacity=Undefined, - orient=Undefined, rule=Undefined, ticks=Undefined, **kwds): + 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, - ticks=ticks, **kwds) + 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) @@ -689,6 +893,14 @@ def configure(self, *args, **kwargs): 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']) diff --git a/altair/vegalite/v4/schema/vega-lite-schema.json b/altair/vegalite/v4/schema/vega-lite-schema.json index f7d346471..dc73fa4aa 100644 --- a/altair/vegalite/v4/schema/vega-lite-schema.json +++ b/altair/vegalite/v4/schema/vega-lite-schema.json @@ -79,7 +79,7 @@ }, "op": { "$ref": "#/definitions/AggregateOp", - "description": "The aggregation operation to apply to the fields (e.g., `\"sum\"`, `\"average\"`, or `\"count\"`).\nSee the [full list of supported aggregation operations](https://vega.github.io/vega-lite/docs/aggregate.html#ops)\nfor more information." + "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": [ @@ -128,7 +128,7 @@ "AnyMarkConfig": { "anyOf": [ { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig<>" }, { "$ref": "#/definitions/AreaConfig" @@ -151,26 +151,94 @@ "additionalProperties": false, "properties": { "align": { - "$ref": "#/definitions/Align", - "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`." + "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": { - "description": "The rotation angle of the text, in degrees.", - "maximum": 360, - "minimum": 0, - "type": "number" + "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": { - "description": "Whether to keep aspect ratio of image marks.", - "type": "boolean" + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "baseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline. 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." + "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": { - "$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\"`" + "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": [ @@ -179,49 +247,144 @@ }, { "$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`." + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "cornerRadius": { - "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusBottomLeft": { - "description": "The radius in pixels of rounded rectangle bottom left corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusBottomRight": { - "description": "The radius in pixels of rounded rectangle bottom right corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusTopLeft": { - "description": "The radius in pixels of rounded rectangle top right corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusTopRight": { - "description": "The radius in pixels of rounded rectangle top left corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cursor": { - "$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." + "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": { - "$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\"`" + "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": { - "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" + "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": { - "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" + "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": { - "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", - "type": "string" + "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": [ @@ -233,52 +396,121 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Fill Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { - "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "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": { - "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", - "type": "string" + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontSize": { - "description": "The font size, in pixels.\n\n__Default value:__ `11`", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style (e.g., `\"italic\"`)." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "description": "Height of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "href": { - "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", - "format": "uri", - "type": "string" + "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`." }, "interpolate": { - "$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." + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"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." + }, + { + "$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.", + "description": "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.", "enum": [ "filter", null @@ -289,8 +521,15 @@ ] }, "limit": { - "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" + "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": [ @@ -304,18 +543,39 @@ "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": { - "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" + "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": { - "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", - "type": "number" + "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, - "type": "number" + "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.", @@ -326,7 +586,29 @@ }, "orient": { "$ref": "#/definitions/Orientation", - "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould 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\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + "description": "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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "point": { "anyOf": [ @@ -337,34 +619,85 @@ "$ref": "#/definitions/OverlayMarkDef" }, { - "enum": [ - "transparent" - ], + "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": { - "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", - "minimum": 0, - "type": "number" + "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." }, - "shape": { + "radius2": { "anyOf": [ { - "$ref": "#/definitions/SymbolShape" + "type": "number" }, { - "type": "string" + "$ref": "#/definitions/ExprRef" } ], - "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\"`" + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "size": { - "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, - "type": "number" + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__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.", + "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": [ @@ -376,66 +709,159 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Stroke Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { - "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`", - "type": "string" + "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": { - "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", - "items": { - "type": "number" - }, - "type": "array" + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeDashOffset": { - "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", - "type": "number" + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeJoin": { - "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`", - "type": "string" + "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": { - "description": "The miter limit at which to bevel a line join.", - "type": "number" + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeOffset": { - "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" + "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": { - "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeWidth": { - "description": "The stroke width, in pixels.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "tension": { - "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", - "type": "number" + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "text": { - "$ref": "#/definitions/Text", - "description": "Placeholder text if the `text` channel is not specified" + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "theta": { - "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark `startAngle` and `endAngle` properties: angles are measured in radians, with `0` indicating \"north\".", - "type": "number" + "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." }, "timeUnitBand": { - "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.\nIf set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "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" }, "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.\nIf set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "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" }, "tooltip": { @@ -452,15 +878,36 @@ { "$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`" + "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. - 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.\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": { - "description": "Width of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "x": { "anyOf": [ @@ -468,10 +915,11 @@ "type": "number" }, { - "enum": [ - "width" - ], + "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." @@ -482,10 +930,11 @@ "type": "number" }, { - "enum": [ - "width" - ], + "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." @@ -496,10 +945,11 @@ "type": "number" }, { - "enum": [ - "height" - ], + "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." @@ -510,11 +960,12 @@ "type": "number" }, { - "enum": [ - "height" - ], + "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." } @@ -580,43 +1031,125 @@ "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": { - "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" + "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" + "anyOf": [ + { + "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" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "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": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." + ] }, "domainDash": { - "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", - "items": { - "type": "number" - }, - "type": "array" + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "domainDashOffset": { - "description": "The pixel offset at which to start drawing with the domain dash array.", - "type": "number" + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the domain dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "domainOpacity": { - "description": "Opacity of the axis domain line.", - "type": "number" + "anyOf": [ + { + "description": "Opacity of the axis domain line.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "domainWidth": { - "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", - "type": "number" + "anyOf": [ + { + "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "format": { "anyOf": [ @@ -624,19 +1157,30 @@ "type": "string" }, { - "type": "object" + "$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/usage/compile.html#format-type) that takes `datum.value` and format parameter as input), this property represents the format parameter.\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." + "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). - 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 (`\"number\"` or `\"time\"` or a [registered custom format type](https://vega.github.io/vega-lite/usage/compile.html#format-type)).\n\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"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": [ { @@ -650,6 +1194,9 @@ ], "description": "Color of gridlines.\n\n__Default value:__ `\"lightGray\"`." }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisColor" } @@ -664,6 +1211,9 @@ }, "type": "array" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumberArray" } @@ -675,6 +1225,9 @@ "description": "The pixel offset at which to start drawing with the grid dash array.", "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } @@ -688,6 +1241,9 @@ "minimum": 0, "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } @@ -700,6 +1256,9 @@ "minimum": 0, "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } @@ -711,22 +1270,35 @@ "$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": { - "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" + "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. Can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`." + "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" @@ -734,10 +1306,17 @@ ] }, "labelBound": { - "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" + "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": { @@ -753,6 +1332,9 @@ ], "description": "The color of the tick label, can be in hex color code or regular color name." }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisColor" } @@ -770,8 +1352,15 @@ ] }, "labelFlushOffset": { - "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" + "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": [ @@ -779,6 +1368,9 @@ "description": "The font of the tick label.", "type": "string" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisString" } @@ -791,6 +1383,9 @@ "minimum": 0, "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } @@ -802,6 +1397,9 @@ "$ref": "#/definitions/FontStyle", "description": "Font style of the title." }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisLabelFontStyle" } @@ -813,18 +1411,35 @@ "$ref": "#/definitions/FontWeight", "description": "Font weight of axis tick labels." }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisLabelFontWeight" } ] }, "labelLimit": { - "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", - "type": "number" + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelLineHeight": { - "description": "Line height in pixels for multi-line label text.", - "type": "number" + "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": [ @@ -832,6 +1447,9 @@ "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" } @@ -843,13 +1461,23 @@ "description": "The opacity of the labels.", "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelOverlap": { - "$ref": "#/definitions/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": { @@ -858,38 +1486,83 @@ "description": "The padding in pixels between labels and ticks.\n\n__Default value:__ `2`", "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelSeparation": { - "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" + "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" + "anyOf": [ + { + "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "maxExtent": { - "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" + "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": { - "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" + "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": { "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)", "type": "number" }, "orient": { - "$ref": "#/definitions/AxisOrient", + "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": { - "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`", - "type": "number" + "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": [ @@ -903,15 +1576,33 @@ "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)\n__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)." + "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": { - "description": "For band scales, indicates if ticks and grid lines should be placed at the center of a band (default) or at the band extents to indicate intervals.", - "enum": [ - "center", - "extent" - ], - "type": "string" + "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": [ @@ -926,25 +1617,44 @@ ], "description": "The color of the axis's tick.\n\n__Default value:__ `\"gray\"`" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisColor" } ] }, "tickCount": { - "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\n__Default value__: Determine using a formula `ceil(width/40)` for x and `ceil(height/40)` for y.", - "minimum": 0, - "type": "number" - }, - "tickDash": { "anyOf": [ { - "description": "An array of alternating [stroke, space] lengths for dashed tick mark lines.", - "items": { - "type": "number" - }, + "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" } @@ -956,22 +1666,46 @@ "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" + "anyOf": [ + { + "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" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "tickMinStep": { - "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.\n\n__Default value__: `undefined`", - "type": "number" + "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": { - "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", - "type": "number" + "anyOf": [ + { + "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "tickOpacity": { "anyOf": [ @@ -979,14 +1713,24 @@ "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" + "anyOf": [ + { + "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "tickSize": { "anyOf": [ @@ -995,6 +1739,9 @@ "minimum": 0, "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } @@ -1007,14 +1754,24 @@ "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" + "anyOf": [ + { + "description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "title": { "anyOf": [ @@ -1028,77 +1785,189 @@ "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/docs/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": { - "$ref": "#/definitions/Align", - "description": "Horizontal text alignment of axis titles." + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleAnchor": { - "$ref": "#/definitions/TitleAnchor", - "description": "Text anchor position for placing axis titles." + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleAngle": { - "description": "Angle in degrees of axis titles.", - "type": "number" + "anyOf": [ + { + "description": "Angle in degrees of axis titles.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleBaseline": { - "$ref": "#/definitions/TextBaseline", - "description": "Vertical text baseline for axis titles." + "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": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of the title, can be in hex color code or regular color name." }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Color of the title, can be in hex color code or regular color name." + ] }, "titleFont": { - "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", - "type": "string" + "anyOf": [ + { + "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontSize": { - "description": "Font size of the title.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "Font size of the title.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "Font style of the title." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "Font weight of the title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "description": "Maximum allowed pixel width of axis titles.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis titles.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleLineHeight": { - "description": "Line height in pixels for multi-line title text.", - "type": "number" + "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": { - "description": "Opacity of the axis title.", - "type": "number" + "anyOf": [ + { + "description": "Opacity of the axis title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titlePadding": { - "description": "The padding, in pixels, between title and axis.", - "type": "number" + "anyOf": [ + { + "description": "The padding, in pixels, between title and axis.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleX": { - "description": "X-coordinate of the axis title relative to the axis group.", - "type": "number" + "anyOf": [ + { + "description": "X-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleY": { - "description": "Y-coordinate of the axis title relative to the axis group.", - "type": "number" + "anyOf": [ + { + "description": "Y-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "translate": { - "description": "Translation offset in pixels applied to the axis group mark x and y. If specified, overrides the default behavior of a 0.5 offset to pixel-align stroked lines.", - "type": "number" + "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": [ @@ -1125,12 +1994,15 @@ "$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.\nIf zindex is 0, axes should be drawn behind all chart elements.\nTo put them in front, set `zindex` to `1` or more.\n\n__Default value:__ `0` (behind the marks).", + "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" } @@ -1140,52 +2012,160 @@ "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": { - "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" + "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" - }, - "domainColor": { "anyOf": [ { - "type": "null" + "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" }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." - }, - "domainDash": { - "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", - "items": { - "type": "number" - }, - "type": "array" + ] }, - "domainDashOffset": { - "description": "The pixel offset at which to start drawing with the domain dash array.", - "type": "number" + "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" + } + ] }, - "domainOpacity": { - "description": "Opacity of the axis domain line.", - "type": "number" + "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": { - "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", - "type": "number" + "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). - 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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"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": [ { @@ -1199,6 +2179,9 @@ ], "description": "Color of gridlines.\n\n__Default value:__ `\"lightGray\"`." }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisColor" } @@ -1213,6 +2196,9 @@ }, "type": "array" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumberArray" } @@ -1224,6 +2210,9 @@ "description": "The pixel offset at which to start drawing with the grid dash array.", "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } @@ -1237,6 +2226,9 @@ "minimum": 0, "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } @@ -1249,6 +2241,9 @@ "minimum": 0, "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } @@ -1260,22 +2255,35 @@ "$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": { - "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" + "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. Can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`." + "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" @@ -1283,10 +2291,17 @@ ] }, "labelBound": { - "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" + "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": { @@ -1302,13 +2317,16 @@ ], "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.", + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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": { @@ -1319,8 +2337,15 @@ ] }, "labelFlushOffset": { - "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" + "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": [ @@ -1328,6 +2353,9 @@ "description": "The font of the tick label.", "type": "string" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisString" } @@ -1340,6 +2368,9 @@ "minimum": 0, "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } @@ -1351,6 +2382,9 @@ "$ref": "#/definitions/FontStyle", "description": "Font style of the title." }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisLabelFontStyle" } @@ -1362,18 +2396,35 @@ "$ref": "#/definitions/FontWeight", "description": "Font weight of axis tick labels." }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisLabelFontWeight" } ] }, "labelLimit": { - "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", - "type": "number" + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelLineHeight": { - "description": "Line height in pixels for multi-line label text.", - "type": "number" + "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": [ @@ -1381,6 +2432,9 @@ "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" } @@ -1392,13 +2446,23 @@ "description": "The opacity of the labels.", "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelOverlap": { - "$ref": "#/definitions/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": { @@ -1407,35 +2471,84 @@ "description": "The padding in pixels between labels and ticks.\n\n__Default value:__ `2`", "type": "number" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelSeparation": { - "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" + "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" + "anyOf": [ + { + "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "maxExtent": { - "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" + "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": { - "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" + "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": { "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)", "type": "number" }, "orient": { - "$ref": "#/definitions/AxisOrient", + "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": [ { @@ -1448,15 +2561,33 @@ "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)\n__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)." + "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": { - "description": "For band scales, indicates if ticks and grid lines should be placed at the center of a band (default) or at the band extents to indicate intervals.", - "enum": [ - "center", - "extent" - ], - "type": "string" + "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": [ @@ -1471,15 +2602,31 @@ ], "description": "The color of the axis's tick.\n\n__Default value:__ `\"gray\"`" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisColor" } ] }, "tickCount": { - "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\n__Default value__: Determine using a formula `ceil(width/40)` for x and `ceil(height/40)` for y.", - "minimum": 0, - "type": "number" + "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": [ @@ -1490,6 +2637,9 @@ }, "type": "array" }, + { + "$ref": "#/definitions/ExprRef" + }, { "$ref": "#/definitions/ConditionalAxisNumberArray" } @@ -1501,41 +2651,82 @@ "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" - }, - "tickOffset": { - "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", - "type": "number" - }, - "tickOpacity": { "anyOf": [ { - "description": "Opacity of the ticks.", - "type": "number" + "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" }, { - "$ref": "#/definitions/ConditionalAxisNumber" + "$ref": "#/definitions/ExprRef" } ] }, - "tickRound": { - "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", - "type": "boolean" - }, - "tickSize": { + "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": { + "anyOf": [ + { + "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "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" } @@ -1548,90 +2739,256 @@ "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" + "anyOf": [ + { + "description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "title": { - "description": "Set to null to disable title for the axis, legend, or header.", - "type": "null" + "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/docs/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": { - "$ref": "#/definitions/Align", - "description": "Horizontal text alignment of axis titles." + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleAnchor": { - "$ref": "#/definitions/TitleAnchor", - "description": "Text anchor position for placing axis titles." + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleAngle": { - "description": "Angle in degrees of axis titles.", - "type": "number" + "anyOf": [ + { + "description": "Angle in degrees of axis titles.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleBaseline": { - "$ref": "#/definitions/TextBaseline", - "description": "Vertical text baseline for axis titles." + "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": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of the title, can be in hex color code or regular color name." }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Color of the title, can be in hex color code or regular color name." + ] }, "titleFont": { - "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", - "type": "string" + "anyOf": [ + { + "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontSize": { - "description": "Font size of the title.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "Font size of the title.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "Font style of the title." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "Font weight of the title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "description": "Maximum allowed pixel width of axis titles.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis titles.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleLineHeight": { - "description": "Line height in pixels for multi-line title text.", - "type": "number" + "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": { - "description": "Opacity of the axis title.", - "type": "number" + "anyOf": [ + { + "description": "Opacity of the axis title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titlePadding": { - "description": "The padding, in pixels, between title and axis.", - "type": "number" + "anyOf": [ + { + "description": "The padding, in pixels, between title and axis.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleX": { - "description": "X-coordinate of the axis title relative to the axis group.", - "type": "number" + "anyOf": [ + { + "description": "X-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleY": { - "description": "Y-coordinate of the axis title relative to the axis group.", - "type": "number" + "anyOf": [ + { + "description": "Y-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "translate": { - "description": "Translation offset in pixels applied to the axis group mark x and y. If specified, overrides the default behavior of a 0.5 offset to pixel-align stroked lines.", + "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" } }, @@ -1662,22 +3019,83 @@ "additionalProperties": false, "properties": { "align": { - "$ref": "#/definitions/Align", - "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`." + "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": { - "description": "The rotation angle of the text, in degrees.", - "maximum": 360, - "minimum": 0, - "type": "number" - }, - "aspect": { - "description": "Whether to keep aspect ratio of image marks.", - "type": "boolean" + "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": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline. 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." + "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`", @@ -1685,8 +3103,15 @@ "type": "number" }, "blend": { - "$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\"`" + "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": [ @@ -1695,9 +3120,12 @@ }, { "$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`." + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - 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`", @@ -1705,36 +3133,103 @@ "type": "number" }, "cornerRadius": { - "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusBottomLeft": { - "description": "The radius in pixels of rounded rectangle bottom left corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusBottomRight": { - "description": "The radius in pixels of rounded rectangle bottom right corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusEnd": { - "description": "- For vertical bars, top-left and top-right corner radius.\n- For horizontal bars, top-right and bottom-right corner radius.", - "type": "number" + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For vertical bars, top-left and top-right corner radius. - For horizontal bars, top-right and bottom-right corner radius." }, "cornerRadiusTopLeft": { - "description": "The radius in pixels of rounded rectangle top right corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusTopRight": { - "description": "The radius in pixels of rounded rectangle top left corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cursor": { - "$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." + "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": { - "$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\"`" + "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": { "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.", @@ -1742,16 +3237,48 @@ "type": "number" }, "dx": { - "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" + "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": { - "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" + "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": { - "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", - "type": "string" + "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": [ @@ -1763,52 +3290,121 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Fill Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { - "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "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": { - "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", - "type": "string" + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontSize": { - "description": "The font size, in pixels.\n\n__Default value:__ `11`", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style (e.g., `\"italic\"`)." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "description": "Height of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "href": { - "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", - "format": "uri", - "type": "string" + "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`." }, "interpolate": { - "$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." + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"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." + }, + { + "$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.", + "description": "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.", "enum": [ "filter", null @@ -1819,22 +3415,50 @@ ] }, "limit": { - "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" + "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": { - "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" - }, - "lineHeight": { - "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", - "type": "number" + "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, - "type": "number" + "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.", @@ -1845,28 +3469,103 @@ }, "orient": { "$ref": "#/definitions/Orientation", - "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould 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\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + "description": "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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "radius": { - "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", - "minimum": 0, - "type": "number" + "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." }, - "shape": { + "radius2": { "anyOf": [ { - "$ref": "#/definitions/SymbolShape" + "type": "number" }, { - "type": "string" + "$ref": "#/definitions/ExprRef" } ], - "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\"`" + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "size": { - "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, - "type": "number" + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__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.", + "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": [ @@ -1878,66 +3577,159 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Stroke Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { - "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`", - "type": "string" + "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": { - "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", - "items": { - "type": "number" - }, - "type": "array" + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeDashOffset": { - "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", - "type": "number" + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeJoin": { - "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`", - "type": "string" + "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": { - "description": "The miter limit at which to bevel a line join.", - "type": "number" + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeOffset": { - "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" + "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": { - "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeWidth": { - "description": "The stroke width, in pixels.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "tension": { - "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", - "type": "number" + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "text": { - "$ref": "#/definitions/Text", - "description": "Placeholder text if the `text` channel is not specified" + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "theta": { - "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark `startAngle` and `endAngle` properties: angles are measured in radians, with `0` indicating \"north\".", - "type": "number" + "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." }, "timeUnitBand": { - "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.\nIf set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "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" }, "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.\nIf set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "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" }, "tooltip": { @@ -1954,15 +3746,36 @@ { "$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`" + "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. - 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.\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": { - "description": "Width of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "x": { "anyOf": [ @@ -1970,10 +3783,11 @@ "type": "number" }, { - "enum": [ - "width" - ], + "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." @@ -1984,10 +3798,11 @@ "type": "number" }, { - "enum": [ - "width" - ], + "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." @@ -1998,10 +3813,11 @@ "type": "number" }, { - "enum": [ - "height" - ], + "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." @@ -2012,10 +3828,11 @@ "type": "number" }, { - "enum": [ - "height" - ], + "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." @@ -2031,116 +3848,286 @@ "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 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." - }, - "angle": { - "description": "Angle in degrees of title and subtitle text.", - "type": "number" - }, - "baseline": { - "$ref": "#/definitions/TextBaseline", - "description": "Vertical text baseline for title and subtitle text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`." - }, - "color": { "anyOf": [ { - "type": "null" + "$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/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Text color for title text." + ] + }, + "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": { - "description": "Delta offset for title and subtitle text x-coordinate.", - "type": "number" + "anyOf": [ + { + "description": "Delta offset for title and subtitle text x-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "dy": { - "description": "Delta offset for title and subtitle text y-coordinate.", - "type": "number" + "anyOf": [ + { + "description": "Delta offset for title and subtitle text y-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "font": { - "description": "Font name for title text.", - "type": "string" + "anyOf": [ + { + "description": "Font name for title text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontSize": { - "description": "Font size in pixels for title text.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "Font size in pixels for title text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "Font style for title text." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for title text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "Font weight for title text.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": [ { - "$ref": "#/definitions/TitleFrame" + "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)." }, { - "type": "string" + "$ref": "#/definitions/ExprRef" } - ], - "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)." + ] }, "limit": { - "description": "The maximum allowed length in pixels of title and subtitle text.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The maximum allowed length in pixels of title and subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "lineHeight": { - "description": "Line height in pixels for multi-line title text.", - "type": "number" + "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": { - "description": "The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.", - "type": "number" + "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": { - "$ref": "#/definitions/TitleOrient", - "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" + "anyOf": [ + { + "$ref": "#/definitions/TitleOrient", + "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "subtitleColor": { "anyOf": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Text color for subtitle text." }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Text color for subtitle text." + ] }, "subtitleFont": { - "description": "Font name for subtitle text.", - "type": "string" + "anyOf": [ + { + "description": "Font name for subtitle text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "subtitleFontSize": { - "description": "Font size in pixels for subtitle text.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "Font size in pixels for subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "subtitleFontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "Font style for subtitle text." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for subtitle text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "subtitleFontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "Font weight for subtitle text.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "description": "Line height in pixels for multi-line subtitle text.", - "type": "number" + "anyOf": [ + { + "description": "Line height in pixels for multi-line subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "subtitlePadding": { - "description": "The padding in pixels between title and subtitle text.", - "type": "number" + "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" @@ -2250,14 +4237,12 @@ "type": "array" } ], - "description": "The output fields at which to write the start and end bin values.\nThis 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.\nIf a single string (e.g., `\"val\"`) is provided, the end field will be `\"val_end\"`." + "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": [ { - "enum": [ - true - ], + "const": true, "type": "boolean" }, { @@ -2288,9 +4273,7 @@ "$ref": "#/definitions/Element" }, "input": { - "enum": [ - "checkbox" - ], + "const": "checkbox", "type": "string" }, "name": { @@ -2355,9 +4338,7 @@ "$ref": "#/definitions/Element" }, "input": { - "enum": [ - "range" - ], + "const": "range", "type": "string" }, "max": { @@ -2422,9 +4403,7 @@ ] }, "BoxPlot": { - "enum": [ - "boxplot" - ], + "const": "boxplot", "type": "string" }, "BoxPlotConfig": { @@ -2436,23 +4415,21 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, "extent": { "anyOf": [ { - "enum": [ - "min-max" - ], + "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`." + "description": "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_).\n\n__Default value:__ `1.5`." }, "median": { "anyOf": [ @@ -2460,7 +4437,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, @@ -2470,7 +4447,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, @@ -2480,7 +4457,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, @@ -2494,7 +4471,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] } @@ -2510,7 +4487,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, @@ -2525,23 +4502,24 @@ }, { "$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`." + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "extent": { "anyOf": [ { - "enum": [ - "min-max" - ], + "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`." + "description": "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_).\n\n__Default value:__ `1.5`." }, "median": { "anyOf": [ @@ -2549,7 +4527,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, @@ -2567,7 +4545,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, @@ -2577,7 +4555,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, @@ -2591,13 +4569,13 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, "type": { "$ref": "#/definitions/BoxPlot", - "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"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": [ @@ -2696,11 +4674,8 @@ } ] }, - "ColorGradientFieldDefWithCondition": { - "$ref": "#/definitions/FieldDefWithCondition" - }, - "ColorGradientValueWithCondition": { - "$ref": "#/definitions/ValueWithCondition" + "ColorDef": { + "$ref": "#/definitions/MarkPropDef<(Gradient|string|null)>" }, "ColorName": { "enum": [ @@ -2877,16 +4852,24 @@ "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/ColorGradientFieldDefWithCondition" + "$ref": "#/definitions/StringFieldDefWithCondition" }, { - "$ref": "#/definitions/ColorGradientValueWithCondition" + "$ref": "#/definitions/StringValueDefWithCondition" } ], - "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"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)'s `color` property.\n\n_Note:_\n1) 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.\n2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + "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": [ @@ -2900,29 +4883,15 @@ "type": "array" } ], - "description": "Additional levels of detail for grouping data in aggregate views and\nin line, trail, and area marks without mapping data to a specific visual channel." + "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": { - "anyOf": [ - { - "$ref": "#/definitions/ColorGradientFieldDefWithCondition" - }, - { - "$ref": "#/definitions/ColorGradientValueWithCondition" - } - ], - "description": "Fill color of the marks.\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'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." + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueWithCondition" - } - ], - "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)'s `fillOpacity` property." + "$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": [ @@ -2930,7 +4899,7 @@ "$ref": "#/definitions/StringFieldDefWithCondition" }, { - "$ref": "#/definitions/StringValueWithCondition" + "$ref": "#/definitions/StringValueDefWithCondition" } ], "description": "A URL to load upon mouse click." @@ -2940,59 +4909,24 @@ "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": { - "anyOf": [ - { - "$ref": "#/definitions/LatLongFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], + "$ref": "#/definitions/LatLongDef", "description": "Latitude position of geographically projected marks." }, "latitude2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], + "$ref": "#/definitions/Position2Def", "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." }, "longitude": { - "anyOf": [ - { - "$ref": "#/definitions/LatLongFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], + "$ref": "#/definitions/LatLongDef", "description": "Longitude position of geographically projected marks." }, "longitude2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], + "$ref": "#/definitions/Position2Def", "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." }, "opacity": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueWithCondition" - } - ], - "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)'s `opacity` property." + "$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": [ @@ -3006,95 +4940,62 @@ "type": "array" }, { - "$ref": "#/definitions/NumberValueDef" + "$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." + "description": "Order of the marks. - For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#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](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. - 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": { - "anyOf": [ - { - "$ref": "#/definitions/ShapeFieldDefWithCondition" - }, - { - "$ref": "#/definitions/ShapeValueWithCondition" - } - ], - "description": "Shape of the mark.\n\n1. For `point` marks the 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\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.)" + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueWithCondition" - } - ], - "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)" + "$ref": "#/definitions/NumericMarkPropDef", + "description": "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": { - "anyOf": [ - { - "$ref": "#/definitions/ColorGradientFieldDefWithCondition" - }, - { - "$ref": "#/definitions/ColorGradientValueWithCondition" - } - ], - "description": "Stroke color of the marks.\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'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." + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/NumericArrayFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericArrayValueDefWithCondition" - } - ], + "$ref": "#/definitions/NumericArrayMarkPropDef", "description": "Stroke dash of the marks.\n\n__Default value:__ `[1,0]` (No dash)." }, "strokeOpacity": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueWithCondition" - } - ], - "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)'s `strokeOpacity` property." + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueWithCondition" - } - ], - "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)'s `strokeWidth` property." + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/TextFieldDefWithCondition" - }, - { - "$ref": "#/definitions/TextValueWithCondition" - } - ], + "$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/StringValueWithCondition" + "$ref": "#/definitions/StringValueDefWithCondition" }, { "items": { @@ -3114,31 +5015,17 @@ "$ref": "#/definitions/StringFieldDefWithCondition" }, { - "$ref": "#/definitions/StringValueWithCondition" + "$ref": "#/definitions/StringValueDefWithCondition" } ], "description": "The URL of an image mark." }, "x": { - "anyOf": [ - { - "$ref": "#/definitions/PositionFieldDef" - }, - { - "$ref": "#/definitions/XValueDef" - } - ], + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/XValueDef" - } - ], + "$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": { @@ -3147,7 +5034,7 @@ "$ref": "#/definitions/SecondaryFieldDef" }, { - "$ref": "#/definitions/NumberValueDef" + "$ref": "#/definitions/ValueDef" } ], "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." @@ -3158,31 +5045,17 @@ "$ref": "#/definitions/SecondaryFieldDef" }, { - "$ref": "#/definitions/NumberValueDef" + "$ref": "#/definitions/ValueDef" } ], "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, "y": { - "anyOf": [ - { - "$ref": "#/definitions/PositionFieldDef" - }, - { - "$ref": "#/definitions/YValueDef" - } - ], + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/YValueDef" - } - ], + "$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": { @@ -3191,7 +5064,7 @@ "$ref": "#/definitions/SecondaryFieldDef" }, { - "$ref": "#/definitions/NumberValueDef" + "$ref": "#/definitions/ValueDef" } ], "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." @@ -3202,7 +5075,7 @@ "$ref": "#/definitions/SecondaryFieldDef" }, { - "$ref": "#/definitions/NumberValueDef" + "$ref": "#/definitions/ValueDef" } ], "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." @@ -3240,7 +5113,7 @@ "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\n`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`).", + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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": { @@ -3250,23 +5123,23 @@ }, "type": "object" }, - "ConditionalMarkPropFieldDef": { + "ConditionalMarkPropFieldOrDatumDef": { "anyOf": [ { - "$ref": "#/definitions/ConditionalPredicate" + "$ref": "#/definitions/ConditionalPredicate" }, { - "$ref": "#/definitions/ConditionalSelection" + "$ref": "#/definitions/ConditionalSelection" } ] }, - "ConditionalMarkPropFieldDef": { + "ConditionalMarkPropFieldOrDatumDef": { "anyOf": [ { - "$ref": "#/definitions/ConditionalPredicate>" + "$ref": "#/definitions/ConditionalPredicate>" }, { - "$ref": "#/definitions/ConditionalSelection>" + "$ref": "#/definitions/ConditionalSelection>" } ] }, @@ -3280,63 +5153,73 @@ } ] }, - "ConditionalValueDef<(Gradient|string|null)>": { + "ConditionalValueDef<(Gradient|string|null|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalValueDef<(Text|ExprRef)>": { "anyOf": [ { - "$ref": "#/definitions/ConditionalPredicate>" + "$ref": "#/definitions/ConditionalPredicate>" }, { - "$ref": "#/definitions/ConditionalSelection>" + "$ref": "#/definitions/ConditionalSelection>" } ] }, - "ConditionalStringValueDef": { + "ConditionalValueDef<(number[]|ExprRef)>": { "anyOf": [ { - "$ref": "#/definitions/ConditionalPredicate" + "$ref": "#/definitions/ConditionalPredicate>" }, { - "$ref": "#/definitions/ConditionalSelection" + "$ref": "#/definitions/ConditionalSelection>" } ] }, - "ConditionalValueDef": { + "ConditionalValueDef<(number|ExprRef)>": { "anyOf": [ { - "$ref": "#/definitions/ConditionalPredicate>" + "$ref": "#/definitions/ConditionalPredicate>" }, { - "$ref": "#/definitions/ConditionalSelection>" + "$ref": "#/definitions/ConditionalSelection>" } ] }, - "ConditionalNumberValueDef": { + "ConditionalValueDef<(string|ExprRef)>": { "anyOf": [ { - "$ref": "#/definitions/ConditionalPredicate" + "$ref": "#/definitions/ConditionalPredicate>" }, { - "$ref": "#/definitions/ConditionalSelection" + "$ref": "#/definitions/ConditionalSelection>" } ] }, - "ConditionalValueDef": { + "ConditionalValueDef<(string|null|ExprRef)>": { "anyOf": [ { - "$ref": "#/definitions/ConditionalPredicate>" + "$ref": "#/definitions/ConditionalPredicate>" }, { - "$ref": "#/definitions/ConditionalSelection>" + "$ref": "#/definitions/ConditionalSelection>" } ] }, - "ConditionalValueDef": { + "ConditionalValueDef": { "anyOf": [ { - "$ref": "#/definitions/ConditionalPredicate>" + "$ref": "#/definitions/ConditionalPredicate>" }, { - "$ref": "#/definitions/ConditionalSelection>" + "$ref": "#/definitions/ConditionalSelection>" } ] }, @@ -3362,692 +5245,1303 @@ "$ref": "#/definitions/ConditionalAxisProperty<(number[]|null)>" }, "ConditionalAxisProperty<(Align|null)>": { - "additionalProperties": false, - "properties": { - "condition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate>" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "items": { - "$ref": "#/definitions/ConditionalPredicate>" - }, - "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" }, - "value": { - "anyOf": [ - { - "$ref": "#/definitions/Align" + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "type": "null" + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" } + }, + "required": [ + "condition", + "expr" ], - "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" } - }, - "required": [ - "condition", - "value" - ], - "type": "object" + ] }, "ConditionalAxisProperty<(Color|null)>": { - "additionalProperties": false, - "properties": { - "condition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate>" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "items": { - "$ref": "#/definitions/ConditionalPredicate>" - }, - "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" }, - "value": { - "anyOf": [ - { - "$ref": "#/definitions/Color" + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "type": "null" + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" } + }, + "required": [ + "condition", + "expr" ], - "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" } - }, - "required": [ - "condition", - "value" - ], - "type": "object" + ] }, "ConditionalAxisProperty<(FontStyle|null)>": { - "additionalProperties": false, - "properties": { - "condition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate>" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "items": { - "$ref": "#/definitions/ConditionalPredicate>" - }, - "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" }, - "value": { - "anyOf": [ - { - "$ref": "#/definitions/FontStyle" + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "type": "null" + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" } + }, + "required": [ + "condition", + "expr" ], - "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" } - }, - "required": [ - "condition", - "value" - ], - "type": "object" + ] }, "ConditionalAxisProperty<(FontWeight|null)>": { - "additionalProperties": false, - "properties": { - "condition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate>" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "items": { - "$ref": "#/definitions/ConditionalPredicate>" - }, - "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" }, - "value": { - "anyOf": [ - { - "$ref": "#/definitions/FontWeight" + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "type": "null" + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" } + }, + "required": [ + "condition", + "expr" ], - "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" } - }, - "required": [ - "condition", - "value" - ], - "type": "object" + ] }, "ConditionalAxisProperty<(TextBaseline|null)>": { - "additionalProperties": false, - "properties": { - "condition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate>" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "items": { - "$ref": "#/definitions/ConditionalPredicate>" - }, - "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" }, - "value": { - "anyOf": [ - { - "$ref": "#/definitions/TextBaseline" + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "type": "null" + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" } + }, + "required": [ + "condition", + "expr" ], - "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" } - }, - "required": [ - "condition", - "value" - ], - "type": "object" + ] }, "ConditionalAxisProperty<(number[]|null)>": { - "additionalProperties": false, - "properties": { - "condition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate>" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "items": { - "$ref": "#/definitions/ConditionalPredicate>" - }, - "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" }, - "value": { - "anyOf": [ - { - "items": { - "type": "number" - }, - "type": "array" + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "type": "null" + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" } + }, + "required": [ + "condition", + "expr" ], - "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" } - }, - "required": [ - "condition", - "value" - ], - "type": "object" + ] }, "ConditionalAxisProperty<(number|null)>": { - "additionalProperties": false, - "properties": { - "condition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate>" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "items": { - "$ref": "#/definitions/ConditionalPredicate>" - }, - "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" }, - "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" - ] + { + "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" } - }, - "required": [ - "condition", - "value" - ], - "type": "object" + ] }, "ConditionalAxisProperty<(string|null)>": { - "additionalProperties": false, - "properties": { - "condition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate" + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" + }, + "type": "array" + } + ] }, - { - "items": { - "$ref": "#/definitions/ConditionalPredicate" - }, - "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" }, - "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" - ] + { + "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" } - }, - "required": [ - "condition", - "value" - ], - "type": "object" + ] }, "ConditionalAxisString": { "$ref": "#/definitions/ConditionalAxisProperty<(string|null)>" }, - "ConditionalPredicate": { - "additionalProperties": false, - "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." - }, - "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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." - }, - "legend": { - "anyOf": [ - { - "$ref": "#/definitions/Legend" + "ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" }, - { - "type": "null" + "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" ], - "description": "An object defining properties of the legend.\nIf `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." + "type": "object" }, - "scale": { - "anyOf": [ - { - "$ref": "#/definitions/Scale" + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" }, - { - "type": "null" + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" } + }, + "required": [ + "expr", + "test" ], - "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" + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" }, - { - "$ref": "#/definitions/TimeUnitParams" + "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" ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "type": "object" }, - "title": { - "anyOf": [ - { - "$ref": "#/definitions/Text" + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" }, - { - "type": "null" + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" } + }, + "required": [ + "expr", + "test" ], - "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/docs/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 encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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" } - }, - "required": [ - "test", - "type" - ], - "type": "object" + ] }, - "ConditionalPredicate>": { - "additionalProperties": false, - "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." - }, - "bin": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/BinParams" + "ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" }, - { - "type": "null" + "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" ], - "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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "type": "object" }, - "legend": { - "anyOf": [ - { - "$ref": "#/definitions/Legend" + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" }, - { - "type": "null" + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" } + }, + "required": [ + "expr", + "test" ], - "description": "An object defining properties of the legend.\nIf `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": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" }, - { - "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" + "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" ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "type": "object" }, - "title": { - "anyOf": [ - { - "$ref": "#/definitions/Text" + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" }, - { - "type": "null" + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" } + }, + "required": [ + "expr", + "test" ], - "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/docs/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 encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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" } - }, - "required": [ - "test", - "type" - ], - "type": "object" + ] }, - "ConditionalPredicate": { - "additionalProperties": false, - "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." - }, - "bin": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/BinParams" + "ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" }, - { - "enum": [ - "binned" + "value": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "type": "null" + } ], - "type": "string" - }, - { - "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" ], - "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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "type": "object" }, - "format": { - "anyOf": [ - { + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" }, - { - "type": "object" + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" } + }, + "required": [ + "expr", + "test" ], - "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/usage/compile.html#format-type) that takes `datum.value` and format parameter as input), this property represents the format parameter.\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 (`\"number\"` or `\"time\"` or a [registered custom format type](https://vega.github.io/vega-lite/usage/compile.html#format-type)).\n\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", - "type": "string" - }, - "labelExpr": { - "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" - }, - "test": { - "$ref": "#/definitions/PredicateComposition", - "description": "Predicate for triggering the condition" - }, - "timeUnit": { - "anyOf": [ - { - "$ref": "#/definitions/TimeUnit" + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" }, - { - "$ref": "#/definitions/TimeUnitParams" + "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" ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "type": "object" }, - "title": { - "anyOf": [ - { - "$ref": "#/definitions/Text" + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" }, - { - "type": "null" + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" } + }, + "required": [ + "expr", + "test" ], - "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/docs/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 encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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" } - }, - "required": [ - "test", - "type" - ], - "type": "object" + ] }, - "ConditionalPredicate>": { - "additionalProperties": false, - "properties": { - "test": { - "$ref": "#/definitions/PredicateComposition", - "description": "Predicate for triggering the condition" - }, - "value": { - "anyOf": [ - { - "$ref": "#/definitions/Align" + "ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" }, - { - "type": "null" + "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" ], - "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" + "type": "object" }, - "value": { - "anyOf": [ - { - "$ref": "#/definitions/Color" + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" }, - { - "type": "null" + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" } + }, + "required": [ + "expr", + "test" ], - "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" } - }, - "required": [ - "test", - "value" - ], - "type": "object" + ] }, - "ConditionalPredicate>": { - "additionalProperties": false, - "properties": { - "test": { - "$ref": "#/definitions/PredicateComposition", - "description": "Predicate for triggering the condition" + "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" }, - "value": { - "anyOf": [ - { - "$ref": "#/definitions/FontStyle" + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" }, - { - "type": "null" + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" } + }, + "required": [ + "expr", + "test" ], - "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" } - }, - "required": [ - "test", - "value" - ], - "type": "object" + ] }, - "ConditionalPredicate>": { - "additionalProperties": false, - "properties": { - "test": { - "$ref": "#/definitions/PredicateComposition", - "description": "Predicate for triggering the condition" + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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" }, - "value": { - "anyOf": [ - { - "$ref": "#/definitions/FontWeight" + { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, - { - "type": "null" + "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" + }, + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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" ], - "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" } - }, - "required": [ - "test", - "value" - ], - "type": "object" + ] }, - "ConditionalPredicate>": { - "additionalProperties": false, - "properties": { - "test": { - "$ref": "#/definitions/PredicateComposition", - "description": "Predicate for triggering the condition" + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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" }, - "value": { - "anyOf": [ - { - "$ref": "#/definitions/Gradient" + { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, - { - "type": "string" + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." }, - { - "type": "null" + "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" + }, + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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" ], - "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" } - }, - "required": [ - "test", - "value" - ], - "type": "object" + ] }, - "ConditionalPredicate>": { + "ConditionalPredicate": { "additionalProperties": false, "properties": { - "test": { - "$ref": "#/definitions/PredicateComposition", - "description": "Predicate for triggering the condition" + "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." }, - "value": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { "anyOf": [ { - "$ref": "#/definitions/TextBaseline" + "type": "boolean" }, { - "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)." - } + "$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). - 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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" + }, + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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", - "value" + "test" ], "type": "object" }, - "ConditionalPredicate>": { + "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { @@ -4057,13 +6551,16 @@ "value": { "anyOf": [ { - "items": { - "type": "number" - }, - "type": "array" + "$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)." @@ -4075,7 +6572,7 @@ ], "type": "object" }, - "ConditionalPredicate>": { + "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { @@ -4083,11 +6580,15 @@ "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" - ] + "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": [ @@ -4096,7 +6597,7 @@ ], "type": "object" }, - "ConditionalPredicate": { + "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { @@ -4104,11 +6605,18 @@ "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" - ] + "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": [ @@ -4117,7 +6625,7 @@ ], "type": "object" }, - "ConditionalPredicate>": { + "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { @@ -4125,7 +6633,14 @@ "description": "Predicate for triggering the condition" }, "value": { - "$ref": "#/definitions/Text", + "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)." } }, @@ -4135,7 +6650,7 @@ ], "type": "object" }, - "ConditionalPredicate": { + "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { @@ -4143,8 +6658,15 @@ "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" + "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": [ @@ -4153,7 +6675,7 @@ ], "type": "object" }, - "ConditionalPredicate>": { + "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { @@ -4161,11 +6683,18 @@ "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).", - "items": { - "type": "number" - }, - "type": "array" + "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": [ @@ -4174,7 +6703,7 @@ ], "type": "object" }, - "ConditionalPredicate>": { + "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { @@ -4183,7 +6712,7 @@ }, "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" + "type": "number" } }, "required": [ @@ -4192,188 +6721,336 @@ ], "type": "object" }, - "ConditionalSelection": { - "additionalProperties": false, - "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." - }, - "bin": { - "anyOf": [ - { - "type": "boolean" + "ConditionalSelection": { + "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." }, - { - "$ref": "#/definitions/BinParams" + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, - { - "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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." - }, - "legend": { - "anyOf": [ - { - "$ref": "#/definitions/Legend" + "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." }, - { - "type": "null" - } - ], - "description": "An object defining properties of the legend.\nIf `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" + "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`." }, - { - "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." - }, - "selection": { - "$ref": "#/definitions/SelectionComposition", - "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." - }, - "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" + "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." }, - { - "$ref": "#/definitions/TimeUnitParams" - } - ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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" + "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." }, - { - "type": "null" + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ + "selection" ], - "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/docs/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" }, - "type": { - "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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": [ - "selection", - "type" - ], - "type": "object" - }, - "ConditionalSelection>": { - "additionalProperties": false, - "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." - }, - "bin": { - "anyOf": [ - { - "type": "boolean" + { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, - { - "$ref": "#/definitions/BinParams" + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." }, - { - "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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." - }, - "legend": { - "anyOf": [ - { - "$ref": "#/definitions/Legend" + "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." }, - { - "type": "null" - } - ], - "description": "An object defining properties of the legend.\nIf `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" + "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." }, - { - "type": "null" + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ + "selection" ], - "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." - }, - "selection": { - "$ref": "#/definitions/SelectionComposition", - "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." - }, - "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" + "type": "object" + } + ] + }, + "ConditionalSelection>": { + "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." }, - { - "$ref": "#/definitions/TimeUnitParams" + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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." + }, + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ + "selection" ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "type": "object" }, - "title": { - "anyOf": [ - { - "$ref": "#/definitions/Text" + { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, - { - "type": "null" + "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." + }, + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ + "selection" ], - "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/docs/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 encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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" } - }, - "required": [ - "selection", - "type" - ], - "type": "object" + ] }, "ConditionalSelection": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, "bin": { "anyOf": [ @@ -4384,9 +7061,7 @@ "$ref": "#/definitions/BinParams" }, { - "enum": [ - "binned" - ], + "const": "binned", "type": "string" }, { @@ -4397,7 +7072,7 @@ }, "field": { "$ref": "#/definitions/Field", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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": [ @@ -4405,13 +7080,13 @@ "type": "string" }, { - "type": "object" + "$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/usage/compile.html#format-type) that takes `datum.value` and format parameter as input), this property represents the format parameter.\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." + "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). - 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 (`\"number\"` or `\"time\"` or a [registered custom format type](https://vega.github.io/vega-lite/usage/compile.html#format-type)).\n\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "labelExpr": { @@ -4431,7 +7106,7 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "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": [ @@ -4446,16 +7121,15 @@ }, "type": { "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "selection", - "type" + "selection" ], "type": "object" }, - "ConditionalSelection>": { + "ConditionalSelection>": { "additionalProperties": false, "properties": { "selection": { @@ -4472,6 +7146,9 @@ }, { "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)." @@ -4483,7 +7160,7 @@ ], "type": "object" }, - "ConditionalSelection": { + "ConditionalSelection>": { "additionalProperties": false, "properties": { "selection": { @@ -4491,11 +7168,15 @@ "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." }, "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" - ] + "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": [ @@ -4504,7 +7185,7 @@ ], "type": "object" }, - "ConditionalSelection>": { + "ConditionalSelection>": { "additionalProperties": false, "properties": { "selection": { @@ -4512,7 +7193,17 @@ "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." }, "value": { - "$ref": "#/definitions/Text", + "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)." } }, @@ -4522,7 +7213,7 @@ ], "type": "object" }, - "ConditionalSelection": { + "ConditionalSelection>": { "additionalProperties": false, "properties": { "selection": { @@ -4530,17 +7221,24 @@ "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." }, "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": [ - "selection", - "value" - ], - "type": "object" + "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": [ + "selection", + "value" + ], + "type": "object" }, - "ConditionalSelection>": { + "ConditionalSelection>": { "additionalProperties": false, "properties": { "selection": { @@ -4548,11 +7246,43 @@ "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." }, "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).", - "items": { - "type": "number" - }, - "type": "array" + "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": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection>": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "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": [ @@ -4561,7 +7291,7 @@ ], "type": "object" }, - "ConditionalSelection>": { + "ConditionalSelection>": { "additionalProperties": false, "properties": { "selection": { @@ -4570,7 +7300,7 @@ }, "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" + "type": "number" } }, "required": [ @@ -4582,10 +7312,18 @@ "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": [ { @@ -4595,7 +7333,7 @@ "$ref": "#/definitions/AutoSizeParams" } ], - "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + "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", @@ -4686,7 +7424,14 @@ "description": "Config for y-temporal axes." }, "background": { - "$ref": "#/definitions/Color", + "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": { @@ -4709,6 +7454,10 @@ "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" @@ -4722,7 +7471,7 @@ "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\").", + "description": "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\").", "enum": [ "verbal", "functional", @@ -4767,8 +7516,15 @@ "description": "Line-Specific Config" }, "lineBreak": { - "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.", - "type": "string" + "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." }, "mark": { "$ref": "#/definitions/MarkConfig", @@ -4779,8 +7535,22 @@ "type": "string" }, "padding": { - "$ref": "#/definitions/Padding", - "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.\nIf 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`" + "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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" }, "point": { "$ref": "#/definitions/MarkConfig", @@ -4792,7 +7562,7 @@ }, "range": { "$ref": "#/definitions/RangeConfig", - "description": "An object hash that defines default range arrays or schemes for using with scales.\nFor 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)." + "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", @@ -4827,7 +7597,7 @@ "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\"`\n__Note:__ Axes automatically determine the format for each label automatically so this config does not affect axes.", + "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": { @@ -4857,10 +7627,10 @@ "type": "null" } ], - "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data.\nAlternatively, 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)).\nFor 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).\nFor 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)" + "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.\nIf no extension is detected, `\"json\"` will be used by default.", + "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" @@ -4962,7 +7732,7 @@ }, "DateTime": { "additionalProperties": false, - "description": "Object for defining datetime in Vega-Lite Filter.\nIf both month and quarter are provided, month has higher precedence.\n`day` cannot be combined with other date.\nWe accept string for month and day names.", + "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.", @@ -4979,23 +7749,23 @@ "type": "string" } ], - "description": "Value representing the day of a week. This can be one of:\n(1) integer value -- `1` represents Monday;\n(2) case-insensitive day name (e.g., `\"Monday\"`);\n(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`." + "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": 23, + "maximum": 24, "minimum": 0, "type": "number" }, "milliseconds": { "description": "Integer value representing the millisecond segment of time.", - "maximum": 999, + "maximum": 1000, "minimum": 0, "type": "number" }, "minutes": { "description": "Integer value representing the minute segment of time from 0-59.", - "maximum": 59, + "maximum": 60, "minimum": 0, "type": "number" }, @@ -5008,7 +7778,7 @@ "type": "string" } ], - "description": "One of:\n(1) integer value representing the month from `1`-`12`. `1` represents January;\n(2) case-insensitive month name (e.g., `\"January\"`);\n(3) case-insensitive, 3-character short month name (e.g., `\"Jan\"`)." + "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).", @@ -5018,7 +7788,7 @@ }, "seconds": { "description": "Integer value representing the second segment (0-59) of a time value", - "maximum": 59, + "maximum": 60, "minimum": 0, "type": "number" }, @@ -5033,6 +7803,39 @@ }, "type": "object" }, + "DatumDef": { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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." + }, + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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, @@ -5174,6 +7977,11 @@ }, "type": "object" }, + "Dict": { + "additionalProperties": { + }, + "type": "object" + }, "Diverging": { "enum": [ "blueorange", @@ -5309,7 +8117,7 @@ "type": "array" } ], - "description": "Customized domain values to be union with the field's values.\n\n1) `domain` for _quantitative_ fields can take one of the following forms:\n\n- a two-element array with minimum and maximum values.\n- an array with more than two entries, for [Piecewise quantitative scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise). (Alternatively, the `domainMid` property can be set for a diverging scale.)\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) `domain` for _temporal_ fields can be a two-element array 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) `domain` for _ordinal_ and _nominal_ fields can be an array that lists valid input values." + "description": "Customized domain values to be union with the field's values.\n\n1) `domain` for _quantitative_ fields can take one of the following forms:\n\n- a two-element array with minimum and maximum values. - an array with more than two entries, for [Piecewise quantitative scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise). (Alternatively, the `domainMid` property can be set for a diverging scale.) - 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) `domain` for _temporal_ fields can be a two-element array 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) `domain` for _ordinal_ and _nominal_ fields can be an array that lists valid input values." } }, "required": [ @@ -5335,13 +8143,11 @@ "type": "null" } ], - "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data.\nAlternatively, 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)).\nFor 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).\nFor 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)" + "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.\nIf no extension is detected, `\"json\"` will be used by default.", - "enum": [ - "dsv" - ], + "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" } }, @@ -5363,7 +8169,7 @@ }, "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\"`).\nAn aggregation is required when there are multiple values of the sort field for each encoded data field.\nThe 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\"`." + "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": [ @@ -5389,7 +8195,7 @@ }, "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\"`).\nAn aggregation is required when there are multiple values of the sort field for each encoded data field.\nThe 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\"`." + "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": [ @@ -5406,9 +8212,7 @@ "type": "object" }, "ErrorBand": { - "enum": [ - "errorband" - ], + "const": "errorband", "type": "string" }, "ErrorBandConfig": { @@ -5420,7 +8224,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, @@ -5430,17 +8234,17 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$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\"`." + "description": "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.\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." + "description": "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": { "description": "The tension parameter for the interpolation type of the error band.", @@ -5460,7 +8264,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, @@ -5470,7 +8274,7 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$ref": "#/definitions/MarkConfig" } ] }, @@ -5485,17 +8289,20 @@ }, { "$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`." + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - 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\"`." + "description": "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.\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." + "description": "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": { "description": "The opacity (value between [0,1]) of the mark.", @@ -5513,7 +8320,7 @@ }, "type": { "$ref": "#/definitions/ErrorBand", - "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"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": [ @@ -5522,9 +8329,7 @@ "type": "object" }, "ErrorBar": { - "enum": [ - "errorbar" - ], + "const": "errorbar", "type": "string" }, "ErrorBarConfig": { @@ -5532,7 +8337,7 @@ "properties": { "extent": { "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + "description": "The extent of the rule. Available options include: - `\"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.\n\n__Default value:__ `\"stderr\"`." }, "rule": { "anyOf": [ @@ -5540,17 +8345,25 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$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" + "$ref": "#/definitions/MarkConfig" } ] } @@ -5571,13 +8384,16 @@ }, { "$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`." + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - 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\"`." + "description": "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.\n\n__Default value:__ `\"stderr\"`." }, "opacity": { "description": "The opacity (value between [0,1]) of the mark.", @@ -5593,23 +8409,31 @@ "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" + "$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" + "$ref": "#/definitions/MarkConfig" } ] }, "type": { "$ref": "#/definitions/ErrorBar", - "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"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": [ @@ -5716,9 +8540,7 @@ "$ref": "#/definitions/MarkType" }, "source": { - "enum": [ - "window" - ], + "const": "window", "type": "string" }, "throttle": { @@ -5763,12 +8585,28 @@ "Expr": { "type": "string" }, + "ExprOrSignalRef": { + "$ref": "#/definitions/ExprRef" + }, + "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\n(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." + "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": [ @@ -5779,7 +8617,13 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The alignment to apply to grid rows and columns.\nThe 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\"`." + "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. - 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.\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\"`." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, "bin": { "anyOf": [ @@ -5796,7 +8640,7 @@ "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\"`", + "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. - 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" @@ -5815,12 +8659,12 @@ "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\n`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`).", + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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": { "$ref": "#/definitions/Header", @@ -5841,7 +8685,7 @@ "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`." + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." }, "spacing": { "anyOf": [ @@ -5852,7 +8696,7 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent 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)" + "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": [ @@ -5863,7 +8707,7 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "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": [ @@ -5878,12 +8722,9 @@ }, "type": { "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "type" - ], "type": "object" }, "FacetFieldDef": { @@ -5891,7 +8732,13 @@ "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, "bin": { "anyOf": [ @@ -5909,7 +8756,7 @@ }, "field": { "$ref": "#/definitions/Field", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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": { "$ref": "#/definitions/Header", @@ -5930,7 +8777,7 @@ "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`." + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." }, "timeUnit": { "anyOf": [ @@ -5941,7 +8788,7 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "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": [ @@ -5956,12 +8803,9 @@ }, "type": { "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "type" - ], "type": "object" }, "FacetFieldDef": { @@ -5969,7 +8813,13 @@ "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, "bin": { "anyOf": [ @@ -5987,7 +8837,7 @@ }, "field": { "$ref": "#/definitions/FieldName", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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": { "$ref": "#/definitions/Header", @@ -6008,7 +8858,7 @@ "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`." + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." }, "timeUnit": { "anyOf": [ @@ -6019,7 +8869,7 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "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": [ @@ -6034,12 +8884,9 @@ }, "type": { "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "type" - ], "type": "object" }, "FacetMapping": { @@ -6073,20 +8920,28 @@ "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/ColorGradientFieldDefWithCondition" + "$ref": "#/definitions/StringFieldDefWithCondition" }, { - "$ref": "#/definitions/ColorGradientValueWithCondition" + "$ref": "#/definitions/StringValueDefWithCondition" } ], - "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"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)'s `color` property.\n\n_Note:_\n1) 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.\n2) 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": "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": [ @@ -6100,33 +8955,19 @@ "type": "array" } ], - "description": "Additional levels of detail for grouping data in aggregate views and\nin line, trail, and area marks without mapping data to a specific visual channel." + "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": { - "anyOf": [ - { - "$ref": "#/definitions/ColorGradientFieldDefWithCondition" - }, - { - "$ref": "#/definitions/ColorGradientValueWithCondition" - } - ], - "description": "Fill color of the marks.\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'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." + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueWithCondition" - } - ], - "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)'s `fillOpacity` property." + "$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": [ @@ -6134,7 +8975,7 @@ "$ref": "#/definitions/StringFieldDefWithCondition" }, { - "$ref": "#/definitions/StringValueWithCondition" + "$ref": "#/definitions/StringValueDefWithCondition" } ], "description": "A URL to load upon mouse click." @@ -6144,59 +8985,24 @@ "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": { - "anyOf": [ - { - "$ref": "#/definitions/LatLongFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], + "$ref": "#/definitions/LatLongDef", "description": "Latitude position of geographically projected marks." }, "latitude2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], + "$ref": "#/definitions/Position2Def", "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." }, "longitude": { - "anyOf": [ - { - "$ref": "#/definitions/LatLongFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], + "$ref": "#/definitions/LatLongDef", "description": "Longitude position of geographically projected marks." }, "longitude2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], + "$ref": "#/definitions/Position2Def", "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." }, "opacity": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueWithCondition" - } - ], - "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)'s `opacity` property." + "$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": [ @@ -6210,99 +9016,66 @@ "type": "array" }, { - "$ref": "#/definitions/NumberValueDef" + "$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." + "description": "Order of the marks. - For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#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](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. - 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": { - "anyOf": [ - { - "$ref": "#/definitions/ShapeFieldDefWithCondition" - }, - { - "$ref": "#/definitions/ShapeValueWithCondition" - } - ], - "description": "Shape of the mark.\n\n1. For `point` marks the 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\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.)" + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueWithCondition" - } - ], - "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)" + "$ref": "#/definitions/NumericMarkPropDef", + "description": "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": { - "anyOf": [ - { - "$ref": "#/definitions/ColorGradientFieldDefWithCondition" - }, - { - "$ref": "#/definitions/ColorGradientValueWithCondition" - } - ], - "description": "Stroke color of the marks.\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'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." + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/NumericArrayFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericArrayValueDefWithCondition" - } - ], + "$ref": "#/definitions/NumericArrayMarkPropDef", "description": "Stroke dash of the marks.\n\n__Default value:__ `[1,0]` (No dash)." }, "strokeOpacity": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueWithCondition" - } - ], - "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)'s `strokeOpacity` property." + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueWithCondition" - } - ], - "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)'s `strokeWidth` property." + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/TextFieldDefWithCondition" - }, - { - "$ref": "#/definitions/TextValueWithCondition" - } - ], + "$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/StringValueWithCondition" + "$ref": "#/definitions/StringValueDefWithCondition" }, { "items": { @@ -6322,31 +9095,17 @@ "$ref": "#/definitions/StringFieldDefWithCondition" }, { - "$ref": "#/definitions/StringValueWithCondition" + "$ref": "#/definitions/StringValueDefWithCondition" } ], "description": "The URL of an image mark." }, "x": { - "anyOf": [ - { - "$ref": "#/definitions/PositionFieldDef" - }, - { - "$ref": "#/definitions/XValueDef" - } - ], + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/XValueDef" - } - ], + "$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": { @@ -6355,7 +9114,7 @@ "$ref": "#/definitions/SecondaryFieldDef" }, { - "$ref": "#/definitions/NumberValueDef" + "$ref": "#/definitions/ValueDef" } ], "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." @@ -6366,31 +9125,17 @@ "$ref": "#/definitions/SecondaryFieldDef" }, { - "$ref": "#/definitions/NumberValueDef" + "$ref": "#/definitions/ValueDef" } ], "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, "y": { - "anyOf": [ - { - "$ref": "#/definitions/PositionFieldDef" - }, - { - "$ref": "#/definitions/YValueDef" - } - ], + "$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": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/YValueDef" - } - ], + "$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": { @@ -6399,7 +9144,7 @@ "$ref": "#/definitions/SecondaryFieldDef" }, { - "$ref": "#/definitions/NumberValueDef" + "$ref": "#/definitions/ValueDef" } ], "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." @@ -6410,7 +9155,7 @@ "$ref": "#/definitions/SecondaryFieldDef" }, { - "$ref": "#/definitions/NumberValueDef" + "$ref": "#/definitions/ValueDef" } ], "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." @@ -6422,14 +9167,36 @@ "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. - 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.\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\"`", + "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. - 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": [ { @@ -6455,20 +9222,18 @@ "type": "number" }, { - "enum": [ - "container" - ], + "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." + "description": "The height of a visualization.\n\n- 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\"`.\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\"`,\n`\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + "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.", @@ -6476,7 +9241,7 @@ }, "projection": { "$ref": "#/definitions/Projection", - "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks\nand to `latitude` and `\"longitude\"` channels for other marks." + "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", @@ -6489,6 +9254,17 @@ "description": "A key-value mapping between selection names and definitions.", "type": "object" }, + "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": [ { @@ -6517,16 +9293,14 @@ "type": "number" }, { - "enum": [ - "container" - ], + "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:__\nBased 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." + "description": "The width of a visualization.\n\n- 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\"`.\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": [ @@ -6544,237 +9318,261 @@ } ] }, - "FieldDefWithCondition": { + "FieldDefWithoutScale": { + "$ref": "#/definitions/TypedFieldDef", + "description": "Field Def without scale (and without bin: \"binned\" support)." + }, + "FieldEqualPredicate": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." - }, - "bin": { + "equal": { "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, { "type": "boolean" }, { - "$ref": "#/definitions/BinParams" + "$ref": "#/definitions/DateTime" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } ], - "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": { - "$ref": "#/definitions/ValueCondition<(Gradient|string|null)>", - "description": "One or more value definition(s) with [a selection 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)\nsince Vega-Lite only allows at most one encoded field per encoding channel." + "description": "The value that the field should be equal to." }, "field": { - "$ref": "#/definitions/Field", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." }, - "legend": { + "timeUnit": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "$ref": "#/definitions/TimeUnit" }, { - "type": "null" + "$ref": "#/definitions/TimeUnitParams" } ], - "description": "An object defining properties of the legend.\nIf `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." + "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." }, - "scale": { + "gte": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "type": "string" }, { - "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": [ + "type": "number" + }, { - "$ref": "#/definitions/TimeUnit" + "$ref": "#/definitions/DateTime" }, { - "$ref": "#/definitions/TimeUnitParams" + "$ref": "#/definitions/ExprRef" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "description": "The value that the field should be greater than or equals to." }, - "title": { + "timeUnit": { "anyOf": [ { - "$ref": "#/definitions/Text" + "$ref": "#/definitions/TimeUnit" }, { - "type": "null" + "$ref": "#/definitions/TimeUnitParams" } ], - "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/docs/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 encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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": "Time unit for the field to be tested." } }, "required": [ - "type" + "field", + "gte" ], "type": "object" }, - "FieldDefWithCondition": { + "FieldGTPredicate": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." }, - "bin": { + "gt": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { - "$ref": "#/definitions/BinParams" + "type": "number" }, { - "type": "null" + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "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": { - "$ref": "#/definitions/ValueCondition", - "description": "One or more value definition(s) with [a selection 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)\nsince 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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "description": "The value that the field should be greater than." }, - "legend": { + "timeUnit": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "$ref": "#/definitions/TimeUnit" }, { - "type": "null" + "$ref": "#/definitions/TimeUnitParams" } ], - "description": "An object defining properties of the legend.\nIf `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." + "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." }, - "scale": { + "lte": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "type": "string" }, { - "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": [ + "type": "number" + }, { - "$ref": "#/definitions/TimeUnit" + "$ref": "#/definitions/DateTime" }, { - "$ref": "#/definitions/TimeUnitParams" + "$ref": "#/definitions/ExprRef" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "description": "The value that the field should be less than or equals to." }, - "title": { + "timeUnit": { "anyOf": [ { - "$ref": "#/definitions/Text" + "$ref": "#/definitions/TimeUnit" }, { - "type": "null" + "$ref": "#/definitions/TimeUnitParams" } ], - "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/docs/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 encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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": "Time unit for the field to be tested." } }, "required": [ - "type" + "field", + "lte" ], "type": "object" }, - "FieldDefWithCondition": { + "FieldLTPredicate": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." }, - "bin": { + "lt": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { - "$ref": "#/definitions/BinParams" + "type": "number" }, { - "type": "null" + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "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": { - "$ref": "#/definitions/ValueCondition", - "description": "One or more value definition(s) with [a selection 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)\nsince 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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "description": "The value that the field should be less than." }, - "legend": { + "timeUnit": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "$ref": "#/definitions/TimeUnit" }, { - "type": "null" + "$ref": "#/definitions/TimeUnitParams" } ], - "description": "An object defining properties of the legend.\nIf `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." + "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." }, - "scale": { + "oneOf": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "items": { + "type": "string" + }, + "type": "array" }, { - "type": "null" + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" } ], - "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." + "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": [ @@ -6785,124 +9583,220 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "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": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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." }, - "title": { + "datum": { "anyOf": [ { - "$ref": "#/definitions/Text" + "$ref": "#/definitions/PrimitiveValue" }, { - "type": "null" + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" } ], - "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/docs/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." + "description": "A constant value in data domain." }, "type": { - "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "type" - ], "type": "object" }, - "FieldDefWithCondition,(string|null)>": { + "FieldOrDatumDefWithCondition": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, - "bin": { + "condition": { "anyOf": [ { - "type": "boolean" + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { - "$ref": "#/definitions/BinParams" + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection 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" }, { - "type": "null" + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" } ], - "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": { - "$ref": "#/definitions/ValueCondition<(string|null)>", - "description": "One or more value definition(s) with [a selection 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)\nsince Vega-Lite only allows at most one encoded field per encoding channel." + "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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, - "legend": { + "condition": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { - "type": "null" + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" } ], - "description": "An object defining properties of the legend.\nIf `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." + "description": "One or more value definition(s) with [a selection 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." }, - "scale": { + "datum": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "$ref": "#/definitions/PrimitiveValue" }, { - "type": "null" + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" } ], - "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." + "description": "A constant value in data domain." }, - "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." + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, - "timeUnit": { + "condition": { "anyOf": [ { - "$ref": "#/definitions/TimeUnit" + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, { - "$ref": "#/definitions/TimeUnitParams" + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "description": "One or more value definition(s) with [a selection 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." }, - "title": { + "datum": { "anyOf": [ { - "$ref": "#/definitions/Text" + "$ref": "#/definitions/PrimitiveValue" }, { - "type": "null" + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" } ], - "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/docs/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." + "description": "A constant value in data domain." }, "type": { - "$ref": "#/definitions/TypeForShape", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "type" - ], "type": "object" }, - "FieldDefWithCondition": { + "FieldOrDatumDefWithCondition": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, "bin": { "anyOf": [ @@ -6912,12 +9806,6 @@ { "$ref": "#/definitions/BinParams" }, - { - "enum": [ - "binned" - ], - "type": "string" - }, { "type": "null" } @@ -6925,31 +9813,48 @@ "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": { - "$ref": "#/definitions/ValueCondition", - "description": "One or more value definition(s) with [a selection 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)\nsince Vega-Lite only allows at most one encoded field per encoding channel." + "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 selection 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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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": { + "legend": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/Legend" }, { - "type": "object" + "type": "null" } ], - "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/usage/compile.html#format-type) that takes `datum.value` and format parameter as input), this property represents the format parameter.\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." + "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." }, - "formatType": { - "description": "The format type for labels (`\"number\"` or `\"time\"` or a [registered custom format type](https://vega.github.io/vega-lite/usage/compile.html#format-type)).\n\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", - "type": "string" + "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." }, - "labelExpr": { - "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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": [ @@ -6960,7 +9865,7 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "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": [ @@ -6975,21 +9880,24 @@ }, "type": { "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "type" - ], "type": "object" }, - "FieldDefWithCondition": { + "FieldOrDatumDefWithCondition": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, "bin": { "anyOf": [ @@ -6999,12 +9907,6 @@ { "$ref": "#/definitions/BinParams" }, - { - "enum": [ - "binned" - ], - "type": "string" - }, { "type": "null" } @@ -7012,31 +9914,48 @@ "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": { - "$ref": "#/definitions/ValueCondition", - "description": "One or more value definition(s) with [a selection 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)\nsince 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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." - }, - "format": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { - "type": "object" + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" } ], - "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/usage/compile.html#format-type) that takes `datum.value` and format parameter as input), this property represents the format parameter.\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." + "description": "One or more value definition(s) with [a selection 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." }, - "formatType": { - "description": "The format type for labels (`\"number\"` or `\"time\"` or a [registered custom format type](https://vega.github.io/vega-lite/usage/compile.html#format-type)).\n\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", - "type": "string" + "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`." }, - "labelExpr": { - "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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": [ @@ -7047,7 +9966,7 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "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": [ @@ -7062,80 +9981,82 @@ }, "type": { "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "type" - ], "type": "object" }, - "FieldDefWithoutScale": { - "$ref": "#/definitions/TypedFieldDef", - "description": "Field Def without scale (and without bin: \"binned\" support)." - }, - "FieldEqualPredicate": { + "FieldOrDatumDefWithCondition": { "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { - "equal": { + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { - "type": "number" + "$ref": "#/definitions/BinParams" }, { - "type": "boolean" + "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)>" }, { - "$ref": "#/definitions/DateTime" + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" } ], - "description": "The value that the field should be equal to." + "description": "One or more value definition(s) with [a selection 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/FieldName", - "description": "Field to be tested." + "$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": { + "legend": { "anyOf": [ { - "$ref": "#/definitions/TimeUnit" + "$ref": "#/definitions/Legend" }, { - "$ref": "#/definitions/TimeUnitParams" + "type": "null" } ], - "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." + "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." }, - "gte": { + "scale": { "anyOf": [ { - "type": "string" - }, - { - "type": "number" + "$ref": "#/definitions/Scale" }, { - "$ref": "#/definitions/DateTime" + "type": "null" } ], - "description": "The value that the field should be greater than or equals to." + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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": [ @@ -7146,74 +10067,97 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit for the field to be tested." + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "field", - "gte" - ], "type": "object" }, - "FieldGTPredicate": { + "FieldOrDatumDefWithCondition,(string|null)>": { "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { - "field": { - "$ref": "#/definitions/FieldName", - "description": "Field to be tested." + "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." }, - "gt": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { - "type": "number" + "$ref": "#/definitions/BinParams" }, { - "$ref": "#/definitions/DateTime" + "type": "null" } ], - "description": "The value that the field should be greater than." + "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." }, - "timeUnit": { + "condition": { "anyOf": [ { - "$ref": "#/definitions/TimeUnit" + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { - "$ref": "#/definitions/TimeUnitParams" + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" } ], - "description": "Time unit for the field to be tested." - } - }, - "required": [ - "field", - "gt" - ], - "type": "object" - }, - "FieldLTEPredicate": { - "additionalProperties": false, - "properties": { + "description": "One or more value definition(s) with [a selection 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/FieldName", - "description": "Field to be tested." + "$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`." }, - "lte": { + "legend": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/Legend" }, { - "type": "number" + "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" }, { - "$ref": "#/definitions/DateTime" + "type": "null" } ], - "description": "The value that the field should be less than or equals to." + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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": [ @@ -7224,92 +10168,259 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit for the field to be tested." + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "field", - "lte" - ], "type": "object" }, - "FieldLTPredicate": { + "FieldOrDatumDefWithCondition": { "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { - "field": { - "$ref": "#/definitions/FieldName", - "description": "Field to be tested." + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, - "lt": { + "condition": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, { - "type": "number" + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection 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": "The value that the field should be less than." + "description": "A constant value in data domain." }, - "timeUnit": { + "format": { "anyOf": [ { - "$ref": "#/definitions/TimeUnit" + "type": "string" }, { - "$ref": "#/definitions/TimeUnitParams" + "$ref": "#/definitions/Dict" } ], - "description": "Time unit for the field to be tested." + "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). - 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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" + }, + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "field", - "lt" - ], "type": "object" }, - "FieldName": { - "type": "string" - }, - "FieldOneOfPredicate": { + "FieldOrDatumDefWithCondition": { "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { - "field": { - "$ref": "#/definitions/FieldName", - "description": "Field to be tested." + "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." }, - "oneOf": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "boolean" }, { - "items": { - "type": "number" - }, - "type": "array" + "$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": { - "type": "boolean" + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection 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). - 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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" + }, + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/DateTime" + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" }, "type": "array" } ], - "description": "A set of values that the `field`'s value should be a member of,\nfor a data item included in the filtered data." + "description": "One or more value definition(s) with [a selection 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). - 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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" }, "timeUnit": { "anyOf": [ @@ -7320,13 +10431,24 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit for the field to be tested." + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "field", - "oneOf" - ], "type": "object" }, "FieldRangePredicate": { @@ -7337,23 +10459,33 @@ "description": "Field to be tested." }, "range": { - "description": "An array of inclusive minimum and maximum values\nfor a field value of a data item to be included in the filtered data.", - "items": { - "anyOf": [ - { - "type": "number" - }, - { - "$ref": "#/definitions/DateTime" + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - { - "type": "null" - } - ] - }, + "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, - "type": "array" + "minItems": 2 }, "timeUnit": { "anyOf": [ @@ -7407,7 +10539,7 @@ "properties": { "filter": { "$ref": "#/definitions/PredicateComposition", - "description": "The `filter` property must be a predication definition, which can takes one of the following forms:\n\n1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string,\nwhere `datum` can be used to refer to the current data object.\nFor 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),\n[`lt`](https://vega.github.io/vega-lite/docs/predicate.html#lt-predicate),\n[`lte`](https://vega.github.io/vega-lite/docs/predicate.html#lte-predicate),\n[`gt`](https://vega.github.io/vega-lite/docs/predicate.html#gt-predicate),\n[`gte`](https://vega.github.io/vega-lite/docs/predicate.html#gte-predicate),\n[`range`](https://vega.github.io/vega-lite/docs/predicate.html#range-predicate),\n[`oneOf`](https://vega.github.io/vega-lite/docs/predicate.html#one-of-predicate),\nor [`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)." + "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": [ @@ -7442,7 +10574,7 @@ "type": "array" }, "flatten": { - "description": "An array of one or more data fields containing arrays to flatten.\nIf multiple fields are specified, their array values should have a parallel structure, ideally with the same length.\nIf the lengths of parallel arrays do not match,\nthe longest array will be used with `null` values added for missing entries.", + "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" }, @@ -7458,7 +10590,7 @@ "additionalProperties": false, "properties": { "as": { - "description": "The output field names for the key and value properties produced by the fold transform.\n__Default value:__ `[\"key\", \"value\"]`", + "description": "The output field names for the key and value properties produced by the fold transform. __Default value:__ `[\"key\", \"value\"]`", "items": [ { "$ref": "#/definitions/FieldName" @@ -7534,10 +10666,10 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The alignment to apply to grid rows and columns.\nThe 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\"`." + "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. - 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.\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\"`", + "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. - 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" @@ -7556,7 +10688,7 @@ "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\n`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`).", + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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": { @@ -7598,7 +10730,7 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent 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)" + "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": [ @@ -7637,10 +10769,10 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The alignment to apply to grid rows and columns.\nThe 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\"`." + "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. - 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.\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\"`", + "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. - 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" @@ -7659,7 +10791,7 @@ "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\n`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`).", + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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": { @@ -7701,7 +10833,7 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent 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)" + "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": [ @@ -7740,10 +10872,10 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The alignment to apply to grid rows and columns.\nThe 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\"`." + "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. - 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.\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\"`", + "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. - 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" @@ -7762,7 +10894,7 @@ "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\n`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`).", + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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": { @@ -7789,7 +10921,7 @@ "$ref": "#/definitions/FacetMapping" } ], - "description": "Definition for how to facet the data. One of:\n1) [a field definition for faceting the plot by one field](https://vega.github.io/vega-lite/docs/facet.html#field-def)\n2) [An object that maps `row` and `column` channels to their field definitions](https://vega.github.io/vega-lite/docs/facet.html#mapping)" + "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.", @@ -7808,7 +10940,7 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent 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)" + "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": [ @@ -7859,10 +10991,10 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The alignment to apply to grid rows and columns.\nThe 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\"`." + "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. - 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.\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\"`", + "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. - 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" @@ -7881,7 +11013,7 @@ "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\n`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`).", + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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": { @@ -7908,7 +11040,7 @@ "$ref": "#/definitions/FacetMapping" } ], - "description": "Definition for how to facet the data. One of:\n1) [a field definition for faceting the plot by one field](https://vega.github.io/vega-lite/docs/facet.html#field-def)\n2) [An object that maps `row` and `column` channels to their field definitions](https://vega.github.io/vega-lite/docs/facet.html#mapping)" + "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.", @@ -7927,7 +11059,7 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent 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)" + "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": [ @@ -7970,7 +11102,7 @@ "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\"`", + "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. - 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" @@ -8044,7 +11176,7 @@ "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\"`", + "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. - 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" @@ -8170,7 +11302,7 @@ "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\"`", + "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. - 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" @@ -8244,7 +11376,7 @@ "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\"`", + "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. - 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" @@ -8351,9 +11483,7 @@ "graticule": { "anyOf": [ { - "enum": [ - true - ], + "const": true, "type": "boolean" }, { @@ -8416,17 +11546,24 @@ "type": "string" }, { - "type": "object" + "$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/usage/compile.html#format-type) that takes `datum.value` and format parameter as input), this property represents the format parameter.\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." + "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). - 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 (`\"number\"` or `\"time\"` or a [registered custom format type](https://vega.github.io/vega-lite/usage/compile.html#format-type)).\n\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "labelAlign": { - "$ref": "#/definitions/Align", + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "Horizontal text alignment of header labels. One of `\"left\"`, `\"center\"`, or `\"right\"`." }, "labelAnchor": { @@ -8440,11 +11577,25 @@ "type": "number" }, "labelBaseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline for the header labels. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`.\nThe `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone." + "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": { - "$ref": "#/definitions/Color", + "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": { @@ -8452,37 +11603,86 @@ "type": "string" }, "labelFont": { - "description": "The font of the header label.", - "type": "string" + "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, - "type": "number" + "minimum": 0 }, "labelFontStyle": { - "$ref": "#/definitions/FontStyle", + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "The font style of the header label." }, "labelFontWeight": { - "$ref": "#/definitions/FontWeight", + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "The font weight of the header label." }, "labelLimit": { - "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", - "type": "number" + "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": { - "description": "Line height in pixels for multi-line header labels or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", - "type": "number" - }, + "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": { - "description": "The padding, in pixel, between facet header's label and the plot.\n\n__Default value:__ `10`", - "type": "number" + "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`.", @@ -8504,7 +11704,14 @@ "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/docs/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": { - "$ref": "#/definitions/Align", + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "Horizontal text alignment (to the anchor) of header titles." }, "titleAnchor": { @@ -8518,45 +11725,108 @@ "type": "number" }, "titleBaseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline for the header title. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`.\nThe `\"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\"`" + "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": { - "$ref": "#/definitions/Color", + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "Color of the header title, can be in hex color code or regular color name." }, "titleFont": { - "description": "Font of the header title. (e.g., `\"Helvetica Neue\"`).", - "type": "string" + "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, - "type": "number" + "minimum": 0 }, "titleFontStyle": { - "$ref": "#/definitions/FontStyle", + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "The font style of the header title." }, "titleFontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "Font weight of the header title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "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", - "type": "number" + "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": { - "description": "Line height in pixels for multi-line header title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", - "type": "number" + "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": { - "description": "The padding, in pixel, between facet header's title and the label.\n\n__Default value:__ `10`", - "type": "number" + "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" @@ -8570,17 +11840,24 @@ "type": "string" }, { - "type": "object" + "$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/usage/compile.html#format-type) that takes `datum.value` and format parameter as input), this property represents the format parameter.\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." + "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). - 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 (`\"number\"` or `\"time\"` or a [registered custom format type](https://vega.github.io/vega-lite/usage/compile.html#format-type)).\n\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "labelAlign": { - "$ref": "#/definitions/Align", + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "Horizontal text alignment of header labels. One of `\"left\"`, `\"center\"`, or `\"right\"`." }, "labelAnchor": { @@ -8594,11 +11871,25 @@ "type": "number" }, "labelBaseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline for the header labels. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`.\nThe `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone." + "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": { - "$ref": "#/definitions/Color", + "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": { @@ -8606,37 +11897,86 @@ "type": "string" }, "labelFont": { - "description": "The font of the header label.", - "type": "string" + "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, - "type": "number" + "minimum": 0 }, "labelFontStyle": { - "$ref": "#/definitions/FontStyle", + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "The font style of the header label." }, "labelFontWeight": { - "$ref": "#/definitions/FontWeight", + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "The font weight of the header label." }, "labelLimit": { - "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", - "type": "number" + "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": { - "description": "Line height in pixels for multi-line header labels or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", - "type": "number" + "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": { - "description": "The padding, in pixel, between facet header's label and the plot.\n\n__Default value:__ `10`", - "type": "number" + "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`.", @@ -8651,7 +11991,14 @@ "type": "null" }, "titleAlign": { - "$ref": "#/definitions/Align", + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "Horizontal text alignment (to the anchor) of header titles." }, "titleAnchor": { @@ -8665,48 +12012,111 @@ "type": "number" }, "titleBaseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline for the header title. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`.\nThe `\"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\"`" + "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": { - "$ref": "#/definitions/Color", + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "Color of the header title, can be in hex color code or regular color name." }, "titleFont": { - "description": "Font of the header title. (e.g., `\"Helvetica Neue\"`).", - "type": "string" + "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, - "type": "number" + "minimum": 0 }, "titleFontStyle": { - "$ref": "#/definitions/FontStyle", + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], "description": "The font style of the header title." }, "titleFontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "Font weight of the header title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "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", - "type": "number" + "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": { - "description": "Line height in pixels for multi-line header title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", - "type": "number" + "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": { - "description": "The padding, in pixel, between facet header's title and the label.\n\n__Default value:__ `10`", - "type": "number" - } - }, - "type": "object" + "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", @@ -8756,11 +12166,11 @@ "$ref": "#/definitions/ImputeSequence" } ], - "description": "Defines the key values that should be considered for imputation.\nAn 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." + "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.\nOne of `\"value\"`, `\"mean\"`, `\"median\"`, `\"max\"` or `\"min\"`.\n\n__Default value:__ `\"value\"`" + "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\"`." @@ -8772,11 +12182,11 @@ "additionalProperties": false, "properties": { "start": { - "description": "The starting value of the sequence.\n__Default value:__ `0`", + "description": "The starting value of the sequence. __Default value:__ `0`", "type": "number" }, "step": { - "description": "The step value between sequence entries.\n__Default value:__ `1` or `-1` if `stop < start`", + "description": "The step value between sequence entries. __Default value:__ `1` or `-1` if `stop < start`", "type": "number" }, "stop": { @@ -8813,7 +12223,7 @@ "type": "array" }, "groupby": { - "description": "An optional array of fields by which to group the values.\nImputation will then be performed on a per-group basis.", + "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" }, @@ -8825,7 +12235,7 @@ }, "key": { "$ref": "#/definitions/FieldName", - "description": "A key field that uniquely identifies data objects within a group.\nMissing key values (those occurring in the data but not in the current group) will be imputed." + "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": [ @@ -8838,11 +12248,11 @@ "$ref": "#/definitions/ImputeSequence" } ], - "description": "Defines the key values that should be considered for imputation.\nAn 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." + "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.\nOne of `\"value\"`, `\"mean\"`, `\"median\"`, `\"max\"` or `\"min\"`.\n\n__Default value:__ `\"value\"`" + "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\"`." @@ -8867,7 +12277,7 @@ }, "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.\nArrays of primitive values are ingested as objects with a `data` property. Strings are parsed according to the specified format type." + "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": [ @@ -8962,10 +12372,8 @@ "additionalProperties": false, "properties": { "bind": { - "description": "Establishes a two-way binding between the interval selection and the scales\nused within the same view. This allows a user to interactively pan and\nzoom the view.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation.", - "enum": [ - "scales" - ], + "const": "scales", + "description": "Establishes a two-way binding between the interval selection and the scales used within the same view. This allows a user to interactively pan and zoom the view.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation.", "type": "string" }, "clear": { @@ -8980,10 +12388,10 @@ "type": "boolean" } ], - "description": "Clears the selection, emptying it of all values. Can be a\n[Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." }, "empty": { - "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", "enum": [ "all", "none" @@ -8991,14 +12399,14 @@ "type": "string" }, "encodings": { - "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "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:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", "items": { "$ref": "#/definitions/SingleDefUnitChannel" }, "type": "array" }, "fields": { - "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", "items": { "$ref": "#/definitions/FieldName" }, @@ -9006,11 +12414,11 @@ }, "init": { "$ref": "#/definitions/SelectionInitIntervalMapping", - "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of\ninitial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." }, "mark": { "$ref": "#/definitions/BrushConfig", - "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark.\n\n__See also:__ [`mark`](https://vega.github.io/vega-lite/docs/selection-mark.html) documentation." + "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`](https://vega.github.io/vega-lite/docs/selection-mark.html) documentation." }, "on": { "anyOf": [ @@ -9021,28 +12429,26 @@ "type": "string" } ], - "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + "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)." }, "resolve": { "$ref": "#/definitions/SelectionResolution", - "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + "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\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." }, "translate": { - "description": "When truthy, allows a user to interactively move an interval selection\nback-and-forth. Can be `true`, `false` (to disable panning), or a\n[Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)\nwhich must include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to\n`[mousedown, window:mouseup] > window:mousemove!` which corresponds to\nclicks and dragging within an interval selection to reposition it.\n\n__See also:__ [`translate`](https://vega.github.io/vega-lite/docs/translate.html) documentation.", + "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.\n\n__Default value:__ `true`, which corresponds to `[mousedown, window:mouseup] > window:mousemove!` which corresponds to clicks and dragging within an interval selection to reposition it.\n\n__See also:__ [`translate`](https://vega.github.io/vega-lite/docs/translate.html) documentation.", "type": [ "string", "boolean" ] }, "type": { - "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `\"single\"` -- to select a single discrete data value on `click`.\n- `\"multi\"` -- to select multiple discrete data value; 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`.", - "enum": [ - "interval" - ], + "const": "interval", + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `\"single\"` -- to select a single discrete data value on `click`. - `\"multi\"` -- to select multiple discrete data value; 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`.", "type": "string" }, "zoom": { - "description": "When truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n__Default value:__ `true`, which corresponds to `wheel!`.\n\n__See also:__ [`zoom`](https://vega.github.io/vega-lite/docs/zoom.html) documentation.", + "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.\n\n__Default value:__ `true`, which corresponds to `wheel!`.\n\n__See also:__ [`zoom`](https://vega.github.io/vega-lite/docs/zoom.html) documentation.", "type": [ "string", "boolean" @@ -9058,10 +12464,8 @@ "additionalProperties": false, "properties": { "bind": { - "description": "Establishes a two-way binding between the interval selection and the scales\nused within the same view. This allows a user to interactively pan and\nzoom the view.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation.", - "enum": [ - "scales" - ], + "const": "scales", + "description": "Establishes a two-way binding between the interval selection and the scales used within the same view. This allows a user to interactively pan and zoom the view.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation.", "type": "string" }, "clear": { @@ -9076,10 +12480,10 @@ "type": "boolean" } ], - "description": "Clears the selection, emptying it of all values. Can be a\n[Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." }, "empty": { - "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", "enum": [ "all", "none" @@ -9087,14 +12491,14 @@ "type": "string" }, "encodings": { - "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "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:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", "items": { "$ref": "#/definitions/SingleDefUnitChannel" }, "type": "array" }, "fields": { - "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", "items": { "$ref": "#/definitions/FieldName" }, @@ -9102,11 +12506,11 @@ }, "init": { "$ref": "#/definitions/SelectionInitIntervalMapping", - "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of\ninitial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." }, "mark": { "$ref": "#/definitions/BrushConfig", - "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark.\n\n__See also:__ [`mark`](https://vega.github.io/vega-lite/docs/selection-mark.html) documentation." + "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`](https://vega.github.io/vega-lite/docs/selection-mark.html) documentation." }, "on": { "anyOf": [ @@ -9117,21 +12521,21 @@ "type": "string" } ], - "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + "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)." }, "resolve": { "$ref": "#/definitions/SelectionResolution", - "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + "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\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." }, "translate": { - "description": "When truthy, allows a user to interactively move an interval selection\nback-and-forth. Can be `true`, `false` (to disable panning), or a\n[Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)\nwhich must include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to\n`[mousedown, window:mouseup] > window:mousemove!` which corresponds to\nclicks and dragging within an interval selection to reposition it.\n\n__See also:__ [`translate`](https://vega.github.io/vega-lite/docs/translate.html) documentation.", + "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.\n\n__Default value:__ `true`, which corresponds to `[mousedown, window:mouseup] > window:mousemove!` which corresponds to clicks and dragging within an interval selection to reposition it.\n\n__See also:__ [`translate`](https://vega.github.io/vega-lite/docs/translate.html) documentation.", "type": [ "string", "boolean" ] }, "zoom": { - "description": "When truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n__Default value:__ `true`, which corresponds to `wheel!`.\n\n__See also:__ [`zoom`](https://vega.github.io/vega-lite/docs/zoom.html) documentation.", + "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.\n\n__Default value:__ `true`, which corresponds to `wheel!`.\n\n__See also:__ [`zoom`](https://vega.github.io/vega-lite/docs/zoom.html) documentation.", "type": [ "string", "boolean" @@ -9197,17 +12601,15 @@ "type": "null" } ], - "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data.\nAlternatively, 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)).\nFor 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).\nFor 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)" + "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.\nThis parameter can be used when the loaded JSON file may have surrounding structure or meta-data.\nFor example `\"property\": \"values.features\"` is equivalent to retrieving `json.values.features`\nfrom the loaded JSON object.", + "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": { - "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.\nIf no extension is detected, `\"json\"` will be used by default.", - "enum": [ - "json" - ], + "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" } }, @@ -9219,25 +12621,40 @@ "type": "boolean" }, { - "enum": [ - "parity" - ], + "const": "parity", "type": "string" }, { - "enum": [ - "greedy" - ], + "const": "greedy", "type": "string" } ] }, + "LatLongDef": { + "anyOf": [ + { + "$ref": "#/definitions/LatLongFieldDef" + }, + { + "$ref": "#/definitions/DatumDef" + }, + { + "$ref": "#/definitions/NumericValueDef" + } + ] + }, "LatLongFieldDef": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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.", @@ -9245,7 +12662,7 @@ }, "field": { "$ref": "#/definitions/Field", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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": [ @@ -9256,7 +12673,7 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "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": [ @@ -9270,13 +12687,152 @@ "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/docs/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": { - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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.", + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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. - 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.\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. - 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": [ - "quantitative" + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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": { @@ -9299,7 +12855,7 @@ "type": "string" }, "encoding": { - "$ref": "#/definitions/Encoding", + "$ref": "#/definitions/SharedEncoding", "description": "A shared key-value mapping between encoding channels and definition of fields in the underlying layers." }, "height": { @@ -9308,16 +12864,14 @@ "type": "number" }, { - "enum": [ - "container" - ], + "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." + "description": "The height of a visualization.\n\n- 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\"`.\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.", @@ -9373,16 +12927,14 @@ "type": "number" }, { - "enum": [ - "container" - ], + "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:__\nBased 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." + "description": "The width of a visualization.\n\n- 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\"`.\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": [ @@ -9402,36 +12954,93 @@ "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": { - "description": "The height in pixels to clip symbol legend entries and limit their size.", - "type": "number" + "anyOf": [ + { + "description": "The height in pixels to clip symbol legend entries and limit their size.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "columnPadding": { - "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", - "type": "number" + "anyOf": [ + { + "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "columns": { - "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" + "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": { - "description": "Corner radius for the full legend.", - "type": "number" + "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." + "description": "The direction of the legend, one of `\"vertical\"` or `\"horizontal\"`.\n\n__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": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Background fill color for the full legend." }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Background fill color for the full legend." + ] }, "format": { "anyOf": [ @@ -9439,214 +13048,473 @@ "type": "string" }, { - "type": "object" + "$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/usage/compile.html#format-type) that takes `datum.value` and format parameter as input), this property represents the format parameter.\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." + "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). - 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 (`\"number\"` or `\"time\"` or a [registered custom format type](https://vega.github.io/vega-lite/usage/compile.html#format-type)).\n\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "gradientLength": { - "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" + "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": { - "description": "Opacity of the color gradient.", - "type": "number" - }, - "gradientStrokeColor": { "anyOf": [ { - "type": "null" + "description": "Opacity of the color gradient.", + "type": "number" }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "The color of the gradient stroke, can be in hex color code or regular color name.\n\n__Default value:__ `\"lightGray\"`." - }, - "gradientStrokeWidth": { - "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", - "minimum": 0, - "type": "number" + ] }, - "gradientThickness": { - "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" + "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": { - "$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\"`." + "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": { - "$ref": "#/definitions/Align", - "description": "The alignment of the legend label, can be left, center, or right." + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "The alignment of the legend label, can be left, center, or right." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelBaseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The position of the baseline of legend label, can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`.\n\n__Default value:__ `\"middle\"`." + "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": [ { - "type": "null" + "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/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "The color of the legend 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 legend's backing `datum` object.", "type": "string" }, "labelFont": { - "description": "The font of the legend label.", - "type": "string" + "anyOf": [ + { + "description": "The font of the legend label.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelFontSize": { - "description": "The font size of legend label.\n\n__Default value:__ `10`.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The font size of legend label.\n\n__Default value:__ `10`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelFontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style of legend label." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelFontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight of legend label." + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelLimit": { - "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", - "type": "number" + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelOffset": { - "description": "The offset of the legend label.", - "type": "number" + "anyOf": [ + { + "description": "The offset of the legend label.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelOpacity": { - "description": "Opacity of labels.", - "type": "number" + "anyOf": [ + { + "description": "Opacity of labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelOverlap": { - "$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`." + "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": { - "description": "Padding in pixels between the legend and legend labels.", - "type": "number" + "anyOf": [ + { + "description": "Padding in pixels between the legend and legend labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelSeparation": { - "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" + "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": { - "description": "Custom x-position for legend with orient \"none\".", - "type": "number" + "anyOf": [ + { + "description": "Custom x-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "legendY": { - "description": "Custom y-position for legend with orient \"none\".", - "type": "number" + "anyOf": [ + { + "description": "Custom y-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "offset": { - "description": "The offset in pixels by which to displace the legend from the data rectangle and axes.\n\n__Default value:__ `18`.", - "type": "number" + "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": { - "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", - "type": "number" + "anyOf": [ + { + "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "rowPadding": { - "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", - "type": "number" + "anyOf": [ + { + "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeColor": { "anyOf": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Border stroke color for the full legend." }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Border stroke color for the full legend." + ] }, "symbolDash": { - "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", - "items": { - "type": "number" - }, - "type": "array" + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "symbolDashOffset": { - "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", - "type": "number" + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "symbolFillColor": { "anyOf": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend symbol," }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "The color of the legend symbol," + ] }, "symbolLimit": { - "description": "The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.", - "type": "number" - }, - "symbolOffset": { - "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", - "type": "number" - }, - "symbolOpacity": { - "description": "Opacity of the legend symbols.", - "type": "number" - }, - "symbolSize": { - "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", - "minimum": 0, - "type": "number" - }, - "symbolStrokeColor": { "anyOf": [ { - "type": "null" + "description": "The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.", + "type": "number" }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Stroke color for legend symbols." + ] }, - "symbolStrokeWidth": { - "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", - "minimum": 0, - "type": "number" + "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": { - "$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\"`." + "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": { - "$ref": "#/definitions/TickCount", - "description": "The desired number of tick values for quantitative legends." + "anyOf": [ + { + "$ref": "#/definitions/TickCount", + "description": "The desired number of tick values for quantitative legends." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "tickMinStep": { - "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`", - "type": "number" + "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": [ @@ -9660,64 +13528,155 @@ "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/docs/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": { - "$ref": "#/definitions/Align", - "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleAnchor": { - "$ref": "#/definitions/TitleAnchor", - "description": "Text anchor position for placing legend titles." + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing legend titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleBaseline": { - "$ref": "#/definitions/TextBaseline", - "description": "Vertical text baseline for legend titles.\n\n__Default value:__ `\"top\"`." + "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": [ { - "type": "null" + "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/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "The color of the legend title, can be in hex color code or regular color name." + ] }, "titleFont": { - "description": "The font of the legend title.", - "type": "string" + "anyOf": [ + { + "description": "The font of the legend title.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontSize": { - "description": "The font size of the legend title.", - "type": "number" + "anyOf": [ + { + "description": "The font size of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style of the legend title." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight of the legend title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleLineHeight": { - "description": "Line height in pixels for multi-line title text.", - "type": "number" + "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": { - "description": "Opacity of the legend title.", - "type": "number" + "anyOf": [ + { + "description": "Opacity of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleOrient": { - "$ref": "#/definitions/Orient", - "description": "Orientation of the legend title." + "anyOf": [ + { + "$ref": "#/definitions/Orient", + "description": "Orientation of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titlePadding": { - "description": "The padding, in pixels, between title and legend.\n\n__Default value:__ `5`.", - "type": "number" + "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.", @@ -9752,12 +13711,15 @@ "$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.\nIf zindex is 0, legend should be drawn behind all chart elements.\nTo put them in front, use zindex = 1.", + "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" } @@ -9767,9 +13729,7 @@ "LegendBinding": { "anyOf": [ { - "enum": [ - "legend" - ], + "const": "legend", "type": "string" }, { @@ -9780,25 +13740,75 @@ "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": { - "description": "The height in pixels to clip symbol legend entries and limit their size.", - "type": "number" + "anyOf": [ + { + "description": "The height in pixels to clip symbol legend entries and limit their size.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "columnPadding": { - "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", - "type": "number" + "anyOf": [ + { + "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "columns": { - "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" + "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": { - "description": "Corner radius for the full legend.", - "type": "number" + "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." + "description": "The direction of the legend, one of `\"vertical\"` or `\"horizontal\"`.\n\n__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": { "description": "Disable legend by default", @@ -9807,17 +13817,31 @@ "fillColor": { "anyOf": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Background fill color for the full legend." }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Background fill color for the full legend." + ] }, "gradientDirection": { - "$ref": "#/definitions/Orientation", - "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for gradient legends.\n\n__Default value:__ `\"vertical\"`." + "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`", @@ -9828,42 +13852,91 @@ "type": "number" }, "gradientLabelLimit": { - "description": "The maximum allowed length in pixels of color ramp gradient labels.", - "type": "number" + "anyOf": [ + { + "description": "The maximum allowed length in pixels of color ramp gradient labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "gradientLabelOffset": { - "description": "Vertical offset in pixels for color ramp gradient labels.\n\n__Default value:__ `2`.", - "type": "number" + "anyOf": [ + { + "description": "Vertical offset in pixels for color ramp gradient labels.\n\n__Default value:__ `2`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "gradientLength": { - "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" + "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": { - "description": "Opacity of the color gradient.", - "type": "number" + "anyOf": [ + { + "description": "Opacity of the color gradient.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "gradientStrokeColor": { "anyOf": [ { - "type": "null" + "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/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "The color of the gradient stroke, can be in hex color code or regular color name.\n\n__Default value:__ `\"lightGray\"`." + ] }, "gradientStrokeWidth": { - "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "gradientThickness": { - "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" + "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`", @@ -9874,282 +13947,635 @@ "type": "number" }, "gridAlign": { - "$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\"`." + "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": { - "$ref": "#/definitions/Align", - "description": "The alignment of the legend label, can be left, center, or right." + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "The alignment of the legend label, can be left, center, or right." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelBaseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The position of the baseline of legend label, can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`.\n\n__Default value:__ `\"middle\"`." + "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": [ { - "type": "null" + "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/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "The color of the legend label, can be in hex color code or regular color name." + ] }, "labelFont": { - "description": "The font of the legend label.", - "type": "string" + "anyOf": [ + { + "description": "The font of the legend label.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelFontSize": { - "description": "The font size of legend label.\n\n__Default value:__ `10`.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The font size of legend label.\n\n__Default value:__ `10`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelFontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style of legend label." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelFontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight of legend label." + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelLimit": { - "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", - "type": "number" + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelOffset": { - "description": "The offset of the legend label.", - "type": "number" + "anyOf": [ + { + "description": "The offset of the legend label.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelOpacity": { - "description": "Opacity of labels.", - "type": "number" + "anyOf": [ + { + "description": "Opacity of labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelOverlap": { - "$ref": "#/definitions/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": { - "description": "Padding in pixels between the legend and legend labels.", - "type": "number" + "anyOf": [ + { + "description": "Padding in pixels between the legend and legend labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "labelSeparation": { - "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" + "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": { - "description": "Legend orient group layout parameters.", - "not": { - } + "$ref": "#/definitions/ExprRef" }, "legendX": { - "description": "Custom x-position for legend with orient \"none\".", - "type": "number" + "anyOf": [ + { + "description": "Custom x-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "legendY": { - "description": "Custom y-position for legend with orient \"none\".", - "type": "number" + "anyOf": [ + { + "description": "Custom y-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "offset": { - "description": "The offset in pixels by which to displace the legend from the data rectangle and axes.\n\n__Default value:__ `18`.", - "type": "number" + "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": { - "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", - "type": "number" + "anyOf": [ + { + "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "rowPadding": { - "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", - "type": "number" + "anyOf": [ + { + "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeColor": { "anyOf": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Border stroke color for the full legend." }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Border stroke color for the full legend." + ] }, "strokeDash": { - "description": "Border stroke dash pattern for the full legend.", - "items": { - "type": "number" - }, - "type": "array" - }, - "strokeWidth": { - "description": "Border stroke width for the full legend.", - "type": "number" - }, - "symbolBaseFillColor": { "anyOf": [ { - "type": "null" + "description": "Border stroke dash pattern for the full legend.", + "items": { + "type": "number" + }, + "type": "array" }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "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\"`." + ] }, - "symbolBaseStrokeColor": { + "strokeWidth": { "anyOf": [ { - "type": "null" + "description": "Border stroke width for the full legend.", + "type": "number" }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "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\"`." + ] + }, + "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": { - "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", - "items": { - "type": "number" - }, - "type": "array" + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "symbolDashOffset": { - "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", - "type": "number" + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "symbolDirection": { - "$ref": "#/definitions/Orientation", - "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for symbol legends.\n\n__Default value:__ `\"vertical\"`." + "anyOf": [ + { + "$ref": "#/definitions/Orientation", + "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for symbol legends.\n\n__Default value:__ `\"vertical\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "symbolFillColor": { "anyOf": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend symbol," }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "The color of the legend symbol," + ] }, "symbolLimit": { - "description": "The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.", - "type": "number" + "anyOf": [ + { + "description": "The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "symbolOffset": { - "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", - "type": "number" + "anyOf": [ + { + "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "symbolOpacity": { - "description": "Opacity of the legend symbols.", - "type": "number" + "anyOf": [ + { + "description": "Opacity of the legend symbols.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "symbolSize": { - "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "symbolStrokeColor": { "anyOf": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Stroke color for legend symbols." }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Stroke color for legend symbols." + ] }, "symbolStrokeWidth": { - "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "symbolType": { - "$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\"`." + "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": { - "$ref": "#/definitions/TickCount", - "description": "The desired number of tick values for quantitative legends." + "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": { - "$ref": "#/definitions/Align", - "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleAnchor": { - "$ref": "#/definitions/TitleAnchor", - "description": "Text anchor position for placing legend titles." + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing legend titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleBaseline": { - "$ref": "#/definitions/TextBaseline", - "description": "Vertical text baseline for legend titles.\n\n__Default value:__ `\"top\"`." + "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": [ { - "type": "null" + "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/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "The color of the legend title, can be in hex color code or regular color name." + ] }, "titleFont": { - "description": "The font of the legend title.", - "type": "string" + "anyOf": [ + { + "description": "The font of the legend title.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontSize": { - "description": "The font size of the legend title.", - "type": "number" + "anyOf": [ + { + "description": "The font size of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style of the legend title." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleFontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight of the legend title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleLineHeight": { - "description": "Line height in pixels for multi-line title text.", - "type": "number" + "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": { - "description": "Opacity of the legend title.", - "type": "number" + "anyOf": [ + { + "description": "Opacity of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titleOrient": { - "$ref": "#/definitions/Orient", - "description": "Orientation of the legend title." + "anyOf": [ + { + "$ref": "#/definitions/Orient", + "description": "Orientation of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "titlePadding": { - "description": "The padding, in pixels, between title and legend.\n\n__Default value:__ `5`.", - "type": "number" + "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" - } - }, - "type": "object" - }, - "LegendOrient": { - "enum": [ + }, + "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", @@ -10165,6 +14591,9 @@ "LegendResolveMap": { "additionalProperties": false, "properties": { + "angle": { + "$ref": "#/definitions/ResolveMode" + }, "color": { "$ref": "#/definitions/ResolveMode" }, @@ -10221,26 +14650,94 @@ "additionalProperties": false, "properties": { "align": { - "$ref": "#/definitions/Align", - "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`." + "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": { - "description": "The rotation angle of the text, in degrees.", - "maximum": 360, - "minimum": 0, - "type": "number" + "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": { - "description": "Whether to keep aspect ratio of image marks.", - "type": "boolean" + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "baseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline. 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." + "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": { - "$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\"`" + "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": [ @@ -10249,49 +14746,144 @@ }, { "$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`." + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "cornerRadius": { - "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusBottomLeft": { - "description": "The radius in pixels of rounded rectangle bottom left corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusBottomRight": { - "description": "The radius in pixels of rounded rectangle bottom right corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusTopLeft": { - "description": "The radius in pixels of rounded rectangle top right corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusTopRight": { - "description": "The radius in pixels of rounded rectangle top left corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cursor": { - "$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." + "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": { - "$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\"`" + "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": { - "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" + "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": { - "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" + "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": { - "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", - "type": "string" + "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": [ @@ -10303,52 +14895,121 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Fill Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { - "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "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": { - "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", - "type": "string" + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontSize": { - "description": "The font size, in pixels.\n\n__Default value:__ `11`", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style (e.g., `\"italic\"`)." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "description": "Height of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "href": { - "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", - "format": "uri", - "type": "string" - }, - "interpolate": { - "$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." + "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`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"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." + }, + { + "$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.", + "description": "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.", "enum": [ "filter", null @@ -10359,22 +15020,50 @@ ] }, "limit": { - "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" + "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": { - "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" + "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": { - "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", - "type": "number" + "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, - "type": "number" + "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.", @@ -10385,7 +15074,29 @@ }, "orient": { "$ref": "#/definitions/Orientation", - "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould 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\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + "description": "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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "point": { "anyOf": [ @@ -10396,34 +15107,85 @@ "$ref": "#/definitions/OverlayMarkDef" }, { - "enum": [ - "transparent" - ], + "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": { - "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", - "minimum": 0, - "type": "number" + "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." }, - "shape": { + "radius2": { "anyOf": [ { - "$ref": "#/definitions/SymbolShape" + "type": "number" }, { - "type": "string" + "$ref": "#/definitions/ExprRef" } ], - "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\"`" + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "size": { - "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, - "type": "number" + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__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.", + "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": [ @@ -10435,66 +15197,159 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Stroke Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { - "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`", - "type": "string" + "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": { - "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", - "items": { - "type": "number" - }, - "type": "array" + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeDashOffset": { - "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", - "type": "number" + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeJoin": { - "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`", - "type": "string" + "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": { - "description": "The miter limit at which to bevel a line join.", - "type": "number" + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeOffset": { - "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" + "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": { - "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeWidth": { - "description": "The stroke width, in pixels.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "tension": { - "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", - "type": "number" + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "text": { - "$ref": "#/definitions/Text", - "description": "Placeholder text if the `text` channel is not specified" + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "theta": { - "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark `startAngle` and `endAngle` properties: angles are measured in radians, with `0` indicating \"north\".", - "type": "number" + "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." }, "timeUnitBand": { - "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.\nIf set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "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" }, "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.\nIf set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "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" }, "tooltip": { @@ -10511,26 +15366,48 @@ { "$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`" - }, - "width": { - "description": "Width of the marks.", - "type": "number" + "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. - 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.\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`" }, - "x": { + "url": { "anyOf": [ { - "type": "number" + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." }, { - "enum": [ - "width" - ], + "$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." @@ -10541,10 +15418,11 @@ "type": "number" }, { - "enum": [ - "width" - ], + "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." @@ -10555,10 +15433,11 @@ "type": "number" }, { - "enum": [ - "height" - ], + "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." @@ -10569,10 +15448,11 @@ "type": "number" }, { - "enum": [ - "height" - ], + "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." @@ -10584,10 +15464,8 @@ "additionalProperties": false, "properties": { "gradient": { + "const": "linear", "description": "The type of gradient. Use `\"linear\"` for a linear gradient.", - "enum": [ - "linear" - ], "type": "string" }, "id": { @@ -10632,9 +15510,24 @@ "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", @@ -10647,7 +15540,9 @@ "year", "quarter", "month", + "week", "day", + "dayofyear", "date", "hours", "minutes", @@ -10823,7 +15718,7 @@ "description": "Secondary data source to lookup in." }, "fields": { - "description": "Fields in foreign data or selection to lookup.\nIf not specified, the entire object is queried.", + "description": "Fields in foreign data or selection to lookup. If not specified, the entire object is queried.", "items": { "$ref": "#/definitions/FieldName" }, @@ -10844,7 +15739,7 @@ "additionalProperties": false, "properties": { "fields": { - "description": "Fields in foreign data or selection to lookup.\nIf not specified, the entire object is queried.", + "description": "Fields in foreign data or selection to lookup. If not specified, the entire object is queried.", "items": { "$ref": "#/definitions/FieldName" }, @@ -10880,7 +15775,7 @@ "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`\nhas been specified (those field names will be used); if `from.fields`\nhas not been specified, `as` must be a string.\n\nFor selection lookups, this property is optional: if unspecified,\nlooked up values will be stored under a property named for the selection;\nand if specified, it must correspond to `from.fields`." + "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`", @@ -10911,28 +15806,29 @@ "Mark": { "description": "All types of primitive marks.", "enum": [ + "arc", "area", "bar", - "line", "image", - "trail", + "line", "point", - "text", - "tick", "rect", "rule", + "text", + "tick", + "trail", "circle", "square", "geoshape" ], "type": "string" }, - "MarkConfig": { + "MarkConfig<>": { "additionalProperties": false, "properties": { "align": { "$ref": "#/definitions/Align", - "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`." + "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": { "description": "The rotation angle of the text, in degrees.", @@ -10940,13 +15836,25 @@ "minimum": 0, "type": "number" }, + "aria": { + "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" + }, + "ariaRole": { + "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" + }, + "ariaRoleDescription": { + "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" + }, "aspect": { "description": "Whether to keep aspect ratio of image marks.", "type": "boolean" }, "baseline": { "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline. 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." + "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": { "$ref": "#/definitions/Blend", @@ -10961,32 +15869,36 @@ "$ref": "#/definitions/Gradient" } ], - "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`." + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "cornerRadius": { - "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, "cornerRadiusBottomLeft": { - "description": "The radius in pixels of rounded rectangle bottom left corner.\n\n__Default value:__ `0`", + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", "type": "number" }, "cornerRadiusBottomRight": { - "description": "The radius in pixels of rounded rectangle bottom right corner.\n\n__Default value:__ `0`", + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", "type": "number" }, "cornerRadiusTopLeft": { - "description": "The radius in pixels of rounded rectangle top right corner.\n\n__Default value:__ `0`", + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", "type": "number" }, "cornerRadiusTopRight": { - "description": "The radius in pixels of rounded rectangle top left corner.\n\n__Default value:__ `0`", + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", "type": "number" }, "cursor": { "$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." }, + "description": { + "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" + }, "dir": { "$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\"`" @@ -11003,6 +15915,10 @@ "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", "type": "string" }, + "endAngle": { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, "fill": { "anyOf": [ { @@ -11015,7 +15931,7 @@ "type": "null" } ], - "description": "Default Fill Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", @@ -11042,23 +15958,26 @@ }, "fontWeight": { "$ref": "#/definitions/FontWeight", - "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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`)." }, "height": { "description": "Height of the marks.", "type": "number" }, "href": { - "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", - "format": "uri", - "type": "string" + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + "innerRadius": { + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.", + "type": "number" }, "interpolate": { "$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." + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"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." }, "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.", + "description": "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.", "enum": [ "filter", null @@ -11095,11 +16014,22 @@ }, "orient": { "$ref": "#/definitions/Orientation", - "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould 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\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + "description": "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": { + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.", + "type": "number" + }, + "padAngle": { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" }, "radius": { - "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", - "minimum": 0, + "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.", + "type": "number" + }, + "radius2": { + "description": "The secondary (inner) radius in pixels of arc marks.", "type": "number" }, "shape": { @@ -11111,13 +16041,21 @@ "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\"`" + "description": "Shape of the point marks. 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\n__Default value:__ `\"circle\"`" }, "size": { - "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.", + "description": "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.\n\n__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.", "minimum": 0, "type": "number" }, + "smooth": { + "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" + }, + "startAngle": { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, "stroke": { "anyOf": [ { @@ -11130,11 +16068,11 @@ "type": "null" } ], - "description": "Default Stroke Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { - "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`", - "type": "string" + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, "strokeDash": { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", @@ -11148,8 +16086,8 @@ "type": "number" }, "strokeJoin": { - "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`", - "type": "string" + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, "strokeMiterLimit": { "description": "The miter limit at which to bevel a line join.", @@ -11179,15 +16117,21 @@ "description": "Placeholder text if the `text` channel is not specified" }, "theta": { - "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark `startAngle` and `endAngle` properties: angles are measured in radians, with `0` indicating \"north\".", + "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, + "type": "number" + }, + "theta2": { + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise.", "type": "number" }, "timeUnitBand": { - "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.\nIf set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "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" }, "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.\nIf set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "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" }, "tooltip": { @@ -11208,7 +16152,11 @@ "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`" + "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. - 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.\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": { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." }, "width": { "description": "Width of the marks.", @@ -11220,9 +16168,7 @@ "type": "number" }, { - "enum": [ - "width" - ], + "const": "width", "type": "string" } ], @@ -11234,9 +16180,7 @@ "type": "number" }, { - "enum": [ - "width" - ], + "const": "width", "type": "string" } ], @@ -11248,9 +16192,7 @@ "type": "number" }, { - "enum": [ - "height" - ], + "const": "height", "type": "string" } ], @@ -11262,9 +16204,7 @@ "type": "number" }, { - "enum": [ - "height" - ], + "const": "height", "type": "string" } ], @@ -11273,39 +16213,98 @@ }, "type": "object" }, - "MarkDef": { + "MarkConfig": { "additionalProperties": false, "properties": { "align": { - "$ref": "#/definitions/Align", - "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`." + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "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": { - "description": "The rotation angle of the text, in degrees.", - "maximum": 360, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "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/ExprOrSignalRef" + } + ] + }, + "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/ExprOrSignalRef" + } + ] + }, + "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/ExprOrSignalRef" + } + ] }, "aspect": { - "description": "Whether to keep aspect ratio of image marks.", - "type": "boolean" + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "baseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline. 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." - }, - "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" + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "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": { - "$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\"`" - }, - "clip": { - "description": "Whether a mark be clipped to the enclosing group’s width and height.", - "type": "boolean" + "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/ExprOrSignalRef" + } + ] }, "color": { "anyOf": [ @@ -11314,110 +16313,270 @@ }, { "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" } ], - "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`." + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "cornerRadius": { - "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "cornerRadiusBottomLeft": { - "description": "The radius in pixels of rounded rectangle bottom left corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "cornerRadiusBottomRight": { - "description": "The radius in pixels of rounded rectangle bottom right corner.\n\n__Default value:__ `0`", - "type": "number" - }, - "cornerRadiusEnd": { - "description": "- For vertical bars, top-left and top-right corner radius.\n- For horizontal bars, top-right and bottom-right corner radius.", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "cornerRadiusTopLeft": { - "description": "The radius in pixels of rounded rectangle top right corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "cornerRadiusTopRight": { - "description": "The radius in pixels of rounded rectangle top left corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "cursor": { - "$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." - }, - "dir": { - "$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\"`" - }, - "dx": { - "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" - }, - "dy": { - "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" + "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/ExprOrSignalRef" + } + ] }, - "ellipsis": { - "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", - "type": "string" + "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/ExprOrSignalRef" + } + ] }, - "fill": { + "dir": { "anyOf": [ { - "$ref": "#/definitions/Color" + "$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/Gradient" + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "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" }, { - "type": "null" + "$ref": "#/definitions/ExprOrSignalRef" } - ], - "description": "Default Fill Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + ] + }, + "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/ExprOrSignalRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "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/ExprOrSignalRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { - "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "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": { - "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", - "type": "string" + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "fontSize": { - "description": "The font size, in pixels.\n\n__Default value:__ `11`", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "fontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style (e.g., `\"italic\"`)." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "fontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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/ExprOrSignalRef" + } + ] }, "height": { - "description": "Height of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "href": { - "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", - "format": "uri", - "type": "string" + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." }, "interpolate": { - "$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." + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"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." + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "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.", + "description": "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.", "enum": [ "filter", null @@ -11428,33 +16587,50 @@ ] }, "limit": { - "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" - }, - "line": { "anyOf": [ { - "type": "boolean" + "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/OverlayMarkDef" + "$ref": "#/definitions/ExprOrSignalRef" } - ], - "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": { - "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" + "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/ExprOrSignalRef" + } + ] }, "lineHeight": { - "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", - "type": "number" + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], "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, - "type": "number" + "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.", @@ -11465,45 +16641,103 @@ }, "orient": { "$ref": "#/definitions/Orientation", - "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould 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\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + "description": "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." }, - "point": { + "outerRadius": { "anyOf": [ { - "type": "boolean" + "type": "number" }, { - "$ref": "#/definitions/OverlayMarkDef" + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" }, { - "enum": [ - "transparent" - ], - "type": "string" + "$ref": "#/definitions/ExprOrSignalRef" } - ], - "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": { - "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "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." }, - "shape": { + "radius2": { "anyOf": [ { - "$ref": "#/definitions/SymbolShape" + "type": "number" }, { - "type": "string" + "$ref": "#/definitions/ExprOrSignalRef" } ], - "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\"`" + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "size": { - "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, - "type": "number" + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "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.\n\n__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.", + "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/ExprOrSignalRef" + } + ] + }, + "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/ExprOrSignalRef" + } + ] }, "stroke": { "anyOf": [ @@ -11515,85 +16749,159 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" } ], - "description": "Default Stroke Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { - "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`", - "type": "string" + "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/ExprOrSignalRef" + } + ] }, "strokeDash": { - "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", - "items": { - "type": "number" - }, - "type": "array" + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "strokeDashOffset": { - "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", - "type": "number" - }, + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, "strokeJoin": { - "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`", - "type": "string" + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "strokeMiterLimit": { - "description": "The miter limit at which to bevel a line join.", - "type": "number" + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "strokeOffset": { - "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" + "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/ExprOrSignalRef" + } + ] }, "strokeOpacity": { - "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "strokeWidth": { - "description": "The stroke width, in pixels.", - "minimum": 0, - "type": "number" - }, - "style": { "anyOf": [ { - "type": "string" + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" }, { - "items": { - "type": "string" - }, - "type": "array" + "$ref": "#/definitions/ExprOrSignalRef" } - ], - "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.\n__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": { - "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", - "type": "number" + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "text": { - "$ref": "#/definitions/Text", - "description": "Placeholder text if the `text` channel is not specified" + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "theta": { - "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark `startAngle` and `endAngle` properties: angles are measured in radians, with `0` indicating \"north\".", - "type": "number" + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "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 }, - "thickness": { - "description": "Thickness of the tick mark.\n\n__Default value:__ `1`", - "minimum": 0, - "type": "number" + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "timeUnitBand": { - "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.\nIf set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "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" }, "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.\nIf set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "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" }, "tooltip": { @@ -11610,19 +16918,36 @@ { "$ref": "#/definitions/TooltipContent" }, + { + "$ref": "#/definitions/ExprOrSignalRef" + }, { "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`" + "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. - 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.\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\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "width": { - "description": "Width of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] }, "x": { "anyOf": [ @@ -11630,10 +16955,11 @@ "type": "number" }, { - "enum": [ - "width" - ], + "const": "width", "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" } ], "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." @@ -11644,32 +16970,26 @@ "type": "number" }, { - "enum": [ - "width" - ], + "const": "width", "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" } ], "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": { - "description": "Offset for x2-position.", - "type": "number" - }, - "xOffset": { - "description": "Offset for x-position.", - "type": "number" - }, "y": { "anyOf": [ { "type": "number" }, { - "enum": [ - "height" - ], + "const": "height", "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" } ], "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." @@ -11680,494 +17000,256 @@ "type": "number" }, { - "enum": [ - "height" - ], + "const": "height", "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" } ], "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": { - "description": "Offset for y2-position.", - "type": "number" - }, - "yOffset": { - "description": "Offset for y-position.", - "type": "number" } }, - "required": [ - "type" - ], "type": "object" }, - "MarkType": { - "enum": [ - "arc", - "area", - "image", - "group", - "line", - "path", - "rect", - "rule", - "shape", - "symbol", - "text", - "trail" - ], - "type": "string" - }, - "MergedStream": { + "MarkConfig": { "additionalProperties": false, "properties": { - "between": { - "items": { - "$ref": "#/definitions/Stream" - }, - "type": "array" - }, - "consume": { - "type": "boolean" - }, - "debounce": { - "type": "number" + "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." }, - "filter": { + "angle": { "anyOf": [ { - "$ref": "#/definitions/Expr" + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" }, { - "items": { - "$ref": "#/definitions/Expr" - }, - "type": "array" + "$ref": "#/definitions/ExprRef" } ] }, - "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" - }, - "MultiSelection": { - "additionalProperties": false, - "properties": { - "bind": { - "$ref": "#/definitions/LegendBinding", - "description": "When set, a selection is populated by interacting with the corresponding legend. Direct manipulation interaction is disabled by default;\nto 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." + "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" + } + ] }, - "clear": { + "ariaRole": { "anyOf": [ { - "$ref": "#/definitions/Stream" + "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" } - ], - "description": "Clears the selection, emptying it of all values. Can be a\n[Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + ] }, - "empty": { - "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", - "enum": [ - "all", - "none" - ], - "type": "string" - }, - "encodings": { - "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", - "items": { - "$ref": "#/definitions/SingleDefUnitChannel" - }, - "type": "array" - }, - "fields": { - "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", - "items": { - "$ref": "#/definitions/FieldName" - }, - "type": "array" - }, - "init": { - "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial\nvalue (or array of values).\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation.", - "items": { - "$ref": "#/definitions/SelectionInitMapping" - }, - "type": "array" - }, - "nearest": { - "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", - "type": "boolean" - }, - "on": { + "baseline": { "anyOf": [ { - "$ref": "#/definitions/Stream" + "$ref": "#/definitions/TextBaseline" }, { - "type": "string" + "$ref": "#/definitions/ExprRef" } ], - "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + "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." }, - "resolve": { - "$ref": "#/definitions/SelectionResolution", - "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." - }, - "toggle": { - "description": "Controls whether data values should be toggled or only ever inserted into\nmulti selections. Can be `true`, `false` (for insertion only), or a\n[Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,\ndata values are toggled when a user interacts with the shift-key pressed).\n\n__See also:__ [`toggle`](https://vega.github.io/vega-lite/docs/toggle.html) documentation.", - "type": [ - "string", - "boolean" + "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" + } ] }, - "type": { - "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `\"single\"` -- to select a single discrete data value on `click`.\n- `\"multi\"` -- to select multiple discrete data value; 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`.", - "enum": [ - "multi" - ], - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object" - }, - "MultiSelectionConfig": { - "additionalProperties": false, - "properties": { - "bind": { - "$ref": "#/definitions/LegendBinding", - "description": "When set, a selection is populated by interacting with the corresponding legend. Direct manipulation interaction is disabled by default;\nto 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." - }, - "clear": { + "color": { "anyOf": [ { - "$ref": "#/definitions/Stream" + "$ref": "#/definitions/Color" }, { - "type": "string" + "$ref": "#/definitions/Gradient" }, { - "type": "boolean" + "$ref": "#/definitions/ExprRef" } ], - "description": "Clears the selection, emptying it of all values. Can be a\n[Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." - }, - "empty": { - "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", - "enum": [ - "all", - "none" - ], - "type": "string" - }, - "encodings": { - "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", - "items": { - "$ref": "#/definitions/SingleDefUnitChannel" - }, - "type": "array" - }, - "fields": { - "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", - "items": { - "$ref": "#/definitions/FieldName" - }, - "type": "array" - }, - "init": { - "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial\nvalue (or array of values).\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation.", - "items": { - "$ref": "#/definitions/SelectionInitMapping" - }, - "type": "array" - }, - "nearest": { - "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", - "type": "boolean" + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, - "on": { + "cornerRadius": { "anyOf": [ { - "$ref": "#/definitions/Stream" + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" }, { - "type": "string" + "$ref": "#/definitions/ExprRef" } - ], - "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." - }, - "resolve": { - "$ref": "#/definitions/SelectionResolution", - "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + ] }, - "toggle": { - "description": "Controls whether data values should be toggled or only ever inserted into\nmulti selections. Can be `true`, `false` (for insertion only), or a\n[Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,\ndata values are toggled when a user interacts with the shift-key pressed).\n\n__See also:__ [`toggle`](https://vega.github.io/vega-lite/docs/toggle.html) documentation.", - "type": [ - "string", - "boolean" + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } ] - } - }, - "type": "object" - }, - "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." + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "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" - }, - "NumericArrayFieldDefWithCondition": { - "$ref": "#/definitions/FieldDefWithCondition" - }, - "NumericArrayValueDefWithCondition": { - "$ref": "#/definitions/ValueDefWithCondition" - }, - "NumericFieldDefWithCondition": { - "$ref": "#/definitions/FieldDefWithCondition" - }, - "NumericValueWithCondition": { - "$ref": "#/definitions/ValueWithCondition" - }, - "OrderFieldDef": { - "additionalProperties": false, - "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "bin": { + "cornerRadiusTopRight": { "anyOf": [ { - "type": "boolean" + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" }, { - "$ref": "#/definitions/BinParams" + "$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." }, { - "enum": [ - "binned" - ], + "$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" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } - ], - "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\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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" + } + ] }, - "sort": { - "$ref": "#/definitions/SortOrder", - "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`." + "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" + } + ] }, - "timeUnit": { + "dy": { "anyOf": [ { - "$ref": "#/definitions/TimeUnit" + "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/TimeUnitParams" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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": { + "ellipsis": { "anyOf": [ { - "$ref": "#/definitions/Text" + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } - ], - "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/docs/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 encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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": [ - "type" - ], - "type": "object" - }, - "Orient": { - "enum": [ - "left", - "right", - "top", - "bottom" - ], - "type": "string" - }, - "Orientation": { - "enum": [ - "horizontal", - "vertical" - ], - "type": "string" - }, - "OverlayMarkDef": { - "additionalProperties": false, - "properties": { - "align": { - "$ref": "#/definitions/Align", - "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`." - }, - "angle": { - "description": "The rotation angle of the text, in degrees.", - "maximum": 360, - "minimum": 0, - "type": "number" - }, - "aspect": { - "description": "Whether to keep aspect ratio of image marks.", - "type": "boolean" - }, - "baseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline. 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." - }, - "blend": { - "$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\"`" - }, - "clip": { - "description": "Whether a mark be clipped to the enclosing group’s width and height.", - "type": "boolean" - }, - "color": { + "endAngle": { "anyOf": [ { - "$ref": "#/definitions/Color" + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" }, { - "$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": { - "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", - "type": "number" - }, - "cornerRadiusBottomLeft": { - "description": "The radius in pixels of rounded rectangle bottom left corner.\n\n__Default value:__ `0`", - "type": "number" - }, - "cornerRadiusBottomRight": { - "description": "The radius in pixels of rounded rectangle bottom right corner.\n\n__Default value:__ `0`", - "type": "number" - }, - "cornerRadiusTopLeft": { - "description": "The radius in pixels of rounded rectangle top right corner.\n\n__Default value:__ `0`", - "type": "number" - }, - "cornerRadiusTopRight": { - "description": "The radius in pixels of rounded rectangle top left corner.\n\n__Default value:__ `0`", - "type": "number" - }, - "cursor": { - "$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." - }, - "dir": { - "$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\"`" - }, - "dx": { - "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" - }, - "dy": { - "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" - }, - "ellipsis": { - "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", - "type": "string" + ] }, "fill": { "anyOf": [ @@ -12179,52 +17261,121 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Fill Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { - "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "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": { - "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", - "type": "string" + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontSize": { - "description": "The font size, in pixels.\n\n__Default value:__ `11`", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style (e.g., `\"italic\"`)." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "description": "Height of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "href": { - "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", - "format": "uri", - "type": "string" + "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`." }, "interpolate": { - "$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." + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"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." + }, + { + "$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.", + "description": "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.", "enum": [ "filter", null @@ -12235,22 +17386,50 @@ ] }, "limit": { - "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" + "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": { - "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" + "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": { - "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", - "type": "number" + "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, - "type": "number" + "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.", @@ -12261,113 +17440,267 @@ }, "orient": { "$ref": "#/definitions/Orientation", - "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould 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\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." - }, - "radius": { - "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", - "minimum": 0, - "type": "number" + "description": "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." }, - "shape": { + "outerRadius": { "anyOf": [ { - "$ref": "#/definitions/SymbolShape" + "type": "number" }, { - "type": "string" + "$ref": "#/definitions/ExprRef" } ], - "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\"`" + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." }, - "size": { - "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, - "type": "number" + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "stroke": { + "radius": { "anyOf": [ { - "$ref": "#/definitions/Color" + "type": "number" }, { - "$ref": "#/definitions/Gradient" + "$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." + }, + "radius2": { + "anyOf": [ + { + "type": "number" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Stroke Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "The secondary (inner) radius in pixels of arc marks." }, - "strokeCap": { - "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`", - "type": "string" + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "strokeDash": { - "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", - "items": { - "type": "number" - }, - "type": "array" + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__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.", + "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": { - "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", - "type": "number" + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeJoin": { - "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`", - "type": "string" + "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": { - "description": "The miter limit at which to bevel a line join.", - "type": "number" + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeOffset": { - "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" + "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": { - "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeWidth": { - "description": "The stroke width, in pixels.", - "minimum": 0, - "type": "number" - }, - "style": { "anyOf": [ { - "type": "string" + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" }, { - "items": { - "type": "string" - }, - "type": "array" + "$ref": "#/definitions/ExprRef" } - ], - "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.\n__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": { - "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", - "type": "number" + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "text": { - "$ref": "#/definitions/Text", - "description": "Placeholder text if the `text` channel is not specified" + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "theta": { - "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark `startAngle` and `endAngle` properties: angles are measured in radians, with `0` indicating \"north\".", - "type": "number" + "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." }, "timeUnitBand": { - "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.\nIf set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "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" }, "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.\nIf set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "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" }, "tooltip": { @@ -12384,15 +17717,36 @@ { "$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`" + "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. - 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.\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": { - "description": "Width of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "x": { "anyOf": [ @@ -12400,10 +17754,11 @@ "type": "number" }, { - "enum": [ - "width" - ], + "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." @@ -12414,32 +17769,26 @@ "type": "number" }, { - "enum": [ - "width" - ], + "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": { - "description": "Offset for x2-position.", - "type": "number" - }, - "xOffset": { - "description": "Offset for x-position.", - "type": "number" - }, "y": { "anyOf": [ { "type": "number" }, { - "enum": [ - "height" - ], + "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." @@ -12450,831 +17799,406 @@ "type": "number" }, { - "enum": [ - "height" - ], + "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": { - "description": "Offset for y2-position.", - "type": "number" - }, - "yOffset": { - "description": "Offset for y-position.", - "type": "number" } }, "type": "object" }, - "Padding": { - "anyOf": [ - { - "type": "number" + "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." }, - { - "additionalProperties": false, - "properties": { - "bottom": { + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, "type": "number" }, - "left": { - "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" }, - "right": { - "type": "number" + { + "$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" }, - "top": { - "type": "number" + { + "$ref": "#/definitions/ExprRef" } - }, - "type": "object" - } - ], - "minimum": 0 - }, - "Parse": { - "additionalProperties": { - "$ref": "#/definitions/ParseValue" - }, - "type": "object" - }, - "ParseValue": { - "anyOf": [ - { - "type": "null" - }, - { - "type": "string" - }, - { - "enum": [ - "string" - ], - "type": "string" - }, - { - "enum": [ - "boolean" - ], - "type": "string" + ] }, - { - "enum": [ - "date" - ], - "type": "string" + "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" + } + ] }, - { - "enum": [ - "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" + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "limit": { - "description": "An optional parameter indicating the maximum number of pivoted fields to generate.\nThe default (`0`) applies no limit. The pivoted `pivot` names are sorted in ascending order prior to enforcing the limit.\n__Default value:__ `0`", + "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" }, - "op": { - "description": "The aggregation operation to apply to grouped `value` field values.\n__Default value:__ `sum`", - "type": "string" - }, - "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" - }, - "PositionFieldDef": { - "additionalProperties": false, - "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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": { + "baseline": { "anyOf": [ { - "$ref": "#/definitions/Axis" + "$ref": "#/definitions/TextBaseline" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } ], - "description": "An object defining properties of axis's gridlines, ticks and labels.\nIf `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." + "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." }, - "band": { - "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band) or time units. If set to `1`, the mark size is set to the bandwidth or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", - "maximum": 1, + "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" }, - "bin": { + "blend": { "anyOf": [ { - "type": "boolean" + "$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/BinParams" + "$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" }, { - "enum": [ - "binned" - ], - "type": "string" + "$ref": "#/definitions/Gradient" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } ], - "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." + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, - "field": { - "$ref": "#/definitions/Field", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "continuousBandSize": { + "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" }, - "impute": { + "cornerRadius": { "anyOf": [ { - "$ref": "#/definitions/ImputeParams" + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } - ], - "description": "An object defining the properties of the Impute Operation to be applied.\nThe field value of the other positional channel is taken as `key` of the `Impute` Operation.\nThe 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": { + "cornerRadiusBottomLeft": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } - ], - "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": { + "cornerRadiusBottomRight": { "anyOf": [ { - "$ref": "#/definitions/StackOffset" + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusEnd": { + "anyOf": [ + { + "type": "number" }, { - "type": "boolean" + "$ref": "#/definitions/ExprRef" } ], - "description": "Type of stacking offset if the field should be stacked.\n`stack` is only applicable for `x` and `y` channels with continuous domains.\nFor 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:\n(1) the mark is `bar` or `area`;\n(2) the stacked measure channel (x or y) has a linear scale;\n(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." + "description": "- For vertical bars, top-left and top-right corner radius. - For horizontal bars, top-right and bottom-right corner radius." }, - "timeUnit": { + "cornerRadiusTopLeft": { "anyOf": [ { - "$ref": "#/definitions/TimeUnit" + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" }, { - "$ref": "#/definitions/TimeUnitParams" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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": { + "cornerRadiusTopRight": { "anyOf": [ { - "$ref": "#/definitions/Text" + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } - ], - "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/docs/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 encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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": [ - "type" - ], - "type": "object" - }, - "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/SelectionPredicate" - }, - { - "type": "string" - } - ] - }, - "Projection": { - "additionalProperties": false, - "properties": { - "center": { - "$ref": "#/definitions/Vector2", - "description": "The projection's center, a two-element array of longitude and latitude in degrees.\n\n__Default value:__ `[0, 0]`" - }, - "clipAngle": { - "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" - }, - "clipExtent": { - "$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." - }, - "coefficient": { - "type": "number" - }, - "distance": { - "type": "number" - }, - "extent": { - "$ref": "#/definitions/Vector2>" + ] }, - "fit": { + "cursor": { "anyOf": [ { - "$ref": "#/definitions/Fit" + "$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." }, { - "items": { - "$ref": "#/definitions/Fit" - }, - "type": "array" + "$ref": "#/definitions/ExprRef" } ] }, - "fraction": { - "type": "number" + "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" + } + ] }, - "lobes": { - "type": "number" - }, - "parallel": { - "type": "number" - }, - "parallels": { - "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" - }, - "pointRadius": { - "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" - }, - "precision": { - "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" - }, - "radius": { - "type": "number" - }, - "ratio": { - "type": "number" - }, - "reflectX": { - "type": "boolean" - }, - "reflectY": { - "type": "boolean" - }, - "rotate": { + "dir": { "anyOf": [ { - "$ref": "#/definitions/Vector2" + "$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/Vector3" + "$ref": "#/definitions/ExprRef" } - ], - "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]`" - }, - "scale": { - "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.", - "type": "number" - }, - "size": { - "$ref": "#/definitions/Vector2" - }, - "spacing": { - "type": "number" + ] }, - "tilt": { + "discreteBandSize": { + "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, "type": "number" }, - "translate": { - "$ref": "#/definitions/Vector2", - "description": "The projection’s translation offset as a two-element array `[tx, ty]`." - }, - "type": { - "$ref": "#/definitions/ProjectionType", - "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:__ `mercator`" - } - }, - "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": [ + "dx": { + "anyOf": [ { - "$ref": "#/definitions/FieldName" + "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/FieldName" + "$ref": "#/definitions/ExprRef" } - ], - "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": { - "description": "The type of gradient. Use `\"radial\"` for a radial gradient.", - "enum": [ - "radial" - ], - "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": { + "dy": { "anyOf": [ { - "$ref": "#/definitions/RangeScheme" + "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" }, { - "items": { - "type": "string" - }, - "type": "array" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for categorical data." + ] }, - "diverging": { + "ellipsis": { "anyOf": [ { - "$ref": "#/definitions/RangeScheme" + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" }, { - "items": { - "type": "string" - }, - "type": "array" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for diverging quantitative ramps." + ] }, - "heatmap": { + "fill": { "anyOf": [ { - "$ref": "#/definitions/RangeScheme" + "$ref": "#/definitions/Color" }, { - "items": { - "type": "string" - }, - "type": "array" + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for quantitative heatmaps." + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, - "ordinal": { + "fillOpacity": { "anyOf": [ { - "$ref": "#/definitions/RangeScheme" + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" }, { - "items": { - "type": "string" - }, - "type": "array" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for rank-ordered data." + ] }, - "ramp": { + "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": [ { - "$ref": "#/definitions/RangeScheme" + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" }, { - "items": { - "type": "string" - }, - "type": "array" + "$ref": "#/definitions/ExprRef" } - ], - "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": { + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, "type": "number" }, - "extent": { - "items": { - "type": "number" - }, - "type": "array" - }, - "scheme": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "$ref": "#/definitions/ColorScheme" - } - ] + { + "$ref": "#/definitions/ExprRef" } - }, - "required": [ - "scheme" - ], - "type": "object" - } - ] - }, - "RectConfig": { - "additionalProperties": false, - "properties": { - "align": { - "$ref": "#/definitions/Align", - "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`." - }, - "angle": { - "description": "The rotation angle of the text, in degrees.", - "maximum": 360, - "minimum": 0, - "type": "number" - }, - "aspect": { - "description": "Whether to keep aspect ratio of image marks.", - "type": "boolean" - }, - "baseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline. 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." - }, - "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": { - "$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\"`" + ] }, - "color": { + "fontStyle": { "anyOf": [ { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." }, { - "$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": { - "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", - "type": "number" - }, - "cornerRadiusBottomLeft": { - "description": "The radius in pixels of rounded rectangle bottom left corner.\n\n__Default value:__ `0`", - "type": "number" - }, - "cornerRadiusBottomRight": { - "description": "The radius in pixels of rounded rectangle bottom right corner.\n\n__Default value:__ `0`", - "type": "number" - }, - "cornerRadiusTopLeft": { - "description": "The radius in pixels of rounded rectangle top right corner.\n\n__Default value:__ `0`", - "type": "number" - }, - "cornerRadiusTopRight": { - "description": "The radius in pixels of rounded rectangle top left corner.\n\n__Default value:__ `0`", - "type": "number" - }, - "cursor": { - "$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." - }, - "dir": { - "$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\"`" - }, - "discreteBandSize": { - "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, - "type": "number" - }, - "dx": { - "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" + ] }, - "dy": { - "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" + "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" + } + ] }, - "ellipsis": { - "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", - "type": "string" + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "fill": { + "href": { "anyOf": [ { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." }, { - "$ref": "#/definitions/Gradient" + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Fill Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" - }, - "fillOpacity": { - "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "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": { - "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", - "type": "string" - }, - "fontSize": { - "description": "The font size, in pixels.\n\n__Default value:__ `11`", - "minimum": 0, - "type": "number" - }, - "fontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style (e.g., `\"italic\"`)." - }, - "fontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." - }, - "height": { - "description": "Height of the marks.", - "type": "number" - }, - "href": { - "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", - "format": "uri", - "type": "string" + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." }, "interpolate": { - "$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." + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"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." + }, + { + "$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.", + "description": "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.", "enum": [ "filter", null @@ -13285,22 +18209,61 @@ ] }, "limit": { - "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" + "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": { - "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" + "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": { - "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", - "type": "number" + "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, - "type": "number" + "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.", @@ -13311,552 +18274,698 @@ }, "orient": { "$ref": "#/definitions/Orientation", - "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould 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\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." - }, - "radius": { - "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", - "minimum": 0, - "type": "number" + "description": "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." }, - "shape": { + "outerRadius": { "anyOf": [ { - "$ref": "#/definitions/SymbolShape" + "type": "number" }, { - "type": "string" + "$ref": "#/definitions/ExprRef" } ], - "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\"`" + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." }, - "size": { - "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, - "type": "number" + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "stroke": { + "point": { "anyOf": [ { - "$ref": "#/definitions/Color" + "type": "boolean" }, { - "$ref": "#/definitions/Gradient" + "$ref": "#/definitions/OverlayMarkDef" }, { - "type": "null" + "const": "transparent", + "type": "string" } ], - "description": "Default Stroke Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" - }, - "strokeCap": { - "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`", - "type": "string" - }, - "strokeDash": { - "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", - "items": { - "type": "number" - }, - "type": "array" - }, - "strokeDashOffset": { - "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", - "type": "number" - }, - "strokeJoin": { - "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`", - "type": "string" - }, - "strokeMiterLimit": { - "description": "The miter limit at which to bevel a line join.", - "type": "number" - }, - "strokeOffset": { - "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" - }, - "strokeOpacity": { - "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "strokeWidth": { - "description": "The stroke width, in pixels.", - "minimum": 0, - "type": "number" + "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`." }, - "tension": { - "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", - "type": "number" + "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." }, - "text": { - "$ref": "#/definitions/Text", - "description": "Placeholder text if the `text` channel is not specified" + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." }, - "theta": { - "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark `startAngle` and `endAngle` properties: angles are measured in radians, with `0` indicating \"north\".", - "type": "number" + "radius2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for radius2." }, - "timeUnitBand": { - "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.\nIf set to `0.5`, bandwidth of the marks will be half of the time unit band step.", - "type": "number" + "radiusOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for radius." }, - "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.\nIf set to `0.5`, the marks will be positioned in the middle of the time unit band step.", - "type": "number" + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "tooltip": { + "size": { "anyOf": [ { "type": "number" }, { - "type": "string" - }, + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__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.", + "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/TooltipContent" + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "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`" + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, - "width": { - "description": "Width of the marks.", - "type": "number" + "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" + } + ] }, - "x": { + "strokeDash": { "anyOf": [ { - "type": "number" + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" }, { - "enum": [ - "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": { + "strokeDashOffset": { "anyOf": [ { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { - "enum": [ - "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": { + "strokeJoin": { "anyOf": [ { - "type": "number" + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { - "enum": [ - "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": { + "strokeMiterLimit": { "anyOf": [ { + "description": "The miter limit at which to bevel a line join.", "type": "number" }, { - "enum": [ - "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": [ + ] + }, + "strokeOffset": { + "anyOf": [ { - "$ref": "#/definitions/FieldName" + "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/FieldName" + "$ref": "#/definitions/ExprRef" } - ], - "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": [ + "strokeOpacity": { + "anyOf": [ { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, "type": "number" }, { - "type": "number" + "$ref": "#/definitions/ExprRef" } - ], - "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" + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "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" + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } ], - "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" + "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)." }, - "params": { - "description": "A boolean flag indicating if the transform should return the regression model parameters (one object per group), rather than trend line points.\nThe resulting objects include a `coef` array of fitted coefficient values (starting with the intercept term and then including terms of increasing order)\nand an `rSquared` value (indicating the total variance explained by the model).\n\n__Default value:__ `false`", - "type": "boolean" + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "regression": { - "$ref": "#/definitions/FieldName", - "description": "The data field of the dependent variable to predict." - } - }, - "required": [ - "regression", - "on" - ], - "type": "object" - }, - "RepeatMapping": { - "additionalProperties": false, - "properties": { - "column": { - "description": "An array of fields to be repeated horizontally.", - "items": { - "type": "string" - }, - "type": "array" + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "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" + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } ], - "type": "string" - } - }, - "required": [ - "repeat" - ], - "type": "object" - }, - "RepeatSpec": { - "additionalProperties": false, - "description": "Base interface for a repeat specification.", - "properties": { - "align": { + "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": [ { - "$ref": "#/definitions/LayoutAlign" + "type": "number" }, { - "$ref": "#/definitions/RowCol" + "$ref": "#/definitions/ExprRef" } ], - "description": "The alignment to apply to grid rows and columns.\nThe 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\"`." + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, - "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" + "theta2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } ], - "type": "string" + "description": "Offset for theta2." }, - "center": { + "thetaOffset": { "anyOf": [ { - "type": "boolean" + "type": "number" }, { - "$ref": "#/definitions/RowCol" + "$ref": "#/definitions/ExprRef" } ], - "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`" + "description": "Offset for theta." }, - "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\n`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`).", + "thickness": { + "description": "Thickness of the tick mark.\n\n__Default value:__ `1`", + "minimum": 0, "type": "number" }, - "data": { + "timeUnitBand": { + "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" + }, + "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" + }, + "tooltip": { "anyOf": [ { - "$ref": "#/definitions/Data" + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" }, { "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": "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. - 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.\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`" }, - "description": { - "description": "Description of this mark for commenting purpose.", - "type": "string" + "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\"`)." }, - "name": { - "description": "Name of the visualization for later reference.", - "type": "string" + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "repeat": { + "width": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "description": "Width of the marks.", + "type": "number" }, { - "$ref": "#/definitions/RepeatMapping" + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Definition for fields to be repeated. One of:\n1) 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.\n2) 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." + "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." }, - "resolve": { - "$ref": "#/definitions/Resolve", - "description": "Scale, axis, and legend resolutions for view composition specifications." + "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." }, - "spacing": { + "x2Offset": { "anyOf": [ { "type": "number" }, { - "$ref": "#/definitions/RowCol" + "$ref": "#/definitions/ExprRef" } ], - "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent 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)" + "description": "Offset for x2-position." }, - "spec": { - "$ref": "#/definitions/Spec", - "description": "A specification of the view that gets repeated." + "xOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for x-position." }, - "title": { + "y": { "anyOf": [ { - "$ref": "#/definitions/Text" + "type": "number" }, { - "$ref": "#/definitions/TitleParams" + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Title for the plot." + "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." }, - "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" - }, - "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" + "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." }, - "legend": { - "$ref": "#/definitions/LegendResolveMap" + "y2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for y2-position." }, - "scale": { - "$ref": "#/definitions/ScaleResolveMap" + "yOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for y-position." } }, + "required": [ + "type" + ], "type": "object" }, - "ResolveMode": { - "enum": [ - "independent", - "shared" - ], - "type": "string" + "MarkPropDef<(Gradient|string|null)>": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" + } + ] }, - "RowCol": { - "additionalProperties": false, - "properties": { - "column": { - "$ref": "#/definitions/LayoutAlign" + "MarkPropDef<(string|null),TypeForShape>": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition,(string|null)>" }, - "row": { - "$ref": "#/definitions/LayoutAlign" + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition,(string|null)>" } - }, - "type": "object" + ] }, - "RowCol": { - "additionalProperties": false, - "properties": { - "column": { - "type": "boolean" + "MarkPropDef": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, - "row": { - "type": "boolean" + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" } - }, - "type": "object" + ] }, - "RowCol": { - "additionalProperties": false, - "properties": { - "column": { - "type": "number" + "MarkPropDef": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, - "row": { - "type": "number" + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" } - }, - "type": "object" + ] }, - "RowColumnEncodingFieldDef": { + "MarkType": { + "enum": [ + "arc", + "area", + "image", + "group", + "line", + "path", + "rect", + "rule", + "shape", + "symbol", + "text", + "trail" + ], + "type": "string" + }, + "MergedStream": { "additionalProperties": false, "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "between": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" }, - "align": { - "$ref": "#/definitions/LayoutAlign", - "description": "The alignment to apply to row/column facet's subplot.\nThe 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\"`." + "consume": { + "type": "boolean" }, - "bin": { + "debounce": { + "type": "number" + }, + "filter": { "anyOf": [ { - "type": "boolean" - }, - { - "$ref": "#/definitions/BinParams" + "$ref": "#/definitions/Expr" }, { - "type": "null" + "items": { + "$ref": "#/definitions/Expr" + }, + "type": "array" } - ], - "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" + "markname": { + "type": "string" }, - "field": { - "$ref": "#/definitions/Field", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "marktype": { + "$ref": "#/definitions/MarkType" }, - "header": { - "$ref": "#/definitions/Header", - "description": "An object defining properties of a facet's header." + "merge": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" }, - "sort": { + "throttle": { + "type": "number" + } + }, + "required": [ + "merge" + ], + "type": "object" + }, + "Month": { + "maximum": 12, + "minimum": 1, + "type": "number" + }, + "MultiSelection": { + "additionalProperties": false, + "properties": { + "bind": { + "$ref": "#/definitions/LegendBinding", + "description": "When set, a selection is populated 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." + }, + "clear": { "anyOf": [ { - "$ref": "#/definitions/SortArray" - }, - { - "$ref": "#/definitions/SortOrder" + "$ref": "#/definitions/Stream" }, { - "$ref": "#/definitions/EncodingSortField" + "type": "string" }, { - "type": "null" + "type": "boolean" } ], - "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" + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." }, - "timeUnit": { - "anyOf": [ - { - "$ref": "#/definitions/TimeUnit" - }, - { - "$ref": "#/definitions/TimeUnitParams" - } + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "type": "string" }, - "title": { + "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:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) 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:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial value (or array of values).\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation.", + "items": { + "$ref": "#/definitions/SelectionInitMapping" + }, + "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__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "type": "boolean" + }, + "on": { "anyOf": [ { - "$ref": "#/definitions/Text" + "$ref": "#/definitions/Stream" }, { - "type": "null" + "type": "string" } ], - "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/docs/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." + "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)." + }, + "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\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "toggle": { + "description": "Controls whether data values should be toggled or only ever inserted into multi selections. Can be `true`, `false` (for insertion only), or a [Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e., data values are toggled when a user interacts with the shift-key pressed).\n\nSetting the value to the Vega expression `\"true\"` will toggle data values without the user pressing the shift-key.\n\n__See also:__ [`toggle`](https://vega.github.io/vega-lite/docs/toggle.html) documentation.", + "type": [ + "string", + "boolean" + ] }, "type": { - "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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." + "const": "multi", + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `\"single\"` -- to select a single discrete data value on `click`. - `\"multi\"` -- to select multiple discrete data value; 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`.", + "type": "string" } }, "required": [ @@ -13864,791 +18973,8401 @@ ], "type": "object" }, - "SampleTransform": { + "MultiSelectionConfig": { "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": { - "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`", - "type": "number" - }, - "base": { - "description": "The logarithm base of the `log` scale (default `10`).", - "type": "number" - }, - "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": { - "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).", - "type": "boolean" - }, - "constant": { - "description": "A constant determining the slope of the symlog function around zero. Only used for `symlog` scales.\n\n__Default value:__ `1`", - "type": "number" + "bind": { + "$ref": "#/definitions/LegendBinding", + "description": "When set, a selection is populated 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." }, - "domain": { + "clear": { "anyOf": [ { - "items": { - "anyOf": [ - { - "type": "null" - }, - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "$ref": "#/definitions/DateTime" - } - ] - }, - "type": "array" + "$ref": "#/definitions/Stream" }, { - "enum": [ - "unaggregated" - ], "type": "string" }, { - "$ref": "#/definitions/SelectionExtent" + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "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:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) 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:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial value (or array of values).\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation.", + "items": { + "$ref": "#/definitions/SelectionInitMapping" + }, + "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__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "type": "boolean" + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" }, { - "$ref": "#/definitions/DomainUnionWith" + "type": "string" } ], - "description": "Customized domain values in the form of constant values or dynamic values driven by a selection.\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 selection that [interactively determines](https://vega.github.io/vega-lite/docs/selection.html#scale-domains) the scale domain." + "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)." }, - "domainMid": { - "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.", - "type": "number" + "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\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." }, - "exponent": { - "description": "The exponent of the `pow` scale.", - "type": "number" + "toggle": { + "description": "Controls whether data values should be toggled or only ever inserted into multi selections. Can be `true`, `false` (for insertion only), or a [Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e., data values are toggled when a user interacts with the shift-key pressed).\n\nSetting the value to the Vega expression `\"true\"` will toggle data values without the user pressing the shift-key.\n\n__See also:__ [`toggle`](https://vega.github.io/vega-lite/docs/toggle.html) documentation.", + "type": [ + "string", + "boolean" + ] + } + }, + "type": "object" + }, + "MultiTimeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/LocalMultiTimeUnit" }, - "interpolate": { + { + "$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/ScaleInterpolateEnum" + "$ref": "#/definitions/LayoutAlign" }, { - "$ref": "#/definitions/ScaleInterpolateParams" + "$ref": "#/definitions/RowCol" } ], - "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`" + "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. - 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.\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\"`." }, - "nice": { + "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. - 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" }, { - "type": "number" - }, + "$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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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/TimeInterval" + "$ref": "#/definitions/Data" }, { - "$ref": "#/definitions/TimeIntervalStep" + "type": "null" } ], - "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; `false` otherwise." - }, - "padding": { - "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`.\nFor _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, - "type": "number" + "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." }, - "paddingInner": { - "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, - "type": "number" + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" }, - "paddingOuter": { - "description": "The outer padding (spacing) at the ends of the range of band and point scales,\nas 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.\nBy default, Vega-Lite sets outer padding such that _width/height = number of unique values * step_.", - "maximum": 1, - "minimum": 0, - "type": "number" + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" }, - "range": { + "repeat": { "anyOf": [ - { - "$ref": "#/definitions/RangeEnum" - }, { "items": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string" - }, - { - "items": { - "type": "number" - }, - "type": "array" - } - ] + "type": "string" }, "type": "array" + }, + { + "$ref": "#/definitions/RepeatMapping" } ], - "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.\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`)." - }, - "reverse": { - "description": "If true, reverses the order of the scale range.\n__Default value:__ `false`.", - "type": "boolean" + "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." }, - "round": { - "description": "If `true`, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid.\n\n__Default value:__ `false`.", - "type": "boolean" + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." }, - "scheme": { + "spacing": { "anyOf": [ { - "type": "string" + "type": "number" }, { - "$ref": "#/definitions/SchemeParams" + "$ref": "#/definitions/RowCol" } ], - "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." + "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)" }, - "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": { - "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": "boolean" - } - }, - "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" + "spec": { + "$ref": "#/definitions/Spec", + "description": "A specification of the view that gets repeated." }, - "step": { - "description": "The step size defining the bin interval width.", - "type": "number" + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." }, - "stop": { - "description": "The stopping (highest-valued) bin boundary.\n\n__Default value:__ The highest value of the scale domain will be used.", - "type": "number" + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" } }, "required": [ - "step" + "repeat", + "spec" ], "type": "object" }, - "ScaleBins": { - "anyOf": [ - { - "items": { - "type": "number" - }, - "type": "array" - }, - { - "$ref": "#/definitions/ScaleBinParams" - } - ] + "NumericArrayMarkPropDef": { + "$ref": "#/definitions/MarkPropDef" }, - "ScaleConfig": { + "NumericMarkPropDef": { + "$ref": "#/definitions/MarkPropDef" + }, + "NumericValueDef": { + "$ref": "#/definitions/ValueDef<(number|ExprRef)>" + }, + "OrderFieldDef": { "additionalProperties": false, "properties": { - "bandPaddingInner": { - "description": "Default inner padding for `x` and `y` band-ordinal scales.\n\n__Default value:__\n- `barBandPaddingInner` for bar marks (`0.1` by default)\n- `rectBandPaddingInner` for rect and other marks (`0` by default)", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "bandPaddingOuter": { - "description": "Default outer padding for `x` and `y` band-ordinal scales.\n\n__Default value:__ `paddingInner/2` (which makes _width/height = number of unique values * step_)", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "barBandPaddingInner": { - "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"bar\"` marks.\n\n__Default value:__ `0.1`", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "clamp": { - "description": "If true, values that exceed the data domain are clamped to either the minimum or maximum range value", - "type": "boolean" - }, - "continuousPadding": { - "description": "Default padding for continuous scales.\n\n__Default:__ `5` for continuous x-scale of a vertical bar and continuous y-scale of a horizontal bar.; `0` otherwise.", - "minimum": 0, - "type": "number" - }, - "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" + "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." }, - "pointPadding": { - "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_)", + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", "maximum": 1, "minimum": 0, "type": "number" }, - "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" + "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." }, - "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" + "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`." }, - "rectBandPaddingInner": { - "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"rect\"` marks.\n\n__Default value:__ `0`", - "maximum": 1, - "minimum": 0, - "type": "number" + "sort": { + "$ref": "#/definitions/SortOrder", + "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`." }, - "round": { - "description": "If true, rounds numeric output values to integers.\nThis can be helpful for snapping to the pixel grid.\n(Only available for `x`, `y`, and `size` scales.)", - "type": "boolean" + "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." }, - "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" + "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/docs/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." }, - "xReverse": { - "description": "Reverse x-scale by default (useful for right-to-left charts).", - "type": "boolean" + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": { + "OrderValueDef": { "additionalProperties": false, "properties": { - "gamma": { - "type": "number" + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection 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." }, - "type": { - "enum": [ - "rgb", - "cubehelix", - "cubehelix-long" + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } ], - "type": "string" + "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": [ - "type" + "value" ], "type": "object" }, - "ScaleResolveMap": { - "additionalProperties": false, - "properties": { - "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" - }, - "x": { - "$ref": "#/definitions/ResolveMode" - }, - "y": { - "$ref": "#/definitions/ResolveMode" - } - }, - "type": "object" + "Orient": { + "enum": [ + "left", + "right", + "top", + "bottom" + ], + "type": "string" }, - "ScaleType": { + "Orientation": { "enum": [ - "linear", - "log", - "pow", - "sqrt", - "symlog", - "identity", - "sequential", - "time", - "utc", - "quantile", - "quantize", - "threshold", - "bin-ordinal", - "ordinal", - "point", - "band" + "horizontal", + "vertical" ], "type": "string" }, - "SchemeParams": { + "OverlayMarkDef": { "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" + "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." }, - "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" + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "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\n(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." + "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" + } + ] }, - "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" + "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" + } + ] }, - "field": { - "$ref": "#/definitions/Field", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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" + } + ] }, - "timeUnit": { + "aspect": { "anyOf": [ { - "$ref": "#/definitions/TimeUnit" + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" }, { - "$ref": "#/definitions/TimeUnitParams" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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": { + "baseline": { "anyOf": [ { - "$ref": "#/definitions/Text" + "$ref": "#/definitions/TextBaseline" }, { - "type": "null" + "$ref": "#/definitions/ExprRef" } ], - "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/docs/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/IntervalSelectionConfig", - "description": "The default definition for an [`interval`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations\nfor an interval selection definition (except `type`) may be specified here.\n\nFor instance, setting `interval` to `{\"translate\": false}` disables the ability to move\ninterval selections by default." + "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." }, - "multi": { - "$ref": "#/definitions/MultiSelectionConfig", - "description": "The default definition for a [`multi`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations\nfor a multi selection definition (except `type`) may be specified here.\n\nFor instance, setting `multi` to `{\"toggle\": \"event.altKey\"}` adds additional values to\nmulti selections when clicking with the alt-key pressed by default." - }, - "single": { - "$ref": "#/definitions/SingleSelectionConfig", - "description": "The default definition for a [`single`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations\n for a single selection definition (except `type`) may be specified here.\n\nFor instance, setting `single` to `{\"on\": \"dblclick\"}` populates single selections on double-click by default." - } - }, - "type": "object" - }, - "SelectionDef": { - "anyOf": [ - { - "$ref": "#/definitions/SingleSelection" + "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" + } + ] }, - { - "$ref": "#/definitions/MultiSelection" + "clip": { + "description": "Whether a mark be clipped to the enclosing group’s width and height.", + "type": "boolean" }, - { - "$ref": "#/definitions/IntervalSelection" - } - ] - }, - "SelectionExtent": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "field": { - "$ref": "#/definitions/FieldName", - "description": "The field name to extract selected values for, when a selection is [projected](https://vega.github.io/vega-lite/docs/project.html)\nover multiple fields or encodings." + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" }, - "selection": { - "description": "The name of a selection.", - "type": "string" + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" } - }, - "required": [ - "selection" ], - "type": "object" + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, - { - "additionalProperties": false, - "properties": { - "encoding": { - "$ref": "#/definitions/SingleDefUnitChannel", - "description": "The encoding channel to extract selected values for, when a selection is [projected](https://vega.github.io/vega-lite/docs/project.html)\nover multiple fields or encodings." + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" }, - "selection": { - "description": "The name of a selection.", - "type": "string" + { + "$ref": "#/definitions/ExprRef" } - }, - "required": [ - "selection" - ], - "type": "object" - } - ] - }, - "SelectionInit": { - "anyOf": [ - { - "$ref": "#/definitions/Value" - }, - { - "$ref": "#/definitions/DateTime" - } - ] - }, - "SelectionInitInterval": { - "anyOf": [ - { - "$ref": "#/definitions/Vector2" + ] }, - { - "$ref": "#/definitions/Vector2" + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - { - "$ref": "#/definitions/Vector2" + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - { - "$ref": "#/definitions/Vector2" - } - ] - }, - "SelectionInitIntervalMapping": { - "$ref": "#/definitions/Dict" - }, - "SelectionInitMapping": { - "$ref": "#/definitions/Dict" - }, - "SelectionPredicate": { - "additionalProperties": false, - "properties": { - "selection": { - "$ref": "#/definitions/SelectionComposition", - "description": "Filter using a selection name or a logical composition of selection names." - } - }, - "required": [ - "selection" - ], - "type": "object" - }, - "SelectionResolution": { - "enum": [ - "global", - "union", - "intersect" - ], - "type": "string" - }, - "SequenceGenerator": { - "additionalProperties": false, - "properties": { - "name": { - "description": "Provide a placeholder name and bind data at runtime.", - "type": "string" + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "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\"`" + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, - "start": { - "description": "The starting value of the sequence (inclusive).", - "type": "number" + "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" + } + ] }, - "step": { - "description": "The step value between sequence entries.\n\n__Default value:__ `1`", - "type": "number" + "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" + } + ] }, - "stop": { - "description": "The ending value of the sequence (exclusive).", - "type": "number" - } - }, - "required": [ - "start", - "stop" - ], - "type": "object" - }, - "SequentialMultiHue": { - "enum": [ - "viridis", - "inferno", - "magma", - "plasma", - "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", - "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" - ], - "type": "string" - }, - "SequentialSingleHue": { - "enum": [ - "blues", - "greens", - "greys", - "purples", - "reds", - "oranges" - ], - "type": "string" - }, - "ShapeFieldDefWithCondition": { - "$ref": "#/definitions/FieldDefWithCondition,(string|null)>" - }, - "ShapeValueWithCondition": { - "$ref": "#/definitions/StringValueWithCondition" + "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`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "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.", + "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. - 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "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." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "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: - 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\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__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.", + "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." + }, + "timeUnitBand": { + "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" + }, + "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" + }, + "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. - 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.\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 + }, + "Parameter": { + "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." + }, + "description": { + "description": "A text description of the parameter, useful for inline documentation.", + "type": "string" + }, + "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": { + "description": "Required. A unique name for the 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\".", + "type": "string" + }, + "value": { + "description": "The initial value of the parameter.\n\n__Default value:__ `undefined`" + } + }, + "required": [ + "name" + ], + "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": { + "description": "The aggregation operation to apply to grouped `value` field values. __Default value:__ `sum`", + "type": "string" + }, + "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" + }, + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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: - `\"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). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `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." + }, + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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: - `\"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). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `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." + }, + "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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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: - `\"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). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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: - `\"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). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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/SelectionPredicate" + }, + { + "type": "string" + } + ] + }, + "PrimitiveValue": { + "type": [ + "number", + "string", + "boolean", + "null" + ] + }, + "Projection": { + "additionalProperties": false, + "properties": { + "center": { + "$ref": "#/definitions/Vector2", + "description": "The projection's center, a two-element array of longitude and latitude in degrees.\n\n__Default value:__ `[0, 0]`" + }, + "clipAngle": { + "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" + }, + "clipExtent": { + "$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." + }, + "coefficient": { + "type": "number" + }, + "distance": { + "type": "number" + }, + "extent": { + "$ref": "#/definitions/Vector2>" + }, + "fit": { + "anyOf": [ + { + "$ref": "#/definitions/Fit" + }, + { + "items": { + "$ref": "#/definitions/Fit" + }, + "type": "array" + } + ] + }, + "fraction": { + "type": "number" + }, + "lobes": { + "type": "number" + }, + "parallel": { + "type": "number" + }, + "parallels": { + "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" + }, + "pointRadius": { + "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" + }, + "precision": { + "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" + }, + "radius": { + "type": "number" + }, + "ratio": { + "type": "number" + }, + "reflectX": { + "type": "boolean" + }, + "reflectY": { + "type": "boolean" + }, + "rotate": { + "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]`" + }, + "scale": { + "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.", + "type": "number" + }, + "size": { + "$ref": "#/definitions/Vector2" + }, + "spacing": { + "type": "number" + }, + "tilt": { + "type": "number" + }, + "translate": { + "$ref": "#/definitions/Vector2", + "description": "The projection’s translation offset as a two-element array `[tx, ty]`." + }, + "type": { + "$ref": "#/definitions/ProjectionType", + "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:__ `mercator`" + } + }, + "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" + }, + { + "$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:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - 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": { + "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, + "type": "number" + }, + "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`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "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.", + "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. - 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "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." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__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.", + "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." + }, + "timeUnitBand": { + "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" + }, + "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" + }, + "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. - 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.\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" + }, + { + "$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" + }, + { + "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" + }, + "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. - 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.\n\n__Default value:__ `\"all\"`." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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": { + "$ref": "#/definitions/Header", + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - 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](https://vega.github.io/vega-lite/docs/scale.html#bins) 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": [ + { + "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/SelectionExtent" + }, + { + "$ref": "#/definitions/DomainUnionWith" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Customized domain values in the form of constant values or dynamic values driven by a selection.\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. - An array with more than two entries, for [Piecewise quantitative scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise). - 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 selection 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; `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" + }, + { + "additionalProperties": false, + "properties": { + "field": { + "type": "string" + } + }, + "required": [ + "field" + ], + "type": "object" + } + ], + "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-ordinal scales.\n\n__Default value:__ - `barBandPaddingInner` for bar marks (`0.1` by default) - `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-ordinal scales.\n\n__Default value:__ `paddingInner/2` (which makes _width/height = number of unique values * step_)", + "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 scales.\n\n__Default:__ `5` 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" + }, + "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" + }, + "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" + }, + "y": { + "$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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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/IntervalSelectionConfig", + "description": "The default definition for an [`interval`](https://vega.github.io/vega-lite/docs/selection.html#type) 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." + }, + "multi": { + "$ref": "#/definitions/MultiSelectionConfig", + "description": "The default definition for a [`multi`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations for a multi selection definition (except `type`) may be specified here.\n\nFor instance, setting `multi` to `{\"toggle\": \"event.altKey\"}` adds additional values to multi selections when clicking with the alt-key pressed by default." + }, + "single": { + "$ref": "#/definitions/SingleSelectionConfig", + "description": "The default definition for a [`single`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations for a single selection definition (except `type`) may be specified here.\n\nFor instance, setting `single` to `{\"on\": \"dblclick\"}` populates single selections on double-click by default." + } + }, + "type": "object" + }, + "SelectionDef": { + "anyOf": [ + { + "$ref": "#/definitions/SingleSelection" + }, + { + "$ref": "#/definitions/MultiSelection" + }, + { + "$ref": "#/definitions/IntervalSelection" + } + ] + }, + "SelectionExtent": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "The field name to extract selected values for, when a selection is [projected](https://vega.github.io/vega-lite/docs/project.html) over multiple fields or encodings." + }, + "selection": { + "description": "The name of a selection.", + "type": "string" + } + }, + "required": [ + "selection" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "encoding": { + "$ref": "#/definitions/SingleDefUnitChannel", + "description": "The encoding channel to extract selected values for, when a selection is [projected](https://vega.github.io/vega-lite/docs/project.html) over multiple fields or encodings." + }, + "selection": { + "description": "The name of a selection.", + "type": "string" + } + }, + "required": [ + "selection" + ], + "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" + }, + "SelectionPredicate": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "Filter using a selection name or a logical composition of selection names." + } + }, + "required": [ + "selection" + ], + "type": "object" + }, + "SelectionResolution": { + "enum": [ + "global", + "union", + "intersect" + ], + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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). - 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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" + }, + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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). - 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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" + }, + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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" + }, + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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" + }, + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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. - For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#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](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. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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: - `\"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). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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). - 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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" + }, + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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: - `\"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). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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 selection 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 selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection 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). - 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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\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" + }, + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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: - `\"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). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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" + }, + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [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\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [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\"`). - `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: - `\"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). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "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/docs/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" + } + }, + "type": "object" }, "SingleDefUnitChannel": { "enum": [ @@ -14660,6 +27379,10 @@ "latitude", "longitude2", "latitude2", + "theta", + "theta2", + "radius", + "radius2", "color", "fill", "stroke", @@ -14669,11 +27392,13 @@ "strokeWidth", "strokeDash", "size", + "angle", "shape", "key", "text", "href", - "url" + "url", + "description" ], "type": "string" }, @@ -14695,7 +27420,7 @@ "$ref": "#/definitions/LegendBinding" } ], - "description": "When set, a selection is populated by input elements (also known as dynamic query widgets)\nor by interacting with the corresponding legend. Direct manipulation interaction is disabled by default;\nto 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)\nor 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." + "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." }, "clear": { "anyOf": [ @@ -14709,10 +27434,10 @@ "type": "boolean" } ], - "description": "Clears the selection, emptying it of all values. Can be a\n[Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." }, "empty": { - "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", "enum": [ "all", "none" @@ -14720,14 +27445,14 @@ "type": "string" }, "encodings": { - "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "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:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", "items": { "$ref": "#/definitions/SingleDefUnitChannel" }, "type": "array" }, "fields": { - "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", "items": { "$ref": "#/definitions/FieldName" }, @@ -14738,7 +27463,7 @@ "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." }, "nearest": { - "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "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__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", "type": "boolean" }, "on": { @@ -14750,17 +27475,15 @@ "type": "string" } ], - "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + "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)." }, "resolve": { "$ref": "#/definitions/SelectionResolution", - "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + "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\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." }, "type": { - "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `\"single\"` -- to select a single discrete data value on `click`.\n- `\"multi\"` -- to select multiple discrete data value; 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`.", - "enum": [ - "single" - ], + "const": "single", + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `\"single\"` -- to select a single discrete data value on `click`. - `\"multi\"` -- to select multiple discrete data value; 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`.", "type": "string" } }, @@ -14787,7 +27510,7 @@ "$ref": "#/definitions/LegendBinding" } ], - "description": "When set, a selection is populated by input elements (also known as dynamic query widgets)\nor by interacting with the corresponding legend. Direct manipulation interaction is disabled by default;\nto 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)\nor 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." + "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." }, "clear": { "anyOf": [ @@ -14801,10 +27524,10 @@ "type": "boolean" } ], - "description": "Clears the selection, emptying it of all values. Can be a\n[Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." }, "empty": { - "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", "enum": [ "all", "none" @@ -14812,14 +27535,14 @@ "type": "string" }, "encodings": { - "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "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:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", "items": { "$ref": "#/definitions/SingleDefUnitChannel" }, "type": "array" }, "fields": { - "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", "items": { "$ref": "#/definitions/FieldName" }, @@ -14830,7 +27553,7 @@ "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." }, "nearest": { - "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "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__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", "type": "boolean" }, "on": { @@ -14842,11 +27565,11 @@ "type": "string" } ], - "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + "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)." }, "resolve": { "$ref": "#/definitions/SelectionResolution", - "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + "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\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." } }, "type": "object" @@ -15008,9 +27731,7 @@ "sphere": { "anyOf": [ { - "enum": [ - true - ], + "const": true, "type": "boolean" }, { @@ -15056,7 +27777,7 @@ "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.\nIf a single string(e.g., `\"val\"`) is provided, the end field will be `\"val_end\"`." + "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.", @@ -15066,7 +27787,7 @@ "type": "array" }, "offset": { - "description": "Mode for stacking marks. One of `\"zero\"` (default), `\"center\"`, or `\"normalize\"`.\nThe `\"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\"`", + "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", @@ -15133,7 +27854,13 @@ "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, "bin": { "anyOf": [ @@ -15144,9 +27871,7 @@ "$ref": "#/definitions/BinParams" }, { - "enum": [ - "binned" - ], + "const": "binned", "type": "string" }, { @@ -15157,7 +27882,7 @@ }, "field": { "$ref": "#/definitions/Field", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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": [ @@ -15165,13 +27890,13 @@ "type": "string" }, { - "type": "object" + "$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/usage/compile.html#format-type) that takes `datum.value` and format parameter as input), this property represents the format parameter.\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." + "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). - 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 (`\"number\"` or `\"time\"` or a [registered custom format type](https://vega.github.io/vega-lite/usage/compile.html#format-type)).\n\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "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:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "labelExpr": { @@ -15187,7 +27912,7 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "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": [ @@ -15202,22 +27927,32 @@ }, "type": { "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "type" - ], "type": "object" }, "StringFieldDefWithCondition": { - "$ref": "#/definitions/FieldDefWithCondition" + "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, - "StringValueWithCondition": { - "$ref": "#/definitions/ValueWithCondition,(string|null)>" + "StringValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition" + }, + "StrokeCap": { + "enum": [ + "butt", + "round", + "square" + ], + "type": "string" }, - "StringValueWithCondition": { - "$ref": "#/definitions/ValueWithCondition" + "StrokeJoin": { + "enum": [ + "miter", + "round", + "bevel" + ], + "type": "string" }, "StyleConfigIndex": { "additionalProperties": { @@ -15231,6 +27966,10 @@ ] }, "properties": { + "arc": { + "$ref": "#/definitions/RectConfig", + "description": "Arc-specific Config" + }, "area": { "$ref": "#/definitions/AreaConfig", "description": "Area-Specific Config" @@ -15325,28 +28064,35 @@ "TextBaseline": { "anyOf": [ { - "enum": [ - "alphabetic" - ], + "const": "alphabetic", "type": "string" }, { "$ref": "#/definitions/Baseline" }, { - "enum": [ - "line-top" - ], + "const": "line-top", "type": "string" }, { - "enum": [ - "line-bottom" - ], + "const": "line-bottom", "type": "string" } ] }, + "TextDef": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" + } + ] + }, "TextDirection": { "enum": [ "ltr", @@ -15354,28 +28100,76 @@ ], "type": "string" }, - "TextFieldDefWithCondition": { - "$ref": "#/definitions/FieldDefWithCondition" - }, - "TextValueWithCondition": { - "$ref": "#/definitions/ValueWithCondition" - }, "TickConfig": { "additionalProperties": false, "properties": { "align": { - "$ref": "#/definitions/Align", - "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`." + "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": { - "description": "The rotation angle of the text, in degrees.", - "maximum": 360, - "minimum": 0, - "type": "number" + "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": { - "description": "Whether to keep aspect ratio of image marks.", - "type": "boolean" + "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).", @@ -15383,12 +28177,26 @@ "type": "number" }, "baseline": { - "$ref": "#/definitions/TextBaseline", - "description": "The vertical text baseline. 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." + "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": { - "$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\"`" + "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": [ @@ -15397,49 +28205,144 @@ }, { "$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`." + "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config). - The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "cornerRadius": { - "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusBottomLeft": { - "description": "The radius in pixels of rounded rectangle bottom left corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusBottomRight": { - "description": "The radius in pixels of rounded rectangle bottom right corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusTopLeft": { - "description": "The radius in pixels of rounded rectangle top right corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cornerRadiusTopRight": { - "description": "The radius in pixels of rounded rectangle top left corner.\n\n__Default value:__ `0`", - "type": "number" + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "cursor": { - "$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." + "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": { - "$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\"`" + "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": { - "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" + "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": { - "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" + "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": { - "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", - "type": "string" + "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": [ @@ -15451,52 +28354,121 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Fill Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { - "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "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": { - "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", - "type": "string" + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontSize": { - "description": "The font size, in pixels.\n\n__Default value:__ `11`", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "The font style (e.g., `\"italic\"`)." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": { - "description": "Height of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "href": { - "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", - "format": "uri", - "type": "string" + "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`." }, "interpolate": { - "$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." + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"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." + }, + { + "$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.", + "description": "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.", "enum": [ "filter", null @@ -15507,22 +28479,50 @@ ] }, "limit": { - "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" + "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": { - "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" + "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": { - "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", - "type": "number" + "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, - "type": "number" + "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.", @@ -15533,28 +28533,103 @@ }, "orient": { "$ref": "#/definitions/Orientation", - "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould 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\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + "description": "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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "radius": { - "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", - "minimum": 0, - "type": "number" + "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." }, - "shape": { + "radius2": { "anyOf": [ { - "$ref": "#/definitions/SymbolShape" + "type": "number" }, { - "type": "string" + "$ref": "#/definitions/ExprRef" } ], - "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\"`" + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "size": { - "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, - "type": "number" + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__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.", + "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": [ @@ -15566,59 +28641,152 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], - "description": "Default Stroke Color. This property has higher precedence than `config.color`.\n\n__Default value:__ (None)" + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { - "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`", - "type": "string" + "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": { - "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", - "items": { - "type": "number" - }, - "type": "array" + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeDashOffset": { - "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", - "type": "number" + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeJoin": { - "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`", - "type": "string" + "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": { - "description": "The miter limit at which to bevel a line join.", - "type": "number" + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeOffset": { - "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" + "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": { - "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeWidth": { - "description": "The stroke width, in pixels.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "tension": { - "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", - "type": "number" + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "text": { - "$ref": "#/definitions/Text", - "description": "Placeholder text if the `text` channel is not specified" + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "theta": { - "description": "Polar coordinate angle, in radians, of the text label from the origin determined by the `x` and `y` properties. Values for `theta` follow the same convention of `arc` mark `startAngle` and `endAngle` properties: angles are measured in radians, with `0` indicating \"north\".", - "type": "number" + "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`", @@ -15626,11 +28794,11 @@ "type": "number" }, "timeUnitBand": { - "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.\nIf set to `0.5`, bandwidth of the marks will be half of the time unit band step.", + "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" }, "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.\nIf set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "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" }, "tooltip": { @@ -15647,15 +28815,36 @@ { "$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`" + "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. - 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.\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": { - "description": "Width of the marks.", - "type": "number" + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "x": { "anyOf": [ @@ -15663,10 +28852,11 @@ "type": "number" }, { - "enum": [ - "width" - ], + "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." @@ -15677,10 +28867,11 @@ "type": "number" }, { - "enum": [ - "width" - ], + "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." @@ -15691,10 +28882,11 @@ "type": "number" }, { - "enum": [ - "height" - ], + "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." @@ -15705,10 +28897,11 @@ "type": "number" }, { - "enum": [ - "height" - ], + "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." @@ -15723,6 +28916,9 @@ }, { "$ref": "#/definitions/TimeInterval" + }, + { + "$ref": "#/definitions/TimeIntervalStep" } ] }, @@ -15773,7 +28969,7 @@ "type": "number" }, "step": { - "description": "The number of steps between bins, in terms of the least\nsignificant unit provided.", + "description": "The number of steps between bins, in terms of the least significant unit provided.", "type": "number" }, "unit": { @@ -15858,79 +29054,181 @@ }, "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.\n`\"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\"`." + "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": { - "description": "Angle in degrees of title and subtitle text.", - "type": "number" + "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 `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`." + "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": [ { - "type": "null" + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Text color for title text." }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } - ], - "description": "Text color for title text." + ] }, "dx": { - "description": "Delta offset for title and subtitle text x-coordinate.", - "type": "number" + "anyOf": [ + { + "description": "Delta offset for title and subtitle text x-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "dy": { - "description": "Delta offset for title and subtitle text y-coordinate.", - "type": "number" + "anyOf": [ + { + "description": "Delta offset for title and subtitle text y-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "font": { - "description": "Font name for title text.", - "type": "string" + "anyOf": [ + { + "description": "Font name for title text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontSize": { - "description": "Font size in pixels for title text.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "Font size in pixels for title text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "Font style for title text." + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for title text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "fontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "Font weight for title text.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + "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": [ { - "$ref": "#/definitions/TitleFrame" + "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)." }, { - "type": "string" + "$ref": "#/definitions/ExprRef" } - ], - "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)." + ] }, "limit": { - "description": "The maximum allowed length in pixels of title and subtitle text.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The maximum allowed length in pixels of title and subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "lineHeight": { - "description": "Line height in pixels for multi-line title text.", - "type": "number" + "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": { - "description": "The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.", - "type": "number" + "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": { - "$ref": "#/definitions/TitleOrient", - "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" + "anyOf": [ + { + "$ref": "#/definitions/TitleOrient", + "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "style": { "anyOf": [ @@ -15950,44 +29248,100 @@ "$ref": "#/definitions/Text", "description": "The subtitle Text." }, - "subtitleColor": { + "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": [ { - "type": "null" + "$ref": "#/definitions/Text" }, { - "$ref": "#/definitions/Color" + "$ref": "#/definitions/ExprRef" } ], - "description": "Text color for subtitle text." - }, - "subtitleFont": { - "description": "Font name for subtitle text.", - "type": "string" - }, - "subtitleFontSize": { - "description": "Font size in pixels for subtitle text.", - "minimum": 0, - "type": "number" - }, - "subtitleFontStyle": { - "$ref": "#/definitions/FontStyle", - "description": "Font style for subtitle text." - }, - "subtitleFontWeight": { - "$ref": "#/definitions/FontWeight", - "description": "Font weight for subtitle text.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." - }, - "subtitleLineHeight": { - "description": "Line height in pixels for multi-line subtitle text.", - "type": "number" - }, - "subtitlePadding": { - "description": "The padding in pixels between title and subtitle text.", - "type": "number" - }, - "text": { - "$ref": "#/definitions/Text", "description": "The title text." }, "zindex": { @@ -16034,7 +29388,7 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The alignment to apply to grid rows and columns.\nThe 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\"`." + "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. - 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.\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": [ @@ -16045,14 +29399,21 @@ "$ref": "#/definitions/AutoSizeParams" } ], - "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + "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": { - "$ref": "#/definitions/Color", + "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\"`", + "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. - 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" @@ -16071,7 +29432,7 @@ "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\n`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`).", + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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": { @@ -16098,7 +29459,7 @@ }, "datasets": { "$ref": "#/definitions/Datasets", - "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": "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.", @@ -16109,8 +29470,22 @@ "type": "string" }, "padding": { - "$ref": "#/definitions/Padding", - "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.\nIf 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`" + "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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" }, "resolve": { "$ref": "#/definitions/Resolve", @@ -16125,7 +29500,7 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent 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)" + "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": [ @@ -16146,8 +29521,8 @@ "type": "array" }, "usermeta": { - "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", - "type": "object" + "$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": [ @@ -16172,14 +29547,21 @@ "$ref": "#/definitions/AutoSizeParams" } ], - "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + "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": { - "$ref": "#/definitions/Color", + "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\"`", + "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. - 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" @@ -16207,7 +29589,7 @@ }, "datasets": { "$ref": "#/definitions/Datasets", - "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": "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.", @@ -16225,8 +29607,22 @@ "type": "string" }, "padding": { - "$ref": "#/definitions/Padding", - "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.\nIf 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`" + "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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" }, "resolve": { "$ref": "#/definitions/Resolve", @@ -16255,8 +29651,8 @@ "type": "array" }, "usermeta": { - "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", - "type": "object" + "$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": [ @@ -16281,14 +29677,21 @@ "$ref": "#/definitions/AutoSizeParams" } ], - "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + "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": { - "$ref": "#/definitions/Color", + "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\"`", + "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. - 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" @@ -16316,7 +29719,7 @@ }, "datasets": { "$ref": "#/definitions/Datasets", - "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": "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.", @@ -16327,8 +29730,22 @@ "type": "string" }, "padding": { - "$ref": "#/definitions/Padding", - "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.\nIf 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`" + "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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" }, "resolve": { "$ref": "#/definitions/Resolve", @@ -16357,8 +29774,8 @@ "type": "array" }, "usermeta": { - "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", - "type": "object" + "$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.", @@ -16390,10 +29807,17 @@ "$ref": "#/definitions/AutoSizeParams" } ], - "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + "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": { - "$ref": "#/definitions/Color", + "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": { @@ -16413,14 +29837,14 @@ }, "datasets": { "$ref": "#/definitions/Datasets", - "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": "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/Encoding", + "$ref": "#/definitions/SharedEncoding", "description": "A shared key-value mapping between encoding channels and definition of fields in the underlying layers." }, "height": { @@ -16429,16 +29853,14 @@ "type": "number" }, { - "enum": [ - "container" - ], + "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." + "description": "The height of a visualization.\n\n- 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\"`.\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.", @@ -16459,186 +29881,30 @@ "type": "string" }, "padding": { - "$ref": "#/definitions/Padding", - "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.\nIf 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`" - }, - "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/Padding" }, { - "$ref": "#/definitions/TitleParams" + "$ref": "#/definitions/ExprRef" } ], - "description": "Title for the plot." + "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`" }, - "transform": { - "description": "An array of data transformations such as filter and new field calculation.", + "params": { + "description": "Dynamic variables that parameterize a visualization.", "items": { - "$ref": "#/definitions/Transform" + "$ref": "#/definitions/Parameter" }, "type": "array" }, - "usermeta": { - "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", - "type": "object" - }, - "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" - }, - { - "enum": [ - "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:__\nBased 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": { - "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/v4.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.\nThe 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\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" - }, - "background": { - "$ref": "#/definitions/Color", - "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\n`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.\nThis 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": { - "$ref": "#/definitions/Padding", - "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.\nIf 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`" - }, - "repeat": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "$ref": "#/definitions/RepeatMapping" - } - ], - "description": "Definition for fields to be repeated. One of:\n1) 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.\n2) 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.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent 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/Spec", - "description": "A specification of the view that gets repeated." + "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": [ @@ -16659,16 +29925,377 @@ "type": "array" }, "usermeta": { - "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", - "type": "object" + "$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. - 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\"`.\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": [ - "repeat", - "spec" + "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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "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/Spec", + "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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "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": { @@ -16686,7 +30313,7 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The alignment to apply to grid rows and columns.\nThe 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\"`." + "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. - 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.\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": [ @@ -16697,14 +30324,21 @@ "$ref": "#/definitions/AutoSizeParams" } ], - "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + "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": { - "$ref": "#/definitions/Color", + "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\"`", + "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. - 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" @@ -16723,7 +30357,7 @@ "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\n`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`).", + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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": { @@ -16743,7 +30377,7 @@ }, "datasets": { "$ref": "#/definitions/Datasets", - "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": "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.", @@ -16758,15 +30392,29 @@ "$ref": "#/definitions/FacetMapping" } ], - "description": "Definition for how to facet the data. One of:\n1) [a field definition for faceting the plot by one field](https://vega.github.io/vega-lite/docs/facet.html#field-def)\n2) [An object that maps `row` and `column` channels to their field definitions](https://vega.github.io/vega-lite/docs/facet.html#mapping)" + "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": { - "$ref": "#/definitions/Padding", - "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.\nIf 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`" + "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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" }, "resolve": { "$ref": "#/definitions/Resolve", @@ -16781,7 +30429,7 @@ "$ref": "#/definitions/RowCol" } ], - "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent 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)" + "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": [ @@ -16813,8 +30461,8 @@ "type": "array" }, "usermeta": { - "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", - "type": "object" + "$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": [ @@ -16848,7 +30496,7 @@ "$ref": "#/definitions/TopLevelNormalizedHConcatSpec" } ], - "description": "A Vega-Lite top-level specification.\nThis is the root class for all Vega-Lite specifications.\n(The json schema is generated from this type.)" + "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, @@ -16858,6 +30506,17 @@ "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. - 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.\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": [ { @@ -16867,20 +30526,38 @@ "$ref": "#/definitions/AutoSizeParams" } ], - "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" + "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": { - "$ref": "#/definitions/Color", + "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\"`", + "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. - 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." @@ -16898,7 +30575,7 @@ }, "datasets": { "$ref": "#/definitions/Datasets", - "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": "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.", @@ -16914,32 +30591,44 @@ "type": "number" }, { - "enum": [ - "container" - ], + "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." + "description": "The height of a visualization.\n\n- 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\"`.\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\"`,\n`\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + "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": { - "$ref": "#/definitions/Padding", - "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.\nIf 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`" + "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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" }, "projection": { "$ref": "#/definitions/Projection", - "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks\nand to `latitude` and `\"longitude\"` channels for other marks." + "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", @@ -16952,6 +30641,17 @@ "description": "A key-value mapping between selection names and definitions.", "type": "object" }, + "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": [ { @@ -16971,8 +30671,8 @@ "type": "array" }, "usermeta": { - "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", - "type": "object" + "$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", @@ -16984,16 +30684,14 @@ "type": "number" }, { - "enum": [ - "container" - ], + "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:__\nBased 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." + "description": "The width of a visualization.\n\n- 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\"`.\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": [ @@ -17006,11 +30704,11 @@ "additionalProperties": false, "properties": { "feature": { - "description": "The name of the TopoJSON object set to convert to a GeoJSON feature collection.\nFor example, in a map of the world, there may be an object set named `\"countries\"`.\nUsing the feature property, we can extract this set and generate a GeoJSON feature object for each country.", + "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.\nSimilar to the `feature` option, `mesh` extracts a named TopoJSON object set.\n Unlike the `feature` option, the corresponding geo data is returned as a single, unified mesh instance, not as individual GeoJSON features.\nExtracting 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.", + "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": { @@ -17022,13 +30720,11 @@ "type": "null" } ], - "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data.\nAlternatively, 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)).\nFor 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).\nFor 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)" + "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.\nIf no extension is detected, `\"json\"` will be used by default.", - "enum": [ - "topojson" - ], + "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" } }, @@ -17092,6 +30788,17 @@ } ] }, + "Type": { + "description": "Data type based on level of measurement", + "enum": [ + "quantitative", + "ordinal", + "temporal", + "nominal", + "geojson" + ], + "type": "string" + }, "TypeForShape": { "enum": [ "nominal", @@ -17106,7 +30813,13 @@ "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(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." + "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." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, "bin": { "anyOf": [ @@ -17117,9 +30830,7 @@ "$ref": "#/definitions/BinParams" }, { - "enum": [ - "binned" - ], + "const": "binned", "type": "string" }, { @@ -17130,7 +30841,7 @@ }, "field": { "$ref": "#/definitions/Field", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor 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:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf 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\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + "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": [ @@ -17141,7 +30852,7 @@ "$ref": "#/definitions/TimeUnitParams" } ], - "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [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." + "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": [ @@ -17156,14 +30867,15 @@ }, "type": { "$ref": "#/definitions/StandardType", - "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\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- 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- 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\"` (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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they 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: - `\"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). - `\"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](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`): - `\"quantitative\"` if the datum is a number - `\"nominal\"` if the datum is a string - `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__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`](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). - 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). - 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\"`. - 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": [ - "type" - ], "type": "object" }, + "URI": { + "format": "uri-reference", + "type": "string" + }, "UnitSpec": { "additionalProperties": false, "description": "A unit specification, which can contain either [primitive marks or composite marks](https://vega.github.io/vega-lite/docs/mark.html#types).", @@ -17193,9 +30905,7 @@ "type": "number" }, { - "enum": [ - "container" - ], + "const": "container", "type": "string" }, { @@ -17206,7 +30916,7 @@ }, "mark": { "$ref": "#/definitions/AnyMark", - "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + "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.", @@ -17214,7 +30924,7 @@ }, "projection": { "$ref": "#/definitions/Projection", - "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks\nand to `latitude` and `\"longitude\"` channels for other marks." + "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." }, "selection": { "additionalProperties": { @@ -17251,9 +30961,7 @@ "type": "number" }, { - "enum": [ - "container" - ], + "const": "container", "type": "string" }, { @@ -17296,20 +31004,18 @@ "type": "number" }, { - "enum": [ - "container" - ], + "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." + "description": "The height of a visualization.\n\n- 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\"`.\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\"`,\n`\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + "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.", @@ -17317,7 +31023,7 @@ }, "projection": { "$ref": "#/definitions/Projection", - "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks\nand to `latitude` and `\"longitude\"` channels for other marks." + "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." }, "selection": { "additionalProperties": { @@ -17354,16 +31060,14 @@ "type": "number" }, { - "enum": [ - "container" - ], + "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:__\nBased 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." + "description": "The width of a visualization.\n\n- 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\"`.\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": [ @@ -17383,7 +31087,7 @@ "type": "string" }, "url": { - "description": "An URL from which to load the data set. Use the `format.type` property\nto ensure the loaded data is correctly parsed.", + "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" } }, @@ -17401,9 +31105,24 @@ "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", @@ -17416,7 +31135,9 @@ "utcyear", "utcquarter", "utcmonth", + "utcweek", "utcday", + "utcdayofyear", "utcdate", "utchours", "utcminutes", @@ -17425,29 +31146,7 @@ ], "type": "string" }, - "Value": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "boolean" - }, - { - "items": { - "type": "number" - }, - "type": "array" - }, - { - "type": "null" - } - ] - }, - "YValueDef": { + "ValueDef<(number|\"width\"|\"height\"|ExprRef)>": { "additionalProperties": false, "description": "Definition object for a constant value (primitive value or gradient definition) of an encoding channel.", "properties": { @@ -17457,10 +31156,15 @@ "type": "number" }, { - "enum": [ - "height" - ], + "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)." @@ -17471,7 +31175,7 @@ ], "type": "object" }, - "XValueDef": { + "ValueDef<(number|ExprRef)>": { "additionalProperties": false, "description": "Definition object for a constant value (primitive value or gradient definition) of an encoding channel.", "properties": { @@ -17481,10 +31185,7 @@ "type": "number" }, { - "enum": [ - "width" - ], - "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)." @@ -17495,7 +31196,7 @@ ], "type": "object" }, - "NumberValueDef": { + "ValueDef": { "additionalProperties": false, "description": "Definition object for a constant value (primitive value or gradient definition) of an encoding channel.", "properties": { @@ -17509,17 +31210,23 @@ ], "type": "object" }, - "ValueDefWithCondition": { + "ValueDefWithCondition": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { - "$ref": "#/definitions/ConditionalMarkPropFieldDef" + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, { - "$ref": "#/definitions/ValueCondition<(Gradient|string|null)>" + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" } ], "description": "A field definition or one or more value definition(s) with a selection predicate." @@ -17534,6 +31241,9 @@ }, { "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)." @@ -17541,217 +31251,189 @@ }, "type": "object" }, - "ValueDefWithCondition": { + "ValueDefWithCondition": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { - "$ref": "#/definitions/ConditionalMarkPropFieldDef" + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { - "$ref": "#/definitions/ValueCondition<(string|null)>" + "$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 selection predicate." }, "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" - ] - } - }, - "type": "object" - }, - "ValueDefWithCondition": { - "additionalProperties": false, - "minProperties": 1, - "properties": { - "condition": { "anyOf": [ { - "$ref": "#/definitions/ConditionalMarkPropFieldDef" + "type": "string" + }, + { + "type": "null" }, { - "$ref": "#/definitions/ValueCondition" + "$ref": "#/definitions/ExprRef" } ], - "description": "A field definition or one or more value definition(s) with a selection predicate." - }, - "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" + "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": { + "ValueDefWithCondition": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { - "$ref": "#/definitions/ConditionalMarkPropFieldDef" + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { - "$ref": "#/definitions/ValueCondition" + "$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 selection predicate." }, "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).", - "items": { - "type": "number" - }, - "type": "array" + "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,(string|null)>": { + "ValueDefWithCondition": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { - "$ref": "#/definitions/ConditionalMarkPropFieldDef" + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, { - "$ref": "#/definitions/ValueCondition<(string|null)>" + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" } ], "description": "A field definition or one or more value definition(s) with a selection predicate." }, "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" - ] + "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": { + "ValueDefWithCondition,(string|null)>": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { - "$ref": "#/definitions/ConditionalStringFieldDef" + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { - "$ref": "#/definitions/ValueCondition" + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" } ], "description": "A field definition or one or more value definition(s) with a selection predicate." }, "value": { - "$ref": "#/definitions/Text", - "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" - }, - "ValueCondition<(Gradient|string|null)>": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null)>" - }, - { - "items": { - "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null)>" - }, - "type": "array" - } - ] - }, - "ValueCondition<(string|null)>": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalStringValueDef" - }, - { - "items": { - "$ref": "#/definitions/ConditionalStringValueDef" - }, - "type": "array" - } - ] - }, - "ValueCondition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalValueDef" - }, - { - "items": { - "$ref": "#/definitions/ConditionalValueDef" - }, - "type": "array" - } - ] - }, - "ValueCondition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalNumberValueDef" - }, - { - "items": { - "$ref": "#/definitions/ConditionalNumberValueDef" - }, - "type": "array" - } - ] - }, - "ValueCondition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalValueDef" - }, - { - "items": { - "$ref": "#/definitions/ConditionalValueDef" - }, - "type": "array" + "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" }, - "ValueCondition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalValueDef" + "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 selection predicate." }, - { - "items": { - "$ref": "#/definitions/ConditionalValueDef" - }, - "type": "array" + "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)." } - ] - }, - "ValueWithCondition": { - "$ref": "#/definitions/ValueDefWithCondition" - }, - "ValueWithCondition": { - "$ref": "#/definitions/ValueDefWithCondition" - }, - "ValueWithCondition": { - "$ref": "#/definitions/ValueDefWithCondition" - }, - "ValueWithCondition,(string|null)>": { - "$ref": "#/definitions/ValueDefWithCondition,(string|null)>" - }, - "ValueWithCondition": { - "$ref": "#/definitions/ValueDefWithCondition" + }, + "type": "object" }, "Vector2": { "items": [ @@ -17838,8 +31520,15 @@ "additionalProperties": false, "properties": { "cornerRadius": { - "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", - "type": "number" + "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", @@ -17852,21 +31541,38 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], "description": "The fill color.\n\n__Default value:__ `undefined`" }, "fillOpacity": { - "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "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, - "type": "number" + "minimum": 0 }, "stroke": { "anyOf": [ @@ -17875,43 +31581,95 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], "description": "The stroke color.\n\n__Default value:__ `\"#ddd\"`" }, "strokeCap": { - "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`", - "type": "string" + "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": { - "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", - "items": { - "type": "number" - }, - "type": "array" + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeDashOffset": { - "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", - "type": "number" + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeJoin": { - "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`", - "type": "string" + "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": { - "description": "The miter limit at which to bevel a line join.", - "type": "number" + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeOpacity": { - "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeWidth": { - "description": "The stroke width, in pixels.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "style": { "anyOf": [ @@ -17925,7 +31683,7 @@ "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\"`\n__Note:__ Any specified view background properties will augment the default style." + "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" @@ -17938,16 +31696,23 @@ "type": "boolean" }, "continuousHeight": { - "description": "The default height when the plot has a continuous y-field.\n\n__Default value:__ `200`", + "description": "The default height when the plot has a continuous y-field for x or latitude, or has arc marks.\n\n__Default value:__ `200`", "type": "number" }, "continuousWidth": { - "description": "The default width when the plot has a continuous x-field.\n\n__Default value:__ `200`", + "description": "The default width when the plot has a continuous field for x or longitude, or has arc marks.\n\n__Default value:__ `200`", "type": "number" }, "cornerRadius": { - "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", - "type": "number" + "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", @@ -17971,7 +31736,7 @@ "type": "object" } ], - "description": "The default height when the plot has either a discrete y-field or no y-field.\nThe 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`." + "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": [ @@ -17991,7 +31756,7 @@ "type": "object" } ], - "description": "The default width when the plot has either a discrete x-field or no x-field.\nThe 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`." + "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": [ @@ -18000,25 +31765,42 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], "description": "The fill color.\n\n__Default value:__ `undefined`" }, "fillOpacity": { - "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "height": { "description": "Default height\n\n__Deprecated:__ Since Vega-Lite 4.0. Please use continuousHeight and discreteHeight instead.", "type": "number" }, "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, - "type": "number" + "minimum": 0 }, "step": { "description": "Default step size for x-/y- discrete fields.", @@ -18031,43 +31813,95 @@ }, { "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" } ], "description": "The stroke color.\n\n__Default value:__ `\"#ddd\"`" }, "strokeCap": { - "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`", - "type": "string" + "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": { - "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", - "items": { - "type": "number" - }, - "type": "array" + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeDashOffset": { - "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", - "type": "number" + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeJoin": { - "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`", - "type": "string" + "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": { - "description": "The miter limit at which to bevel a line join.", - "type": "number" + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeOpacity": { - "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", - "maximum": 1, - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "strokeWidth": { - "description": "The stroke width, in pixels.", - "minimum": 0, - "type": "number" + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] }, "width": { "description": "Default width\n\n__Deprecated:__ Since Vega-Lite 4.0. Please use continuousWidth and discreteWidth instead.", diff --git a/doc/user_guide/API.rst b/doc/user_guide/API.rst index a92e21998..2186b0930 100644 --- a/doc/user_guide/API.rst +++ b/doc/user_guide/API.rst @@ -34,65 +34,101 @@ Encoding Channels :toctree: generated/channels/ :nosignatures: + Angle + AngleDatum + AngleDatumValue Color - ColorValue + ColorDatum + ColorDatumValue Column + Description + DescriptionValue Detail Facet Fill + FillDatum + FillDatumValue FillOpacity - FillOpacityValue - FillValue + FillOpacityDatum + FillOpacityDatumValue Href HrefValue Key Latitude Latitude2 - Latitude2Value - LatitudeValue + Latitude2Datum + Latitude2DatumValue + LatitudeDatum + LatitudeDatumValue Longitude Longitude2 - Longitude2Value - LongitudeValue + Longitude2Datum + Longitude2DatumValue + LongitudeDatum + LongitudeDatumValue Opacity - OpacityValue + OpacityDatum + OpacityDatumValue Order OrderValue + Radius + Radius2 + Radius2Datum + Radius2DatumValue + RadiusDatum + RadiusDatumValue Row Shape - ShapeValue + ShapeDatum + ShapeDatumValue Size - SizeValue + SizeDatum + SizeDatumValue Stroke StrokeDash - StrokeDashValue + StrokeDashDatum + StrokeDashDatumValue + StrokeDatum + StrokeDatumValue StrokeOpacity - StrokeOpacityValue - StrokeValue + StrokeOpacityDatum + StrokeOpacityDatumValue StrokeWidth - StrokeWidthValue + StrokeWidthDatum + StrokeWidthDatumValue Text - TextValue + TextDatum + TextDatumValue + Theta + Theta2 + Theta2Datum + Theta2DatumValue + ThetaDatum + ThetaDatumValue Tooltip TooltipValue Url UrlValue X X2 - X2Value + X2Datum + X2DatumValue + XDatum + XDatumValue XError XError2 XError2Value XErrorValue - XValue Y Y2 - Y2Value + Y2Datum + Y2DatumValue + YDatum + YDatumValue YError YError2 YError2Value YErrorValue - YValue API Functions ------------- @@ -166,8 +202,7 @@ Low-Level Schema Wrappers CalculateTransform Categorical Color - ColorGradientFieldDefWithCondition - ColorGradientValueWithCondition + ColorDef ColorName ColorScheme CompositeMark @@ -189,39 +224,39 @@ Low-Level Schema Wrappers ConditionalAxisPropertynumbernull ConditionalAxisPropertystringnull ConditionalAxisString - ConditionalMarkPropFieldDef - ConditionalMarkPropFieldDefTypeForShape - ConditionalNumberValueDef - ConditionalPredicateMarkPropFieldDef - ConditionalPredicateMarkPropFieldDefTypeForShape - ConditionalPredicateNumberValueDef + ConditionalMarkPropFieldOrDatumDef + ConditionalMarkPropFieldOrDatumDefTypeForShape + ConditionalPredicateMarkPropFieldOrDatumDef + ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape ConditionalPredicateStringFieldDef - ConditionalPredicateStringValueDef - ConditionalPredicateValueDefAlignnull - ConditionalPredicateValueDefColornull - ConditionalPredicateValueDefFontStylenull - ConditionalPredicateValueDefFontWeightnull - ConditionalPredicateValueDefGradientstringnull - ConditionalPredicateValueDefText - ConditionalPredicateValueDefTextBaselinenull + ConditionalPredicateValueDefAlignnullExprRef + ConditionalPredicateValueDefColornullExprRef + ConditionalPredicateValueDefFontStylenullExprRef + ConditionalPredicateValueDefFontWeightnullExprRef + ConditionalPredicateValueDefGradientstringnullExprRef + ConditionalPredicateValueDefTextBaselinenullExprRef + ConditionalPredicateValueDefTextExprRef ConditionalPredicateValueDefnumber - ConditionalPredicateValueDefnumbernull - ConditionalPredicateValueDefstring - ConditionalSelectionMarkPropFieldDef - ConditionalSelectionMarkPropFieldDefTypeForShape - ConditionalSelectionNumberValueDef + ConditionalPredicateValueDefnumberExprRef + ConditionalPredicateValueDefnumbernullExprRef + ConditionalPredicateValueDefstringExprRef + ConditionalPredicateValueDefstringnullExprRef + ConditionalSelectionMarkPropFieldOrDatumDef + ConditionalSelectionMarkPropFieldOrDatumDefTypeForShape ConditionalSelectionStringFieldDef - ConditionalSelectionStringValueDef - ConditionalSelectionValueDefGradientstringnull - ConditionalSelectionValueDefText + ConditionalSelectionValueDefGradientstringnullExprRef + ConditionalSelectionValueDefTextExprRef ConditionalSelectionValueDefnumber - ConditionalSelectionValueDefstring + ConditionalSelectionValueDefnumberExprRef + ConditionalSelectionValueDefstringExprRef + ConditionalSelectionValueDefstringnullExprRef ConditionalStringFieldDef - ConditionalStringValueDef - ConditionalValueDefGradientstringnull - ConditionalValueDefText + ConditionalValueDefGradientstringnullExprRef + ConditionalValueDefTextExprRef ConditionalValueDefnumber - ConditionalValueDefstring + ConditionalValueDefnumberExprRef + ConditionalValueDefstringExprRef + ConditionalValueDefstringnullExprRef Config CsvDataFormat Cursor @@ -231,12 +266,14 @@ Low-Level Schema Wrappers DataSource Datasets DateTime + DatumDef Day DensityTransform DerivedStream DictInlineDataset DictSelectionInit DictSelectionInitInterval + Dictunknown Diverging DomainUnionWith DsvDataFormat @@ -254,6 +291,8 @@ Low-Level Schema Wrappers EventStream EventType Expr + ExprOrSignalRef + ExprRef FacetEncodingFieldDef FacetFieldDef FacetFieldDefFieldName @@ -263,11 +302,6 @@ Low-Level Schema Wrappers FacetedEncoding FacetedUnitSpec Field - FieldDefWithConditionMarkPropFieldDefGradientstringnull - FieldDefWithConditionMarkPropFieldDefTypeForShapestringnull - FieldDefWithConditionMarkPropFieldDefnumber - FieldDefWithConditionStringFieldDefText - FieldDefWithConditionStringFieldDefstring FieldDefWithoutScale FieldEqualPredicate FieldGTEPredicate @@ -276,6 +310,15 @@ Low-Level Schema Wrappers FieldLTPredicate FieldName FieldOneOfPredicate + FieldOrDatumDefWithConditionDatumDefGradientstringnull + FieldOrDatumDefWithConditionDatumDefnumber + FieldOrDatumDefWithConditionDatumDefstringnull + FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull + FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull + FieldOrDatumDefWithConditionMarkPropFieldDefnumber + FieldOrDatumDefWithConditionStringDatumDefText + FieldOrDatumDefWithConditionStringFieldDefText + FieldOrDatumDefWithConditionStringFieldDefstring FieldRangePredicate FieldValidPredicate FilterTransform @@ -309,7 +352,10 @@ Low-Level Schema Wrappers JoinAggregateTransform JsonDataFormat LabelOverlap + LatLongDef LatLongFieldDef + LayerRepeatMapping + LayerRepeatSpec LayerSpec LayoutAlign Legend @@ -331,7 +377,11 @@ Low-Level Schema Wrappers LookupTransform Mark MarkConfig + MarkConfigExprOrSignalRef MarkDef + MarkPropDefGradientstringnull + MarkPropDefnumber + MarkPropDefstringnullTypeForShape MarkType MergedStream Month @@ -340,27 +390,36 @@ Low-Level Schema Wrappers MultiTimeUnit NamedData NonArgAggregateOp + NonLayerRepeatSpec NormalizedConcatSpecGenericSpec NormalizedFacetSpec NormalizedHConcatSpecGenericSpec NormalizedSpec NormalizedVConcatSpecGenericSpec - NumberValueDef - NumericArrayFieldDefWithCondition - NumericArrayValueDefWithCondition - NumericFieldDefWithCondition - NumericValueWithCondition + NumericArrayMarkPropDef + NumericMarkPropDef + NumericValueDef OrderFieldDef + OrderValueDef Orient Orientation OverlayMarkDef Padding + Parameter Parse ParseValue PivotTransform + PolarDef + Position2Def + PositionDatumDef + PositionDatumDefBase + PositionDef PositionFieldDef + PositionFieldDefBase + PositionValueDef Predicate PredicateComposition + PrimitiveValue Projection ProjectionConfig ProjectionType @@ -412,8 +471,8 @@ Low-Level Schema Wrappers SequenceParams SequentialMultiHue SequentialSingleHue - ShapeFieldDefWithCondition - ShapeValueWithCondition + ShapeDef + SharedEncoding SingleDefUnitChannel SingleSelection SingleSelectionConfig @@ -434,15 +493,15 @@ Low-Level Schema Wrappers Stream StringFieldDef StringFieldDefWithCondition - StringValueWithCondition - StringValueWithConditionTypeForShape + StringValueDefWithCondition + StrokeCap + StrokeJoin StyleConfigIndex SymbolShape Text TextBaseline + TextDef TextDirection - TextFieldDefWithCondition - TextValueWithCondition TickConfig TickCount TimeInterval @@ -466,30 +525,24 @@ Low-Level Schema Wrappers TopLevelUnitSpec TopoDataFormat Transform + Type TypeForShape TypedFieldDef + URI UnitSpec UnitSpecWithFrame UrlData UtcMultiTimeUnit UtcSingleTimeUnit VConcatSpecGenericSpec - Value - ValueConditionGradientstringnull - ValueConditionText - ValueConditionnumber - ValueConditionstring - ValueConditionstringnull - ValueDefWithConditionMarkPropFieldDefGradientstringnull - ValueDefWithConditionMarkPropFieldDefTypeForShapestringnull - ValueDefWithConditionMarkPropFieldDefnumber - ValueDefWithConditionMarkPropFieldDefstringnull + ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull + ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull + ValueDefWithConditionMarkPropFieldOrDatumDefnumber + ValueDefWithConditionMarkPropFieldOrDatumDefstringnull ValueDefWithConditionStringFieldDefText - ValueWithConditionMarkPropFieldDefGradientstringnull - ValueWithConditionMarkPropFieldDefTypeForShapestringnull - ValueWithConditionMarkPropFieldDefnumber - ValueWithConditionMarkPropFieldDefstringnull - ValueWithConditionStringFieldDefText + ValueDefnumber + ValueDefnumberExprRef + ValueDefnumberwidthheightExprRef Vector2DateTime Vector2Vector2number Vector2boolean @@ -503,5 +556,3 @@ Low-Level Schema Wrappers WindowFieldDef WindowOnlyOp WindowTransform - XValueDef - YValueDef diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 4188720ea..01855fbad 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -27,7 +27,8 @@ # Map of version name to github branch name. SCHEMA_VERSION = { "vega": {"v5": "v5.10.0"}, - "vega-lite": {"v3": "v3.4.0", "v4": "v4.8.1"}, + "vega-lite": {"v4": "v4.17.0"} + # "vega-lite": {"v3": "v3.4.0", "v4": "v4.8.1"}, } reLink = re.compile(r"(?<=\[)([^\]]+)(?=\]\([^\)]+\))", re.M) @@ -157,6 +158,23 @@ def to_dict(self, validate=True, ignore=(), context=None): 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 + elif 'field' in datum and 'type' not in datum: + kwds = parse_shorthand(datum['field'], context.get('data', None)) + copy = self.copy(deep=['datum']) + copy.datum.update(kwds) + return super(DatumChannelMixin, copy).to_dict(validate=validate, + ignore=ignore, + context=context) """ @@ -186,6 +204,18 @@ class {classname}(ValueChannelMixin, core.{basename}): ) +class DatumSchemaGenerator(SchemaGenerator): + schema_class_template = textwrap.dedent( + ''' + class {classname}(DatumChannelMixin, core.{basename}): + """{docstring}""" + _class_is_valid_at_instantiation = False + _encoding_name = "{encodingname}" + {init_code} + ''' + ) + + HEADER = """\ # The contents of this file are automatically written by # tools/generate_schema_wrapper.py. Do not modify directly. @@ -240,6 +270,36 @@ def copy_schemapi_util(): dest.writelines(source.readlines()) +def recursive_dict_update(schema, root, def_dict): + if "$ref" in schema: + next_schema = resolve_references(schema, root) + if "properties" in next_schema: + definition = schema["$ref"] + properties = next_schema["properties"] + for k in def_dict.keys(): + if k in properties: + def_dict[k] = definition + else: + recursive_dict_update(next_schema, root, def_dict) + elif "anyOf" in schema: + for sub_schema in schema["anyOf"]: + recursive_dict_update(sub_schema, root, def_dict) + + +def get_field_datum_value_defs(propschema, root): + def_dict = {k: None for k in ("field", "datum", "value")} + schema = propschema.schema + if propschema.is_reference() and "properties" in schema: + if "field" in schema["properties"]: + def_dict["field"] = propschema.ref + else: + raise ValueError("Unexpected schema structure") + else: + recursive_dict_update(schema, root, def_dict) + + return {i: j for i, j in def_dict.items() if j} + + def toposort(graph): """Topological sort of a directed acyclic graph. @@ -390,22 +450,16 @@ def generate_vegalite_channel_wrappers(schemafile, version, imports=None): encoding = SchemaInfo(schema["definitions"][encoding_def], rootschema=schema) for prop, propschema in encoding.properties.items(): - if propschema.is_reference(): - definitions = [propschema.ref] - elif propschema.is_anyOf(): - definitions = [s.ref for s in propschema.anyOf if s.is_reference()] - else: - raise ValueError("either $ref or anyOf expected") - for definition in definitions: - defschema = {"$ref": definition} + classname = prop[0].upper() + prop[1:] + def_dict = get_field_datum_value_defs(propschema, schema) + + for encoding_spec, definition in def_dict.items(): basename = definition.split("/")[-1] - classname = prop[0].upper() + prop[1:] + basename = get_valid_identifier(basename) - if "Value" in basename: - Generator = ValueSchemaGenerator - classname += "Value" - nodefault = ["value"] - else: + defschema = {"$ref": definition} + + if encoding_spec == "field": Generator = FieldSchemaGenerator nodefault = [] defschema = copy.deepcopy(resolve_references(defschema, schema)) @@ -418,6 +472,16 @@ def generate_vegalite_channel_wrappers(schemafile, version, imports=None): } defschema["required"] = ["shorthand"] + elif encoding_spec == "datum": + Generator = DatumSchemaGenerator + classname += "Datum" + nodefault = ["datum"] + + elif encoding_spec == "value": + Generator = ValueSchemaGenerator + classname += "Value" + nodefault = ["value"] + gen = Generator( classname=classname, basename=basename, @@ -458,7 +522,10 @@ def generate_vegalite_mark_mixin(schemafile, markdefs): ] for mark_enum, mark_def in markdefs.items(): - marks = schema["definitions"][mark_enum]["enum"] + if "enum" in schema["definitions"][mark_enum]: + marks = schema["definitions"][mark_enum]["enum"] + else: + marks = [schema["definitions"][mark_enum]["const"]] info = SchemaInfo({"$ref": "#/definitions/" + mark_def}, rootschema=schema) # adapted from SchemaInfo.init_code From ede3c68fbdb80a48dc8b5caf0b6efa650fb260b3 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 23 Oct 2021 15:53:48 -0700 Subject: [PATCH 02/46] Correct names like NameDatumValue --- .gitignore | 3 +- altair/vegalite/v4/schema/channels.py | 144 +++++++++++++------------- tools/generate_schema_wrapper.py | 2 +- 3 files changed, 75 insertions(+), 74 deletions(-) diff --git a/.gitignore b/.gitignore index 145976b8a..ba435eb4b 100644 --- a/.gitignore +++ b/.gitignore @@ -69,4 +69,5 @@ Untitled*.ipynb *.DS_Store # VSCode -.vscode \ No newline at end of file +.vscode +altair/utils/sample.py diff --git a/altair/vegalite/v4/schema/channels.py b/altair/vegalite/v4/schema/channels.py index bf586d998..4a253c9bc 100644 --- a/altair/vegalite/v4/schema/channels.py +++ b/altair/vegalite/v4/schema/channels.py @@ -419,8 +419,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * super(AngleDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) -class AngleDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): - """AngleDatumValue schema wrapper +class AngleValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """AngleValue schema wrapper Mapping(required=[]) @@ -439,7 +439,7 @@ class AngleDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropField _encoding_name = "angle" def __init__(self, value, condition=Undefined, **kwds): - super(AngleDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(AngleValue, self).__init__(value=value, condition=condition, **kwds) class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): @@ -766,8 +766,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * super(ColorDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) -class ColorDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): - """ColorDatumValue schema wrapper +class ColorValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """ColorValue schema wrapper Mapping(required=[]) @@ -787,7 +787,7 @@ class ColorDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropField _encoding_name = "color" def __init__(self, value, condition=Undefined, **kwds): - super(ColorDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(ColorValue, self).__init__(value=value, condition=condition, **kwds) class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): @@ -1970,8 +1970,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * super(FillDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) -class FillDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): - """FillDatumValue schema wrapper +class FillValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """FillValue schema wrapper Mapping(required=[]) @@ -1991,7 +1991,7 @@ class FillDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldO _encoding_name = "fill" def __init__(self, value, condition=Undefined, **kwds): - super(FillDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(FillValue, self).__init__(value=value, condition=condition, **kwds) class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): @@ -2319,8 +2319,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * **kwds) -class FillOpacityDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): - """FillOpacityDatumValue schema wrapper +class FillOpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """FillOpacityValue schema wrapper Mapping(required=[]) @@ -2339,7 +2339,7 @@ class FillOpacityDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPro _encoding_name = "fillOpacity" def __init__(self, value, condition=Undefined, **kwds): - super(FillOpacityDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(FillOpacityValue, self).__init__(value=value, condition=condition, **kwds) class Href(FieldChannelMixin, core.StringFieldDefWithCondition): @@ -2986,8 +2986,8 @@ def __init__(self, datum, band=Undefined, type=Undefined, **kwds): super(LatitudeDatum, self).__init__(datum=datum, band=band, type=type, **kwds) -class LatitudeDatumValue(ValueChannelMixin, core.NumericValueDef): - """LatitudeDatumValue schema wrapper +class LatitudeValue(ValueChannelMixin, core.NumericValueDef): + """LatitudeValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -3005,7 +3005,7 @@ class LatitudeDatumValue(ValueChannelMixin, core.NumericValueDef): _encoding_name = "latitude" def __init__(self, value, **kwds): - super(LatitudeDatumValue, self).__init__(value=value, **kwds) + super(LatitudeValue, self).__init__(value=value, **kwds) class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): @@ -3200,8 +3200,8 @@ def __init__(self, datum, band=Undefined, type=Undefined, **kwds): super(Latitude2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) -class Latitude2DatumValue(ValueChannelMixin, core.PositionValueDef): - """Latitude2DatumValue schema wrapper +class Latitude2Value(ValueChannelMixin, core.PositionValueDef): + """Latitude2Value schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -3219,7 +3219,7 @@ class Latitude2DatumValue(ValueChannelMixin, core.PositionValueDef): _encoding_name = "latitude2" def __init__(self, value, **kwds): - super(Latitude2DatumValue, self).__init__(value=value, **kwds) + super(Latitude2Value, self).__init__(value=value, **kwds) class Longitude(FieldChannelMixin, core.LatLongFieldDef): @@ -3469,8 +3469,8 @@ def __init__(self, datum, band=Undefined, type=Undefined, **kwds): super(LongitudeDatum, self).__init__(datum=datum, band=band, type=type, **kwds) -class LongitudeDatumValue(ValueChannelMixin, core.NumericValueDef): - """LongitudeDatumValue schema wrapper +class LongitudeValue(ValueChannelMixin, core.NumericValueDef): + """LongitudeValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -3488,7 +3488,7 @@ class LongitudeDatumValue(ValueChannelMixin, core.NumericValueDef): _encoding_name = "longitude" def __init__(self, value, **kwds): - super(LongitudeDatumValue, self).__init__(value=value, **kwds) + super(LongitudeValue, self).__init__(value=value, **kwds) class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): @@ -3683,8 +3683,8 @@ def __init__(self, datum, band=Undefined, type=Undefined, **kwds): super(Longitude2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) -class Longitude2DatumValue(ValueChannelMixin, core.PositionValueDef): - """Longitude2DatumValue schema wrapper +class Longitude2Value(ValueChannelMixin, core.PositionValueDef): + """Longitude2Value schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -3702,7 +3702,7 @@ class Longitude2DatumValue(ValueChannelMixin, core.PositionValueDef): _encoding_name = "longitude2" def __init__(self, value, **kwds): - super(Longitude2DatumValue, self).__init__(value=value, **kwds) + super(Longitude2Value, self).__init__(value=value, **kwds) class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): @@ -4030,8 +4030,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * **kwds) -class OpacityDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): - """OpacityDatumValue schema wrapper +class OpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """OpacityValue schema wrapper Mapping(required=[]) @@ -4050,7 +4050,7 @@ class OpacityDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFie _encoding_name = "opacity" def __init__(self, value, condition=Undefined, **kwds): - super(OpacityDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(OpacityValue, self).__init__(value=value, condition=condition, **kwds) class Order(FieldChannelMixin, core.OrderFieldDef): @@ -4605,8 +4605,8 @@ def __init__(self, datum, band=Undefined, scale=Undefined, stack=Undefined, type **kwds) -class RadiusDatumValue(ValueChannelMixin, core.PositionValueDef): - """RadiusDatumValue schema wrapper +class RadiusValue(ValueChannelMixin, core.PositionValueDef): + """RadiusValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -4624,7 +4624,7 @@ class RadiusDatumValue(ValueChannelMixin, core.PositionValueDef): _encoding_name = "radius" def __init__(self, value, **kwds): - super(RadiusDatumValue, self).__init__(value=value, **kwds) + super(RadiusValue, self).__init__(value=value, **kwds) class Radius2(FieldChannelMixin, core.SecondaryFieldDef): @@ -4819,8 +4819,8 @@ def __init__(self, datum, band=Undefined, type=Undefined, **kwds): super(Radius2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) -class Radius2DatumValue(ValueChannelMixin, core.PositionValueDef): - """Radius2DatumValue schema wrapper +class Radius2Value(ValueChannelMixin, core.PositionValueDef): + """Radius2Value schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -4838,7 +4838,7 @@ class Radius2DatumValue(ValueChannelMixin, core.PositionValueDef): _encoding_name = "radius2" def __init__(self, value, **kwds): - super(Radius2DatumValue, self).__init__(value=value, **kwds) + super(Radius2Value, self).__init__(value=value, **kwds) class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): @@ -5376,8 +5376,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * super(ShapeDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) -class ShapeDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull): - """ShapeDatumValue schema wrapper +class ShapeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull): + """ShapeValue schema wrapper Mapping(required=[]) @@ -5397,7 +5397,7 @@ class ShapeDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropField _encoding_name = "shape" def __init__(self, value, condition=Undefined, **kwds): - super(ShapeDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(ShapeValue, self).__init__(value=value, condition=condition, **kwds) class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): @@ -5724,8 +5724,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * super(SizeDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) -class SizeDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): - """SizeDatumValue schema wrapper +class SizeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """SizeValue schema wrapper Mapping(required=[]) @@ -5744,7 +5744,7 @@ class SizeDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldO _encoding_name = "size" def __init__(self, value, condition=Undefined, **kwds): - super(SizeDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(SizeValue, self).__init__(value=value, condition=condition, **kwds) class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): @@ -6071,8 +6071,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * super(StrokeDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) -class StrokeDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): - """StrokeDatumValue schema wrapper +class StrokeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """StrokeValue schema wrapper Mapping(required=[]) @@ -6092,7 +6092,7 @@ class StrokeDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFiel _encoding_name = "stroke" def __init__(self, value, condition=Undefined, **kwds): - super(StrokeDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(StrokeValue, self).__init__(value=value, condition=condition, **kwds) class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): @@ -6420,8 +6420,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * **kwds) -class StrokeDashDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): - """StrokeDashDatumValue schema wrapper +class StrokeDashValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """StrokeDashValue schema wrapper Mapping(required=[]) @@ -6440,7 +6440,7 @@ class StrokeDashDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkProp _encoding_name = "strokeDash" def __init__(self, value, condition=Undefined, **kwds): - super(StrokeDashDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(StrokeDashValue, self).__init__(value=value, condition=condition, **kwds) class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): @@ -6769,8 +6769,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * **kwds) -class StrokeOpacityDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): - """StrokeOpacityDatumValue schema wrapper +class StrokeOpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """StrokeOpacityValue schema wrapper Mapping(required=[]) @@ -6789,7 +6789,7 @@ class StrokeOpacityDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkP _encoding_name = "strokeOpacity" def __init__(self, value, condition=Undefined, **kwds): - super(StrokeOpacityDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(StrokeOpacityValue, self).__init__(value=value, condition=condition, **kwds) class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): @@ -7117,8 +7117,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * **kwds) -class StrokeWidthDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): - """StrokeWidthDatumValue schema wrapper +class StrokeWidthValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """StrokeWidthValue schema wrapper Mapping(required=[]) @@ -7137,7 +7137,7 @@ class StrokeWidthDatumValue(ValueChannelMixin, core.ValueDefWithConditionMarkPro _encoding_name = "strokeWidth" def __init__(self, value, condition=Undefined, **kwds): - super(StrokeWidthDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(StrokeWidthValue, self).__init__(value=value, condition=condition, **kwds) class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefText): @@ -7486,8 +7486,8 @@ def __init__(self, datum, band=Undefined, condition=Undefined, format=Undefined, formatType=formatType, labelExpr=labelExpr, type=type, **kwds) -class TextDatumValue(ValueChannelMixin, core.ValueDefWithConditionStringFieldDefText): - """TextDatumValue schema wrapper +class TextValue(ValueChannelMixin, core.ValueDefWithConditionStringFieldDefText): + """TextValue schema wrapper Mapping(required=[]) @@ -7506,7 +7506,7 @@ class TextDatumValue(ValueChannelMixin, core.ValueDefWithConditionStringFieldDef _encoding_name = "text" def __init__(self, value, condition=Undefined, **kwds): - super(TextDatumValue, self).__init__(value=value, condition=condition, **kwds) + super(TextValue, self).__init__(value=value, condition=condition, **kwds) class Theta(FieldChannelMixin, core.PositionFieldDefBase): @@ -7868,8 +7868,8 @@ def __init__(self, datum, band=Undefined, scale=Undefined, stack=Undefined, type **kwds) -class ThetaDatumValue(ValueChannelMixin, core.PositionValueDef): - """ThetaDatumValue schema wrapper +class ThetaValue(ValueChannelMixin, core.PositionValueDef): + """ThetaValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -7887,7 +7887,7 @@ class ThetaDatumValue(ValueChannelMixin, core.PositionValueDef): _encoding_name = "theta" def __init__(self, value, **kwds): - super(ThetaDatumValue, self).__init__(value=value, **kwds) + super(ThetaValue, self).__init__(value=value, **kwds) class Theta2(FieldChannelMixin, core.SecondaryFieldDef): @@ -8082,8 +8082,8 @@ def __init__(self, datum, band=Undefined, type=Undefined, **kwds): super(Theta2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) -class Theta2DatumValue(ValueChannelMixin, core.PositionValueDef): - """Theta2DatumValue schema wrapper +class Theta2Value(ValueChannelMixin, core.PositionValueDef): + """Theta2Value schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -8101,7 +8101,7 @@ class Theta2DatumValue(ValueChannelMixin, core.PositionValueDef): _encoding_name = "theta2" def __init__(self, value, **kwds): - super(Theta2DatumValue, self).__init__(value=value, **kwds) + super(Theta2Value, self).__init__(value=value, **kwds) class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): @@ -8968,8 +8968,8 @@ def __init__(self, datum, axis=Undefined, band=Undefined, impute=Undefined, scal stack=stack, type=type, **kwds) -class XDatumValue(ValueChannelMixin, core.PositionValueDef): - """XDatumValue schema wrapper +class XValue(ValueChannelMixin, core.PositionValueDef): + """XValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -8987,7 +8987,7 @@ class XDatumValue(ValueChannelMixin, core.PositionValueDef): _encoding_name = "x" def __init__(self, value, **kwds): - super(XDatumValue, self).__init__(value=value, **kwds) + super(XValue, self).__init__(value=value, **kwds) class X2(FieldChannelMixin, core.SecondaryFieldDef): @@ -9182,8 +9182,8 @@ def __init__(self, datum, band=Undefined, type=Undefined, **kwds): super(X2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) -class X2DatumValue(ValueChannelMixin, core.PositionValueDef): - """X2DatumValue schema wrapper +class X2Value(ValueChannelMixin, core.PositionValueDef): + """X2Value schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -9201,7 +9201,7 @@ class X2DatumValue(ValueChannelMixin, core.PositionValueDef): _encoding_name = "x2" def __init__(self, value, **kwds): - super(X2DatumValue, self).__init__(value=value, **kwds) + super(X2Value, self).__init__(value=value, **kwds) class XError(FieldChannelMixin, core.SecondaryFieldDef): @@ -9854,8 +9854,8 @@ def __init__(self, datum, axis=Undefined, band=Undefined, impute=Undefined, scal stack=stack, type=type, **kwds) -class YDatumValue(ValueChannelMixin, core.PositionValueDef): - """YDatumValue schema wrapper +class YValue(ValueChannelMixin, core.PositionValueDef): + """YValue schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -9873,7 +9873,7 @@ class YDatumValue(ValueChannelMixin, core.PositionValueDef): _encoding_name = "y" def __init__(self, value, **kwds): - super(YDatumValue, self).__init__(value=value, **kwds) + super(YValue, self).__init__(value=value, **kwds) class Y2(FieldChannelMixin, core.SecondaryFieldDef): @@ -10068,8 +10068,8 @@ def __init__(self, datum, band=Undefined, type=Undefined, **kwds): super(Y2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) -class Y2DatumValue(ValueChannelMixin, core.PositionValueDef): - """Y2DatumValue schema wrapper +class Y2Value(ValueChannelMixin, core.PositionValueDef): + """Y2Value schema wrapper Mapping(required=[value]) Definition object for a constant value (primitive value or gradient definition) of an @@ -10087,7 +10087,7 @@ class Y2DatumValue(ValueChannelMixin, core.PositionValueDef): _encoding_name = "y2" def __init__(self, value, **kwds): - super(Y2DatumValue, self).__init__(value=value, **kwds) + super(Y2Value, self).__init__(value=value, **kwds) class YError(FieldChannelMixin, core.SecondaryFieldDef): diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 01855fbad..32338b865 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -450,10 +450,10 @@ def generate_vegalite_channel_wrappers(schemafile, version, imports=None): encoding = SchemaInfo(schema["definitions"][encoding_def], rootschema=schema) for prop, propschema in encoding.properties.items(): - classname = prop[0].upper() + prop[1:] def_dict = get_field_datum_value_defs(propschema, schema) for encoding_spec, definition in def_dict.items(): + classname = prop[0].upper() + prop[1:] basename = definition.split("/")[-1] basename = get_valid_identifier(basename) From fcf005bc965a01e07c72cc97539b2c4190940104 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 23 Oct 2021 16:28:32 -0700 Subject: [PATCH 03/46] Update altair/utils/core.py with Datum --- .gitignore | 1 + altair/utils/core.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ba435eb4b..80caf4e24 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,4 @@ Untitled*.ipynb # VSCode .vscode altair/utils/sample.py +sample_json.json diff --git a/altair/utils/core.py b/altair/utils/core.py index 54b81f32b..a152a041f 100644 --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -633,7 +633,12 @@ def infer_encoding_types(args, kwargs, channels): name_to_channel = {} for chan, name in channel_to_name.items(): chans = name_to_channel.setdefault(name, {}) - key = "value" if chan.__name__.endswith("Value") else "field" + if chan.__name__.endswith("Datum"): + key = "datum" + elif chan.__name__.endswith("Value"): + key = "value" + else: + key = "field" chans[key] = chan # First use the mapping to convert args to kwargs based on their types. From 5485c2382a355b3185081c06a3a88e4ce78fc07b Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 23 Oct 2021 16:48:33 -0700 Subject: [PATCH 04/46] Update DatumChannelMixin --- altair/vegalite/v4/schema/channels.py | 4 --- doc/user_guide/API.rst | 48 +++++++++++++-------------- tools/generate_schema_wrapper.py | 4 --- 3 files changed, 24 insertions(+), 32 deletions(-) diff --git a/altair/vegalite/v4/schema/channels.py b/altair/vegalite/v4/schema/channels.py index 4a253c9bc..4a841c70b 100644 --- a/altair/vegalite/v4/schema/channels.py +++ b/altair/vegalite/v4/schema/channels.py @@ -86,10 +86,6 @@ def to_dict(self, validate=True, ignore=(), context=None): if datum is not Undefined: if isinstance(datum, core.SchemaBase): pass - elif 'field' in datum and 'type' not in datum: - kwds = parse_shorthand(datum['field'], context.get('data', None)) - copy = self.copy(deep=['datum']) - copy.datum.update(kwds) return super(DatumChannelMixin, copy).to_dict(validate=validate, ignore=ignore, context=context) diff --git a/doc/user_guide/API.rst b/doc/user_guide/API.rst index 2186b0930..fa3069d64 100644 --- a/doc/user_guide/API.rst +++ b/doc/user_guide/API.rst @@ -36,10 +36,10 @@ Encoding Channels Angle AngleDatum - AngleDatumValue + AngleValue Color ColorDatum - ColorDatumValue + ColorValue Column Description DescriptionValue @@ -47,64 +47,64 @@ Encoding Channels Facet Fill FillDatum - FillDatumValue FillOpacity FillOpacityDatum - FillOpacityDatumValue + FillOpacityValue + FillValue Href HrefValue Key Latitude Latitude2 Latitude2Datum - Latitude2DatumValue + Latitude2Value LatitudeDatum - LatitudeDatumValue + LatitudeValue Longitude Longitude2 Longitude2Datum - Longitude2DatumValue + Longitude2Value LongitudeDatum - LongitudeDatumValue + LongitudeValue Opacity OpacityDatum - OpacityDatumValue + OpacityValue Order OrderValue Radius Radius2 Radius2Datum - Radius2DatumValue + Radius2Value RadiusDatum - RadiusDatumValue + RadiusValue Row Shape ShapeDatum - ShapeDatumValue + ShapeValue Size SizeDatum - SizeDatumValue + SizeValue Stroke StrokeDash StrokeDashDatum - StrokeDashDatumValue + StrokeDashValue StrokeDatum - StrokeDatumValue StrokeOpacity StrokeOpacityDatum - StrokeOpacityDatumValue + StrokeOpacityValue + StrokeValue StrokeWidth StrokeWidthDatum - StrokeWidthDatumValue + StrokeWidthValue Text TextDatum - TextDatumValue + TextValue Theta Theta2 Theta2Datum - Theta2DatumValue + Theta2Value ThetaDatum - ThetaDatumValue + ThetaValue Tooltip TooltipValue Url @@ -112,23 +112,23 @@ Encoding Channels X X2 X2Datum - X2DatumValue + X2Value XDatum - XDatumValue XError XError2 XError2Value XErrorValue + XValue Y Y2 Y2Datum - Y2DatumValue + Y2Value YDatum - YDatumValue YError YError2 YError2Value YErrorValue + YValue API Functions ------------- diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 32338b865..13dd843a9 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -168,10 +168,6 @@ def to_dict(self, validate=True, ignore=(), context=None): if datum is not Undefined: if isinstance(datum, core.SchemaBase): pass - elif 'field' in datum and 'type' not in datum: - kwds = parse_shorthand(datum['field'], context.get('data', None)) - copy = self.copy(deep=['datum']) - copy.datum.update(kwds) return super(DatumChannelMixin, copy).to_dict(validate=validate, ignore=ignore, context=context) From 5ae33990d4292188897acfb60a4d6339a080f29a Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Mon, 25 Oct 2021 15:48:37 -0700 Subject: [PATCH 05/46] Replace [] with Array in get_valid_identifier --- altair/vegalite/v4/api.py | 2 +- altair/vegalite/v4/schema/channels.py | 17 +- altair/vegalite/v4/schema/core.py | 472 +++++++++++++++++++++++++- tools/schemapi/utils.py | 3 + 4 files changed, 474 insertions(+), 20 deletions(-) diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py index 73c193617..33b1e327a 100644 --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -1768,7 +1768,7 @@ def show(self, embed_opt=None, open_browser=None): connected to a browser. """ try: - import altair_viewer + import altair_viewer # type: ignore except ImportError: raise ValueError( "show() method requires the altair_viewer package. " diff --git a/altair/vegalite/v4/schema/channels.py b/altair/vegalite/v4/schema/channels.py index 4a841c70b..6d5abfc7c 100644 --- a/altair/vegalite/v4/schema/channels.py +++ b/altair/vegalite/v4/schema/channels.py @@ -6091,7 +6091,7 @@ def __init__(self, value, condition=Undefined, **kwds): super(StrokeValue, self).__init__(value=value, condition=condition, **kwds) -class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): +class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray): """StrokeDash schema wrapper Mapping(required=[shorthand]) @@ -6143,8 +6143,8 @@ class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFie **See also:** `bin `__ documentation. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, - List(:class:`ConditionalValueDefnumberExprRef`)) + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -6319,7 +6319,7 @@ def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) -class StrokeDashDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): +class StrokeDashDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumberArray): """StrokeDashDatum schema wrapper Mapping(required=[]) @@ -6340,8 +6340,8 @@ class StrokeDashDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumD For other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to ``0``, the marks will be positioned at the beginning of the band. If set to ``0.5``, the marks will be positioned in the middle of the band. - condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, - List(:class:`ConditionalValueDefnumberExprRef`)) + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) One or more value definition(s) with `a selection or a test predicate `__. @@ -6416,7 +6416,7 @@ def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, * **kwds) -class StrokeDashValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): +class StrokeDashValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray): """StrokeDashValue schema wrapper Mapping(required=[]) @@ -6425,7 +6425,8 @@ class StrokeDashValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropField ---------- condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, - :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + :class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) A field definition or one or more value definition(s) with a selection predicate. value : anyOf(List(float), :class:`ExprRef`) A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient diff --git a/altair/vegalite/v4/schema/core.py b/altair/vegalite/v4/schema/core.py index 103b3dcd7..acb88bed8 100644 --- a/altair/vegalite/v4/schema/core.py +++ b/altair/vegalite/v4/schema/core.py @@ -2244,6 +2244,17 @@ 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 @@ -2378,6 +2389,17 @@ 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 @@ -3000,6 +3022,64 @@ def __init__(self, selection=Undefined, value=Undefined, **kwds): **kwds) +class ConditionalValueDefnumberArrayExprRef(VegaLiteSchema): + """ConditionalValueDefnumberArrayExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefnumberArrayExprRef`, + :class:`ConditionalSelectionValueDefnumberArrayExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(number[]|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefnumberArrayExprRef, self).__init__(*args, **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 ConditionalSelectionValueDefnumberArrayExprRef(ConditionalValueDefnumberArrayExprRef): + """ConditionalSelectionValueDefnumberArrayExprRef schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + 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/ConditionalSelection>'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefnumberArrayExprRef, self).__init__(selection=selection, + value=value, **kwds) + + class ConditionalValueDefnumberExprRef(VegaLiteSchema): """ConditionalValueDefnumberExprRef schema wrapper @@ -8924,12 +9004,25 @@ class MarkPropDefnumber(VegaLiteSchema): :class:`FieldOrDatumDefWithConditionDatumDefnumber`, :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`) """ - _schema = {'$ref': '#/definitions/MarkPropDef'} + _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 @@ -9420,9 +9513,9 @@ def __init__(self, vconcat=Undefined, bounds=Undefined, center=Undefined, data=U class NumericArrayMarkPropDef(VegaLiteSchema): """NumericArrayMarkPropDef schema wrapper - anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumber`, - :class:`FieldOrDatumDefWithConditionDatumDefnumber`, - :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumber`) + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, + :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`) """ _schema = {'$ref': '#/definitions/NumericArrayMarkPropDef'} @@ -9430,6 +9523,338 @@ 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 + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + One or more value definition(s) with `a selection 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. + 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, band=Undefined, condition=Undefined, datum=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefnumberArray, self).__init__(band=band, + condition=condition, + datum=datum, 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. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 selection 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, band=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, + band=band, + 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 @@ -9443,7 +9868,7 @@ def __init__(self, *args, **kwds): super(NumericMarkPropDef, self).__init__(*args, **kwds) -class FieldOrDatumDefWithConditionDatumDefnumber(MarkPropDefnumber, NumericArrayMarkPropDef, NumericMarkPropDef): +class FieldOrDatumDefWithConditionDatumDefnumber(MarkPropDefnumber, NumericMarkPropDef): """FieldOrDatumDefWithConditionDatumDefnumber schema wrapper Mapping(required=[]) @@ -9533,14 +9958,14 @@ class FieldOrDatumDefWithConditionDatumDefnumber(MarkPropDefnumber, NumericArray **See also:** `type `__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} def __init__(self, band=Undefined, condition=Undefined, datum=Undefined, type=Undefined, **kwds): super(FieldOrDatumDefWithConditionDatumDefnumber, self).__init__(band=band, condition=condition, datum=datum, type=type, **kwds) -class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, NumericArrayMarkPropDef, NumericMarkPropDef): +class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, NumericMarkPropDef): """FieldOrDatumDefWithConditionMarkPropFieldDefnumber schema wrapper Mapping(required=[]) @@ -9755,7 +10180,7 @@ class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, Nume **See also:** `type `__ documentation. """ - _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, condition=Undefined, field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, @@ -18967,7 +19392,7 @@ def __init__(self, condition=Undefined, value=Undefined, **kwds): **kwds) -class ValueDefWithConditionMarkPropFieldOrDatumDefnumber(MarkPropDefnumber, NumericArrayMarkPropDef, NumericMarkPropDef): +class ValueDefWithConditionMarkPropFieldOrDatumDefnumber(MarkPropDefnumber, NumericMarkPropDef): """ValueDefWithConditionMarkPropFieldOrDatumDefnumber schema wrapper Mapping(required=[]) @@ -18978,18 +19403,43 @@ class ValueDefWithConditionMarkPropFieldOrDatumDefnumber(MarkPropDefnumber, Nume condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) A field definition or one or more value definition(s) with a selection predicate. - value : anyOf(List(float), :class:`ExprRef`) + 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'} + _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 selection 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 diff --git a/tools/schemapi/utils.py b/tools/schemapi/utils.py index db62770fc..d0b149f3f 100644 --- a/tools/schemapi/utils.py +++ b/tools/schemapi/utils.py @@ -65,6 +65,9 @@ def get_valid_identifier( if url_decode: prop = urllib.parse.unquote(prop) + # Deal with [] + prop = prop.replace("[]", "Array") + # First substitute-out all non-valid characters. flags = re.UNICODE if allow_unicode else re.ASCII valid = re.sub(r"\W", replacement_character, prop, flags=flags) From f45e75b90cdcaa003a94b528d30f077700334d7f Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 26 Oct 2021 09:07:23 -0700 Subject: [PATCH 06/46] Allow "week" as time unit --- altair/utils/core.py | 1 + 1 file changed, 1 insertion(+) diff --git a/altair/utils/core.py b/altair/utils/core.py index a152a041f..d5da4acc4 100644 --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -124,6 +124,7 @@ def infer_dtype(value): "year", "quarter", "month", + "week", "day", "date", "hours", From 64110787aef4bc15e059ca65aad3e09d26941ee2 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 26 Oct 2021 09:24:47 -0700 Subject: [PATCH 07/46] Update allowable time units --- altair/utils/core.py | 81 +++++++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 24 deletions(-) diff --git a/altair/utils/core.py b/altair/utils/core.py index d5da4acc4..a45a1bb81 100644 --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -96,36 +96,14 @@ def infer_dtype(value): "nth_value", ] -# timeUnits from vega-lite version 4.6.0 +# timeUnits from vega-lite version 4.17.0 TIMEUNITS = [ - "utcyear", - "utcquarter", - "utcmonth", - "utcday", - "utcdate", - "utchours", - "utcminutes", - "utcseconds", - "utcmilliseconds", - "utcyearquarter", - "utcyearquartermonth", - "utcyearmonth", - "utcyearmonthdate", - "utcyearmonthdatehours", - "utcyearmonthdatehoursminutes", - "utcyearmonthdatehoursminutesseconds", - "utcquartermonth", - "utcmonthdate", - "utcmonthdatehours", - "utchoursminutes", - "utchoursminutesseconds", - "utcminutesseconds", - "utcsecondsmilliseconds", "year", "quarter", "month", "week", "day", + "dayofyear", "date", "hours", "minutes", @@ -138,13 +116,68 @@ def infer_dtype(value): "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", + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + "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", ] From 2c78afa0c4d3c1bb11d859eda92e3642c28977c3 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 26 Oct 2021 12:40:38 -0700 Subject: [PATCH 08/46] Update TopLevelRepeatSpec --- altair/vegalite/v4/schema/core.py | 138 ++++- .../vegalite/v4/schema/vega-lite-schema.json | 491 ++++++------------ doc/user_guide/API.rst | 9 + tools/generate_schema_wrapper.py | 23 + 4 files changed, 325 insertions(+), 336 deletions(-) diff --git a/altair/vegalite/v4/schema/core.py b/altair/vegalite/v4/schema/core.py index acb88bed8..c1c897ab6 100644 --- a/altair/vegalite/v4/schema/core.py +++ b/altair/vegalite/v4/schema/core.py @@ -18110,12 +18110,144 @@ def __init__(self, vconcat=Undefined, autosize=Undefined, background=Undefined, class TopLevelRepeatSpec(TopLevelSpec): """TopLevelRepeatSpec schema wrapper - anyOf(Mapping(required=[repeat, spec]), Mapping(required=[repeat, spec])) + Mapping(required=[repeat, spec]) + + Attributes + ---------- + + repeat : anyOf(List(string), :class:`RepeatMapping`, :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 : :class:`Spec` + 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"``. + 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(:class:`Parameter`) + Dynamic variables 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:`Dictunknown` + 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/v4.json``. Setting the ``$schema`` + property allows automatic validation and autocomplete in editors that support JSON + schema. """ _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} - def __init__(self, *args, **kwds): - super(TopLevelRepeatSpec, self).__init__(*args, **kwds) + 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): + super(TopLevelRepeatSpec, 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) class TopLevelUnitSpec(TopLevelSpec): diff --git a/altair/vegalite/v4/schema/vega-lite-schema.json b/altair/vegalite/v4/schema/vega-lite-schema.json index dc73fa4aa..8aaa1263e 100644 --- a/altair/vegalite/v4/schema/vega-lite-schema.json +++ b/altair/vegalite/v4/schema/vega-lite-schema.json @@ -4314,8 +4314,7 @@ "type": "string" }, "options": { - "items": { - }, + "items": {}, "type": "array" }, "type": { @@ -7978,8 +7977,7 @@ "type": "object" }, "Dict": { - "additionalProperties": { - }, + "additionalProperties": {}, "type": "object" }, "Diverging": { @@ -11445,10 +11443,8 @@ ], "type": "object" }, - "GeoJsonFeature": { - }, - "GeoJsonFeatureCollection": { - }, + "GeoJsonFeature": {}, + "GeoJsonFeatureCollection": {}, "Gradient": { "anyOf": [ { @@ -12158,8 +12154,7 @@ "keyvals": { "anyOf": [ { - "items": { - }, + "items": {}, "type": "array" }, { @@ -12240,8 +12235,7 @@ "keyvals": { "anyOf": [ { - "items": { - }, + "items": {}, "type": "array" }, { @@ -29954,347 +29948,178 @@ "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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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." + "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/v4.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" }, - "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." + { + "$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. - 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.\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" }, - "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." + { + "$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" }, - "description": { - "description": "Description of this mark for commenting purpose.", - "type": "string" + { + "$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. - 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" }, - "name": { - "description": "Name of the visualization for later reference.", - "type": "string" + { + "$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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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" }, - "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`" + { + "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" }, - "params": { - "description": "Dynamic variables that parameterize a visualization.", + { + "$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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "repeat": { + "anyOf": [ + { "items": { - "$ref": "#/definitions/Parameter" + "type": "string" }, "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/Spec", - "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" + { + "$ref": "#/definitions/RepeatMapping" }, - "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." + { + "$ref": "#/definitions/LayerRepeatMapping" } - }, - "required": [ - "repeat", - "spec" ], - "type": "object" + "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." }, - { - "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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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`).", + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { "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 that parameterize a visualization.", - "items": { - "$ref": "#/definitions/Parameter" - }, - "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" + { + "$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/Spec", + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" }, - "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." + { + "$ref": "#/definitions/TitleParams" } - }, - "required": [ - "repeat", - "spec" ], - "type": "object" + "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, diff --git a/doc/user_guide/API.rst b/doc/user_guide/API.rst index fa3069d64..dba0f0510 100644 --- a/doc/user_guide/API.rst +++ b/doc/user_guide/API.rst @@ -221,6 +221,7 @@ Low-Level Schema Wrappers ConditionalAxisPropertyFontStylenull ConditionalAxisPropertyFontWeightnull ConditionalAxisPropertyTextBaselinenull + ConditionalAxisPropertynumberArraynull ConditionalAxisPropertynumbernull ConditionalAxisPropertystringnull ConditionalAxisString @@ -237,6 +238,8 @@ Low-Level Schema Wrappers ConditionalPredicateValueDefTextBaselinenullExprRef ConditionalPredicateValueDefTextExprRef ConditionalPredicateValueDefnumber + ConditionalPredicateValueDefnumberArrayExprRef + ConditionalPredicateValueDefnumberArraynullExprRef ConditionalPredicateValueDefnumberExprRef ConditionalPredicateValueDefnumbernullExprRef ConditionalPredicateValueDefstringExprRef @@ -247,6 +250,7 @@ Low-Level Schema Wrappers ConditionalSelectionValueDefGradientstringnullExprRef ConditionalSelectionValueDefTextExprRef ConditionalSelectionValueDefnumber + ConditionalSelectionValueDefnumberArrayExprRef ConditionalSelectionValueDefnumberExprRef ConditionalSelectionValueDefstringExprRef ConditionalSelectionValueDefstringnullExprRef @@ -254,6 +258,7 @@ Low-Level Schema Wrappers ConditionalValueDefGradientstringnullExprRef ConditionalValueDefTextExprRef ConditionalValueDefnumber + ConditionalValueDefnumberArrayExprRef ConditionalValueDefnumberExprRef ConditionalValueDefstringExprRef ConditionalValueDefstringnullExprRef @@ -312,10 +317,12 @@ Low-Level Schema Wrappers FieldOneOfPredicate FieldOrDatumDefWithConditionDatumDefGradientstringnull FieldOrDatumDefWithConditionDatumDefnumber + FieldOrDatumDefWithConditionDatumDefnumberArray FieldOrDatumDefWithConditionDatumDefstringnull FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull FieldOrDatumDefWithConditionMarkPropFieldDefnumber + FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray FieldOrDatumDefWithConditionStringDatumDefText FieldOrDatumDefWithConditionStringFieldDefText FieldOrDatumDefWithConditionStringFieldDefstring @@ -381,6 +388,7 @@ Low-Level Schema Wrappers MarkDef MarkPropDefGradientstringnull MarkPropDefnumber + MarkPropDefnumberArray MarkPropDefstringnullTypeForShape MarkType MergedStream @@ -538,6 +546,7 @@ Low-Level Schema Wrappers ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull ValueDefWithConditionMarkPropFieldOrDatumDefnumber + ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray ValueDefWithConditionMarkPropFieldOrDatumDefstringnull ValueDefWithConditionStringFieldDefText ValueDefnumber diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 13dd843a9..33027a47f 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -606,6 +606,29 @@ def vegalite_main(skip_download=False): skip_download=skip_download, ) + # Put TopLevelRepeatSpec into a more consistent format with the rest of the schema + # TODO: Find a more elegant way of dealing with this. + if (library == "vega-lite") and (SCHEMA_VERSION[library][version] == "v4.17.0"): + with open(schemafile, encoding="utf8") as f: + rootschema = json.load(f) + + repeat_schema = rootschema["definitions"]["TopLevelRepeatSpec"]["anyOf"][0] + repeat_description = repeat_schema["properties"]["repeat"]["description"] + repeat_options = [ + {"items": {"type": "string"}, "type": "array"}, + {"$ref": "#/definitions/RepeatMapping"}, + {"$ref": "#/definitions/LayerRepeatMapping"}, + ] + repeat_schema["properties"]["repeat"] = { + "anyOf": repeat_options, + "description": repeat_description, + } + + rootschema["definitions"]["TopLevelRepeatSpec"] = repeat_schema + + with open(schemafile, "w", encoding="utf-8") as f: + json.dump(rootschema, f, ensure_ascii=False, indent=2) + # Generate __init__.py file outfile = join(schemapath, "__init__.py") print("Writing {}".format(outfile)) From 0ba0c79ae473b2f5675b320d0677c78a7ae1ff03 Mon Sep 17 00:00:00 2001 From: mattijn Date: Wed, 27 Oct 2021 23:37:10 +0200 Subject: [PATCH 09/46] include layer for repeat --- altair/vegalite/v4/api.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py index 33b1e327a..b41bb5299 100644 --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -511,6 +511,7 @@ def repeat( repeat=Undefined, row=Undefined, column=Undefined, + layer=Undefined, columns=Undefined, **kwargs, ): @@ -523,11 +524,14 @@ def repeat( ---------- repeat : list a list of data column names to be repeated. This cannot be - used along with the ``row`` or ``column`` argument. + 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. @@ -541,14 +545,23 @@ def repeat( """ 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) @@ -2133,15 +2146,15 @@ def repeat(repeater="repeat"): Parameters ---------- - repeater : {'row'|'column'|'repeat'} + 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"]: - raise ValueError("repeater must be one of ['row', 'column', 'repeat']") + if repeater not in ["row", "column", "repeat", "layer"]: + raise ValueError("repeater must be one of ['row', 'column', 'repeat', 'layer']") return core.RepeatRef(repeat=repeater) From 3251337acd2dd635ab84c78a6153b5b349ba0c65 Mon Sep 17 00:00:00 2001 From: mattijn Date: Wed, 27 Oct 2021 23:38:34 +0200 Subject: [PATCH 10/46] removed TopLevelRepeatSpec, its the schema --- tools/generate_schema_wrapper.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 33027a47f..13dd843a9 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -606,29 +606,6 @@ def vegalite_main(skip_download=False): skip_download=skip_download, ) - # Put TopLevelRepeatSpec into a more consistent format with the rest of the schema - # TODO: Find a more elegant way of dealing with this. - if (library == "vega-lite") and (SCHEMA_VERSION[library][version] == "v4.17.0"): - with open(schemafile, encoding="utf8") as f: - rootschema = json.load(f) - - repeat_schema = rootschema["definitions"]["TopLevelRepeatSpec"]["anyOf"][0] - repeat_description = repeat_schema["properties"]["repeat"]["description"] - repeat_options = [ - {"items": {"type": "string"}, "type": "array"}, - {"$ref": "#/definitions/RepeatMapping"}, - {"$ref": "#/definitions/LayerRepeatMapping"}, - ] - repeat_schema["properties"]["repeat"] = { - "anyOf": repeat_options, - "description": repeat_description, - } - - rootschema["definitions"]["TopLevelRepeatSpec"] = repeat_schema - - with open(schemafile, "w", encoding="utf-8") as f: - json.dump(rootschema, f, ensure_ascii=False, indent=2) - # Generate __init__.py file outfile = join(schemapath, "__init__.py") print("Writing {}".format(outfile)) From aeea9f327d54e3d1c553008e673e31841cc4897c Mon Sep 17 00:00:00 2001 From: mattijn Date: Wed, 27 Oct 2021 23:39:14 +0200 Subject: [PATCH 11/46] auto-generated files --- altair/vegalite/v4/schema/core.py | 138 +---- .../vegalite/v4/schema/vega-lite-schema.json | 491 ++++++++++++------ 2 files changed, 336 insertions(+), 293 deletions(-) diff --git a/altair/vegalite/v4/schema/core.py b/altair/vegalite/v4/schema/core.py index c1c897ab6..acb88bed8 100644 --- a/altair/vegalite/v4/schema/core.py +++ b/altair/vegalite/v4/schema/core.py @@ -18110,144 +18110,12 @@ def __init__(self, vconcat=Undefined, autosize=Undefined, background=Undefined, class TopLevelRepeatSpec(TopLevelSpec): """TopLevelRepeatSpec schema wrapper - Mapping(required=[repeat, spec]) - - Attributes - ---------- - - repeat : anyOf(List(string), :class:`RepeatMapping`, :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 : :class:`Spec` - 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"``. - 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(:class:`Parameter`) - Dynamic variables 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:`Dictunknown` - 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/v4.json``. Setting the ``$schema`` - property allows automatic validation and autocomplete in editors that support JSON - schema. + anyOf(Mapping(required=[repeat, spec]), Mapping(required=[repeat, spec])) """ _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} - 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): - super(TopLevelRepeatSpec, 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 __init__(self, *args, **kwds): + super(TopLevelRepeatSpec, self).__init__(*args, **kwds) class TopLevelUnitSpec(TopLevelSpec): diff --git a/altair/vegalite/v4/schema/vega-lite-schema.json b/altair/vegalite/v4/schema/vega-lite-schema.json index 8aaa1263e..dc73fa4aa 100644 --- a/altair/vegalite/v4/schema/vega-lite-schema.json +++ b/altair/vegalite/v4/schema/vega-lite-schema.json @@ -4314,7 +4314,8 @@ "type": "string" }, "options": { - "items": {}, + "items": { + }, "type": "array" }, "type": { @@ -7977,7 +7978,8 @@ "type": "object" }, "Dict": { - "additionalProperties": {}, + "additionalProperties": { + }, "type": "object" }, "Diverging": { @@ -11443,8 +11445,10 @@ ], "type": "object" }, - "GeoJsonFeature": {}, - "GeoJsonFeatureCollection": {}, + "GeoJsonFeature": { + }, + "GeoJsonFeatureCollection": { + }, "Gradient": { "anyOf": [ { @@ -12154,7 +12158,8 @@ "keyvals": { "anyOf": [ { - "items": {}, + "items": { + }, "type": "array" }, { @@ -12235,7 +12240,8 @@ "keyvals": { "anyOf": [ { - "items": {}, + "items": { + }, "type": "array" }, { @@ -29948,178 +29954,347 @@ "type": "object" }, "TopLevelRepeatSpec": { - "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/v4.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" + "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/v4.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" }, - { - "$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. - 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.\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" + "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. - 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.\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\"`." }, - { - "$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" + "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`" }, - { - "$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. - 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" + "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\"`" }, - { - "$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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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" + "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. - 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" }, - { - "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" + "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`" }, - { - "$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 that parameterize a visualization.", - "items": { - "$ref": "#/definitions/Parameter" - }, - "type": "array" - }, - "repeat": { - "anyOf": [ - { + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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 that parameterize a visualization.", "items": { - "type": "string" + "$ref": "#/definitions/Parameter" }, "type": "array" }, - { - "$ref": "#/definitions/RepeatMapping" + "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." }, - { - "$ref": "#/definitions/LayerRepeatMapping" + "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/Spec", + "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" ], - "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." + "type": "object" }, - "spacing": { - "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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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" }, - { - "$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/Spec", - "description": "A specification of the view that gets repeated." - }, - "title": { - "anyOf": [ - { - "$ref": "#/definitions/Text" + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." }, - { - "$ref": "#/definitions/TitleParams" + "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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "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." } - ], - "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" } - }, - "required": [ - "repeat", - "spec" - ], - "type": "object" + ] }, "TopLevelFacetSpec": { "additionalProperties": false, From 8305ac317af055da2198847a334c680d9cc6e01d Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 28 Oct 2021 16:00:20 -0700 Subject: [PATCH 12/46] Dealing with TopLevelRepeatSpec The way the schema is written for TopLevelRepeatSpec gives the current code trouble. We patch it in an ad hoc way, and should later find a more sustainable method. --- altair/utils/schemapi.py | 4 +- altair/utils/tests/test_mimebundle.py | 6 +- altair/vegalite/v3/schema/channels.py | 4 - altair/vegalite/v3/tests/test_api.py | 29 +- altair/vegalite/v4/schema/core.py | 138 ++++- .../vegalite/v4/schema/vega-lite-schema.json | 491 ++++++------------ altair/vegalite/v4/tests/test_api.py | 29 +- tools/generate_schema_wrapper.py | 25 +- tools/schemapi/schemapi.py | 4 +- 9 files changed, 330 insertions(+), 400 deletions(-) diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index 5ffb26e0f..a43ffc1bd 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -554,9 +554,7 @@ def _passthrough(*args, **kwds): continue else: return self.from_dict( - dct, - schema=possible_schema, - rootschema=rootschema, + dct, schema=possible_schema, rootschema=rootschema, ) if isinstance(dct, dict): diff --git a/altair/utils/tests/test_mimebundle.py b/altair/utils/tests/test_mimebundle.py index 9c5a9458a..56f7cd497 100644 --- a/altair/utils/tests/test_mimebundle.py +++ b/altair/utils/tests/test_mimebundle.py @@ -183,9 +183,5 @@ def test_spec_to_vega_mimebundle(vega_spec): def test_spec_to_json_mimebundle(): - bundle = spec_to_mimebundle( - spec=vegalite_spec, - mode="vega-lite", - format="json", - ) + bundle = spec_to_mimebundle(spec=vegalite_spec, mode="vega-lite", format="json",) assert bundle == {"application/json": vegalite_spec} diff --git a/altair/vegalite/v3/schema/channels.py b/altair/vegalite/v3/schema/channels.py index 73a9e73a4..63fdf8a2f 100644 --- a/altair/vegalite/v3/schema/channels.py +++ b/altair/vegalite/v3/schema/channels.py @@ -86,10 +86,6 @@ def to_dict(self, validate=True, ignore=(), context=None): if datum is not Undefined: if isinstance(datum, core.SchemaBase): pass - elif 'field' in datum and 'type' not in datum: - kwds = parse_shorthand(datum['field'], context.get('data', None)) - copy = self.copy(deep=['datum']) - copy.datum.update(kwds) return super(DatumChannelMixin, copy).to_dict(validate=validate, ignore=ignore, context=context) diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py index 489d8cf67..466631e9d 100644 --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -38,15 +38,7 @@ def _make_chart_type(chart_type): "color": list("AAAABBBB"), } ) - base = ( - alt.Chart(data) - .mark_point() - .encode( - x="x", - y="y", - color="color", - ) - ) + 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) @@ -301,10 +293,7 @@ def test_facet_basic(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode( - x="x:Q", - y="y:Q", - ) + .encode(x="x:Q", y="y:Q",) .facet("category:N", columns=2) ) @@ -318,10 +307,7 @@ def test_facet_basic(): chart2 = ( alt.Chart("data.csv") .mark_point() - .encode( - x="x:Q", - y="y:Q", - ) + .encode(x="x:Q", y="y:Q",) .facet(row="category1:Q", column="category2:Q") ) @@ -746,10 +732,7 @@ def test_repeat(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode( - x=alt.X(alt.repeat(), type="quantitative"), - y="y:Q", - ) + .encode(x=alt.X(alt.repeat(), type="quantitative"), y="y:Q",) .repeat(["A", "B", "C", "D"], columns=2) ) @@ -876,9 +859,7 @@ def test_layer_errors(): def test_resolve(chart_type): chart = _make_chart_type(chart_type) chart = ( - chart.resolve_scale( - x="independent", - ) + chart.resolve_scale(x="independent",) .resolve_legend(color="independent") .resolve_axis(y="independent") ) diff --git a/altair/vegalite/v4/schema/core.py b/altair/vegalite/v4/schema/core.py index acb88bed8..c1c897ab6 100644 --- a/altair/vegalite/v4/schema/core.py +++ b/altair/vegalite/v4/schema/core.py @@ -18110,12 +18110,144 @@ def __init__(self, vconcat=Undefined, autosize=Undefined, background=Undefined, class TopLevelRepeatSpec(TopLevelSpec): """TopLevelRepeatSpec schema wrapper - anyOf(Mapping(required=[repeat, spec]), Mapping(required=[repeat, spec])) + Mapping(required=[repeat, spec]) + + Attributes + ---------- + + repeat : anyOf(List(string), :class:`RepeatMapping`, :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 : :class:`Spec` + 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"``. + 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(:class:`Parameter`) + Dynamic variables 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:`Dictunknown` + 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/v4.json``. Setting the ``$schema`` + property allows automatic validation and autocomplete in editors that support JSON + schema. """ _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} - def __init__(self, *args, **kwds): - super(TopLevelRepeatSpec, self).__init__(*args, **kwds) + 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): + super(TopLevelRepeatSpec, 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) class TopLevelUnitSpec(TopLevelSpec): diff --git a/altair/vegalite/v4/schema/vega-lite-schema.json b/altair/vegalite/v4/schema/vega-lite-schema.json index dc73fa4aa..8aaa1263e 100644 --- a/altair/vegalite/v4/schema/vega-lite-schema.json +++ b/altair/vegalite/v4/schema/vega-lite-schema.json @@ -4314,8 +4314,7 @@ "type": "string" }, "options": { - "items": { - }, + "items": {}, "type": "array" }, "type": { @@ -7978,8 +7977,7 @@ "type": "object" }, "Dict": { - "additionalProperties": { - }, + "additionalProperties": {}, "type": "object" }, "Diverging": { @@ -11445,10 +11443,8 @@ ], "type": "object" }, - "GeoJsonFeature": { - }, - "GeoJsonFeatureCollection": { - }, + "GeoJsonFeature": {}, + "GeoJsonFeatureCollection": {}, "Gradient": { "anyOf": [ { @@ -12158,8 +12154,7 @@ "keyvals": { "anyOf": [ { - "items": { - }, + "items": {}, "type": "array" }, { @@ -12240,8 +12235,7 @@ "keyvals": { "anyOf": [ { - "items": { - }, + "items": {}, "type": "array" }, { @@ -29954,347 +29948,178 @@ "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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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." + "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/v4.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" }, - "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." + { + "$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. - 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.\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" }, - "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." + { + "$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" }, - "description": { - "description": "Description of this mark for commenting purpose.", - "type": "string" + { + "$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. - 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" }, - "name": { - "description": "Name of the visualization for later reference.", - "type": "string" + { + "$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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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" }, - "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`" + { + "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" }, - "params": { - "description": "Dynamic variables that parameterize a visualization.", + { + "$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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "repeat": { + "anyOf": [ + { "items": { - "$ref": "#/definitions/Parameter" + "type": "string" }, "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/Spec", - "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" + { + "$ref": "#/definitions/RepeatMapping" }, - "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." + { + "$ref": "#/definitions/LayerRepeatMapping" } - }, - "required": [ - "repeat", - "spec" ], - "type": "object" + "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." }, - { - "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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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`).", + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { "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 that parameterize a visualization.", - "items": { - "$ref": "#/definitions/Parameter" - }, - "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" + { + "$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/Spec", + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" }, - "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." + { + "$ref": "#/definitions/TitleParams" } - }, - "required": [ - "repeat", - "spec" ], - "type": "object" + "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, diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py index 830da2f96..52753cc20 100644 --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -38,15 +38,7 @@ def _make_chart_type(chart_type): "color": list("AAAABBBB"), } ) - base = ( - alt.Chart(data) - .mark_point() - .encode( - x="x", - y="y", - color="color", - ) - ) + 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) @@ -303,10 +295,7 @@ def test_facet_basic(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode( - x="x:Q", - y="y:Q", - ) + .encode(x="x:Q", y="y:Q",) .facet("category:N", columns=2) ) @@ -320,10 +309,7 @@ def test_facet_basic(): chart2 = ( alt.Chart("data.csv") .mark_point() - .encode( - x="x:Q", - y="y:Q", - ) + .encode(x="x:Q", y="y:Q",) .facet(row="category1:Q", column="category2:Q") ) @@ -758,10 +744,7 @@ def test_repeat(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode( - x=alt.X(alt.repeat(), type="quantitative"), - y="y:Q", - ) + .encode(x=alt.X(alt.repeat(), type="quantitative"), y="y:Q",) .repeat(["A", "B", "C", "D"], columns=2) ) @@ -888,9 +871,7 @@ def test_layer_errors(): def test_resolve(chart_type): chart = _make_chart_type(chart_type) chart = ( - chart.resolve_scale( - x="independent", - ) + chart.resolve_scale(x="independent",) .resolve_legend(color="independent") .resolve_axis(y="independent") ) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 13dd843a9..9f22c3d6c 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -27,7 +27,7 @@ # Map of version name to github branch name. SCHEMA_VERSION = { "vega": {"v5": "v5.10.0"}, - "vega-lite": {"v4": "v4.17.0"} + "vega-lite": {"v3": "v3.4.0", "v4": "v4.17.0"} # "vega-lite": {"v3": "v3.4.0", "v4": "v4.8.1"}, } @@ -606,6 +606,29 @@ def vegalite_main(skip_download=False): skip_download=skip_download, ) + # Put TopLevelRepeatSpec into a more consistent format with the rest of the schema + # TODO: Find a more elegant way of dealing with this. + if (library == "vega-lite") and (SCHEMA_VERSION[library][version] == "v4.17.0"): + with open(schemafile, encoding="utf8") as f: + rootschema = json.load(f) + + repeat_schema = rootschema["definitions"]["TopLevelRepeatSpec"]["anyOf"][0] + repeat_description = repeat_schema["properties"]["repeat"]["description"] + repeat_options = [ + {"items": {"type": "string"}, "type": "array"}, + {"$ref": "#/definitions/RepeatMapping"}, + {"$ref": "#/definitions/LayerRepeatMapping"}, + ] + repeat_schema["properties"]["repeat"] = { + "anyOf": repeat_options, + "description": repeat_description, + } + + rootschema["definitions"]["TopLevelRepeatSpec"] = repeat_schema + + with open(schemafile, "w", encoding="utf-8") as f: + json.dump(rootschema, f, ensure_ascii=False, indent=2) + # Generate __init__.py file outfile = join(schemapath, "__init__.py") print("Writing {}".format(outfile)) diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index d31d5f8eb..46270fe70 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -552,9 +552,7 @@ def _passthrough(*args, **kwds): continue else: return self.from_dict( - dct, - schema=possible_schema, - rootschema=rootschema, + dct, schema=possible_schema, rootschema=rootschema, ) if isinstance(dct, dict): From 105c924e9a247cdd179a89c99a04b957a52f3803 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 28 Oct 2021 16:14:04 -0700 Subject: [PATCH 13/46] Formatting updates --- altair/utils/schemapi.py | 4 +++- altair/utils/tests/test_mimebundle.py | 6 +++++- altair/vegalite/v3/tests/test_api.py | 29 ++++++++++++++++++++++----- altair/vegalite/v4/tests/test_api.py | 29 ++++++++++++++++++++++----- tools/schemapi/schemapi.py | 4 +++- 5 files changed, 59 insertions(+), 13 deletions(-) diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index a43ffc1bd..5ffb26e0f 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -554,7 +554,9 @@ def _passthrough(*args, **kwds): continue else: return self.from_dict( - dct, schema=possible_schema, rootschema=rootschema, + dct, + schema=possible_schema, + rootschema=rootschema, ) if isinstance(dct, dict): diff --git a/altair/utils/tests/test_mimebundle.py b/altair/utils/tests/test_mimebundle.py index 56f7cd497..9c5a9458a 100644 --- a/altair/utils/tests/test_mimebundle.py +++ b/altair/utils/tests/test_mimebundle.py @@ -183,5 +183,9 @@ def test_spec_to_vega_mimebundle(vega_spec): def test_spec_to_json_mimebundle(): - bundle = spec_to_mimebundle(spec=vegalite_spec, mode="vega-lite", format="json",) + bundle = spec_to_mimebundle( + spec=vegalite_spec, + mode="vega-lite", + format="json", + ) assert bundle == {"application/json": vegalite_spec} diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py index 466631e9d..489d8cf67 100644 --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -38,7 +38,15 @@ def _make_chart_type(chart_type): "color": list("AAAABBBB"), } ) - base = alt.Chart(data).mark_point().encode(x="x", y="y", color="color",) + 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) @@ -293,7 +301,10 @@ def test_facet_basic(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet("category:N", columns=2) ) @@ -307,7 +318,10 @@ def test_facet_basic(): chart2 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet(row="category1:Q", column="category2:Q") ) @@ -732,7 +746,10 @@ def test_repeat(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x=alt.X(alt.repeat(), type="quantitative"), y="y:Q",) + .encode( + x=alt.X(alt.repeat(), type="quantitative"), + y="y:Q", + ) .repeat(["A", "B", "C", "D"], columns=2) ) @@ -859,7 +876,9 @@ def test_layer_errors(): def test_resolve(chart_type): chart = _make_chart_type(chart_type) chart = ( - chart.resolve_scale(x="independent",) + chart.resolve_scale( + x="independent", + ) .resolve_legend(color="independent") .resolve_axis(y="independent") ) diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py index 52753cc20..830da2f96 100644 --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -38,7 +38,15 @@ def _make_chart_type(chart_type): "color": list("AAAABBBB"), } ) - base = alt.Chart(data).mark_point().encode(x="x", y="y", color="color",) + 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) @@ -295,7 +303,10 @@ def test_facet_basic(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet("category:N", columns=2) ) @@ -309,7 +320,10 @@ def test_facet_basic(): chart2 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet(row="category1:Q", column="category2:Q") ) @@ -744,7 +758,10 @@ def test_repeat(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x=alt.X(alt.repeat(), type="quantitative"), y="y:Q",) + .encode( + x=alt.X(alt.repeat(), type="quantitative"), + y="y:Q", + ) .repeat(["A", "B", "C", "D"], columns=2) ) @@ -871,7 +888,9 @@ def test_layer_errors(): def test_resolve(chart_type): chart = _make_chart_type(chart_type) chart = ( - chart.resolve_scale(x="independent",) + chart.resolve_scale( + x="independent", + ) .resolve_legend(color="independent") .resolve_axis(y="independent") ) diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index 46270fe70..d31d5f8eb 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -552,7 +552,9 @@ def _passthrough(*args, **kwds): continue else: return self.from_dict( - dct, schema=possible_schema, rootschema=rootschema, + dct, + schema=possible_schema, + rootschema=rootschema, ) if isinstance(dct, dict): From 0a15c5d454efebf386ef4f3038dc83bb8edd95ee Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 30 Oct 2021 17:59:55 -0700 Subject: [PATCH 14/46] Update "Encoding Channel Options" part of docs --- doc/user_guide/encoding.rst | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/doc/user_guide/encoding.rst b/doc/user_guide/encoding.rst index 6267cdd25..b761f153d 100644 --- a/doc/user_guide/encoding.rst +++ b/doc/user_guide/encoding.rst @@ -255,24 +255,32 @@ The :class:`X` and :class:`Y` encodings accept the following options: The :class:`Color`, :class:`Fill`, and :class:`Stroke` encodings accept the following options: -.. altair-object-table:: altair.StringFieldDefWithCondition +.. altair-object-table:: altair.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull The :class:`Shape` encoding accepts the following options: -.. altair-object-table:: altair.ShapeFieldDefWithCondition +.. altair-object-table:: altair.FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull -The :class:`FillOpacity`, :class:`Opacity`, :class:`Size`, :class:`StrokeOpacity`, +The :class:`Angle`, :class:`FillOpacity`, :class:`Opacity`, :class:`Size`, :class:`StrokeOpacity`, and :class:`StrokeWidth` encodings accept the following options: -.. altair-object-table:: altair.NumericFieldDefWithCondition +.. altair-object-table:: altair.FieldOrDatumDefWithConditionMarkPropFieldDefnumber + +The :class:`Row` and :class:`Column`, and :class:`Facet` encodings accept the following options: + +.. altair-object-table:: altair.RowColumnEncodingFieldDef -The :class:`Row`, :class:`Column`, and :class:`Facet` encodings accept the following options: +The :class:`Facet` encoding accepts the following options: -.. altair-object-table:: altair.FacetFieldDef +.. altair-object-table:: altair.FacetEncodingFieldDef -The :class:`Text` and :class:`Tooltip` encodings accept the following options: +The :class:`Text` encoding accepts the following options: -.. altair-object-table:: altair.TextFieldDefWithCondition +.. altair-object-table:: altair.FieldOrDatumDefWithConditionStringFieldDefText + +The :class:`Description`, :class:`Href`, :class:`Tooltip`, and :class:`Url` encodings accept the following options: + +.. altair-object-table:: altair.StringFieldDefWithCondition The :class:`Detail` and :class:`Key` encodings accept the following options: @@ -282,19 +290,22 @@ The :class:`Latitude` and :class:`Longitude` encodings accept the following opti .. altair-object-table:: altair.LatLongFieldDef -The :class:`Latitude2`, :class:`Longitude2`, :class:`X2`, :class:`Y2`, :class:`XError`, :class:`YError`, +The :class:`Latitude2`, :class:`Longitude2`, :class:`Radius2`, :class:`Theta2`, :class:`X2`, :class:`Y2`, :class:`XError`, :class:`YError`, :class:`XError2`, and :class:`YError2` encodings accept the following options: .. altair-object-table:: altair.SecondaryFieldDef -The :class:`Href` encoding accepts the following options: - -.. altair-object-table:: altair.TextFieldDefWithCondition - The :class:`Order` encoding accepts the following options: .. altair-object-table:: altair.OrderFieldDef +The :class:`Radius` and :class:`Theta` encodings accept the following options: + +.. altair-object-table:: altair.PositionFieldDefBase + +The :class:`StrokeDash` encoding accepts the following options: + +.. altair-object-table:: altair.FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray .. _encoding-aggregates: From cec423ecd3dffbf1e122c7aac12c5f8bcf0df023 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 30 Oct 2021 21:52:27 -0700 Subject: [PATCH 15/46] Examples of Datum and mark_arc --- .../examples/line_chart_with_color_datum.py | 19 ++++++++++++ altair/examples/line_chart_with_datum.py | 31 +++++++++++++++++++ altair/examples/pacman_chart.py | 20 ++++++++++++ altair/examples/pie_chart.py | 18 +++++++++++ altair/examples/radial_chart.py | 27 ++++++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 altair/examples/line_chart_with_color_datum.py create mode 100644 altair/examples/line_chart_with_datum.py create mode 100644 altair/examples/pacman_chart.py create mode 100644 altair/examples/pie_chart.py create mode 100644 altair/examples/radial_chart.py diff --git a/altair/examples/line_chart_with_color_datum.py b/altair/examples/line_chart_with_color_datum.py new file mode 100644 index 000000000..c5f970cc5 --- /dev/null +++ b/altair/examples/line_chart_with_color_datum.py @@ -0,0 +1,19 @@ +""" +Line Chart with Color Datum +--------------------------- +An example of using ``ColorDatum`` and ``repeat`` to color a multi-series line chart. +This is adapted from a corresponding Vega-Lite Example: +`Repeat and Layer to Show Different Movie Measures `_. +""" +# category: line charts + +import altair as alt +from vega_datasets import data + +source = data.movies() + +alt.Chart(source).mark_line().encode( + x=alt.X("IMDB_Rating", bin=True), + y=alt.Y(alt.repeat('layer'), aggregate='mean', title="Mean of US and Worldwide Gross"), + color=alt.ColorDatum(alt.repeat('layer')) +).repeat(layer=["US_Gross", "Worldwide_Gross"]) \ No newline at end of file diff --git a/altair/examples/line_chart_with_datum.py b/altair/examples/line_chart_with_datum.py new file mode 100644 index 000000000..7a6704d94 --- /dev/null +++ b/altair/examples/line_chart_with_datum.py @@ -0,0 +1,31 @@ +""" +Line Chart with XDatum and YDatum +--------------------------------- +An example of using ``XDatum`` and ``YDatum`` to highlight certain values, including a ``DateTime`` value. +This is adapted from two corresponding Vega-Lite Examples: +`Highlight a Specific Value `_. +""" +# category: line charts + +import altair as alt +from vega_datasets import data + +source = data.stocks() +no_source = alt.InlineData([{}]) + +lines = alt.Chart(source).mark_line().encode( + x = alt.X("date"), + y = alt.Y("price"), + color = "symbol" +) + +xrule = alt.Chart(no_source).mark_rule(color='cyan', strokeWidth=2).encode( + x=alt.XDatum(alt.DateTime(year=2006, month = "November")) +) + +yrule = alt.Chart(no_source).mark_rule(strokeDash=[12,6], size=2).encode( + y = alt.YDatum(350) +) + + +lines + yrule + xrule \ No newline at end of file diff --git a/altair/examples/pacman_chart.py b/altair/examples/pacman_chart.py new file mode 100644 index 000000000..e2c41507c --- /dev/null +++ b/altair/examples/pacman_chart.py @@ -0,0 +1,20 @@ +""" +Pacman Chart +------------ +Chart made using ``mark_arc`` and constant values. +This could also be made using +``alt.Chart(source).mark_arc(color = "gold", theta = (5/8)*np.pi, theta2 = (19/8)*np.pi,radius=100)``. +""" +# category: other charts + +import numpy as np +import pandas as pd +import altair as alt + +source = alt.InlineData([{}]) + +alt.Chart(source).mark_arc(color = "gold").encode( + theta = alt.ThetaDatum((5/8)*np.pi, scale = None), + theta2 = alt.Theta2Datum((19/8)*np.pi), + radius = alt.RadiusDatum(100, scale = None), +) \ No newline at end of file diff --git a/altair/examples/pie_chart.py b/altair/examples/pie_chart.py new file mode 100644 index 000000000..30228fc67 --- /dev/null +++ b/altair/examples/pie_chart.py @@ -0,0 +1,18 @@ +""" +Pie Chart +--------- +This example shows how to make a Pie Chart using ``mark_arc``. +This is adapted from a corresponding Vega-Lite Example: +`Pie Chart `_. +""" +# category: other charts + +import pandas as pd +import altair as alt + +source = pd.DataFrame({'category': [1, 2, 3, 4, 5, 6], 'value': [4, 6, 10, 3, 7, 8]}) + +alt.Chart(source).mark_arc().encode( + theta=alt.Theta(field='value', type='quantitative'), + color=alt.Color(field='category', type='nominal') +) \ No newline at end of file diff --git a/altair/examples/radial_chart.py b/altair/examples/radial_chart.py new file mode 100644 index 000000000..d69f5427e --- /dev/null +++ b/altair/examples/radial_chart.py @@ -0,0 +1,27 @@ +""" +Radial Chart +------------ +This radial plot uses both angular and radial extent to convey multiple dimensions of data. +This is adapted from a corresponding Vega-Lite Example: +`Radial Plot `_. +""" +# category: other charts + +import pandas as pd +import altair as alt + +source = pd.DataFrame({"values":[12, 23, 47, 6, 52, 19]}) + +base = alt.Chart(source).encode( + theta = alt.Theta("values:Q", stack=True), + radius = alt.Radius("values", scale=alt.Scale(type="sqrt",zero=True,rangeMin = 20)), + color = "values:N" +) + +c1 = base.mark_arc(innerRadius=20,stroke="#fff") + +c2 = base.mark_text(radiusOffset=10).encode( + text = "values:Q" +) + +c1+c2 \ No newline at end of file From ab9ad94e6f2c9cd0e41b65d0d307a258ead1f45d Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sun, 31 Oct 2021 13:54:00 -0700 Subject: [PATCH 16/46] Remove old ad hoc code for TopLevelRepeatSpec --- tools/generate_schema_wrapper.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 9f22c3d6c..5cb86d130 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -606,29 +606,6 @@ def vegalite_main(skip_download=False): skip_download=skip_download, ) - # Put TopLevelRepeatSpec into a more consistent format with the rest of the schema - # TODO: Find a more elegant way of dealing with this. - if (library == "vega-lite") and (SCHEMA_VERSION[library][version] == "v4.17.0"): - with open(schemafile, encoding="utf8") as f: - rootschema = json.load(f) - - repeat_schema = rootschema["definitions"]["TopLevelRepeatSpec"]["anyOf"][0] - repeat_description = repeat_schema["properties"]["repeat"]["description"] - repeat_options = [ - {"items": {"type": "string"}, "type": "array"}, - {"$ref": "#/definitions/RepeatMapping"}, - {"$ref": "#/definitions/LayerRepeatMapping"}, - ] - repeat_schema["properties"]["repeat"] = { - "anyOf": repeat_options, - "description": repeat_description, - } - - rootschema["definitions"]["TopLevelRepeatSpec"] = repeat_schema - - with open(schemafile, "w", encoding="utf-8") as f: - json.dump(rootschema, f, ensure_ascii=False, indent=2) - # Generate __init__.py file outfile = join(schemapath, "__init__.py") print("Writing {}".format(outfile)) From 7b76665eaa63624bb2ce4dd60e5caccdcea09d51 Mon Sep 17 00:00:00 2001 From: mattijn Date: Sun, 31 Oct 2021 23:02:11 +0100 Subject: [PATCH 17/46] add linked vegalite issue --- tools/generate_schema_wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 9f22c3d6c..ff6672caf 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -607,7 +607,7 @@ def vegalite_main(skip_download=False): ) # Put TopLevelRepeatSpec into a more consistent format with the rest of the schema - # TODO: Find a more elegant way of dealing with this. + # TODO: Find a more elegant way of dealing with this. https://github.com/vega/vega-lite/issues/7775 if (library == "vega-lite") and (SCHEMA_VERSION[library][version] == "v4.17.0"): with open(schemafile, encoding="utf8") as f: rootschema = json.load(f) From 6fafc330a77f4337e0db737b7b58e7fbea80cd43 Mon Sep 17 00:00:00 2001 From: mattijn Date: Sun, 31 Oct 2021 23:03:14 +0100 Subject: [PATCH 18/46] remove None values in compiled vega so test pass --- altair/utils/tests/test_mimebundle.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/altair/utils/tests/test_mimebundle.py b/altair/utils/tests/test_mimebundle.py index 9c5a9458a..c893b7ce2 100644 --- a/altair/utils/tests/test_mimebundle.py +++ b/altair/utils/tests/test_mimebundle.py @@ -44,6 +44,7 @@ def vega_spec(): "$schema": "https://vega.github.io/schema/vega/v5.json", "axes": [ { + "aria": False, "domain": False, "grid": True, "gridScale": "x", @@ -61,7 +62,6 @@ def vega_spec(): "labelAlign": "right", "labelAngle": 270, "labelBaseline": "middle", - "labelOverlap": True, "orient": "bottom", "scale": "x", "title": "a", @@ -110,8 +110,12 @@ def vega_spec(): { "encode": { "update": { + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": '"a: " + (isValid(datum["a"]) ? datum["a"] : ""+datum["a"]) + "; b: " + (format(datum["b"], ""))' + }, "fill": {"value": "#4c78a8"}, - "width": {"band": True, "scale": "x"}, + "width": {"band": 1, "scale": "x"}, "x": {"field": "a", "scale": "x"}, "y": {"field": "b", "scale": "y"}, "y2": {"scale": "y", "value": 0}, @@ -154,6 +158,14 @@ def vega_spec(): def test_vegalite_to_vega_mimebundle(require_altair_saver, vegalite_spec, vega_spec): + # temporay fix for https://github.com/vega/vega-lite/issues/7776 + def delete_none(axes): + for axis in axes: + for key, value in list(axis.items()): + if value is None: + del axis[key] + return axes + bundle = spec_to_mimebundle( spec=vegalite_spec, format="vega", @@ -162,6 +174,10 @@ def test_vegalite_to_vega_mimebundle(require_altair_saver, vegalite_spec, vega_s vegalite_version=alt.VEGALITE_VERSION, vegaembed_version=alt.VEGAEMBED_VERSION, ) + + bundle["application/vnd.vega.v5+json"]["axes"] = delete_none( + bundle["application/vnd.vega.v5+json"]["axes"] + ) assert bundle == {"application/vnd.vega.v5+json": vega_spec} From dfcbc2f2d16be4ac294f779bbb945859405257f5 Mon Sep 17 00:00:00 2001 From: mattijn Date: Sun, 31 Oct 2021 23:03:42 +0100 Subject: [PATCH 19/46] add linked vl-issue --- tools/generate_schema_wrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index ff6672caf..632fb12d6 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -607,7 +607,8 @@ def vegalite_main(skip_download=False): ) # Put TopLevelRepeatSpec into a more consistent format with the rest of the schema - # TODO: Find a more elegant way of dealing with this. https://github.com/vega/vega-lite/issues/7775 + # TODO: Find a more elegant way of dealing with this. + # See for more info: https://github.com/vega/vega-lite/issues/7775 if (library == "vega-lite") and (SCHEMA_VERSION[library][version] == "v4.17.0"): with open(schemafile, encoding="utf8") as f: rootschema = json.load(f) From 9a365d41b7d7073679decdb0674ae248572615df Mon Sep 17 00:00:00 2001 From: mattijn Date: Sun, 31 Oct 2021 23:04:33 +0100 Subject: [PATCH 20/46] add more documentation on new arc mark --- doc/user_guide/compound_charts.rst | 20 ++++++++++++++++++-- doc/user_guide/encoding.rst | 3 +++ doc/user_guide/marks.rst | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/doc/user_guide/compound_charts.rst b/doc/user_guide/compound_charts.rst index 32cd39621..7c12ac760 100644 --- a/doc/user_guide/compound_charts.rst +++ b/doc/user_guide/compound_charts.rst @@ -270,8 +270,24 @@ The :meth:`Chart.repeat` method is the key here: it lets you specify a set of encodings for the row and/or column which can be referred to in the chart's encoding specification using ``alt.repeat('row')`` or ``alt.repeat('column')``. -Currently ``repeat`` can only be specified for rows and column (not, e.g., for -layers) and the target can only be encodings (not, e.g., data transforms) +Another option to use the ``repeat`` method is for layering. Here below the +columns ``US_Gross`` and ``Worldwide_Gross`` are layered on the ``y``-axis +using ``alt.repeat('layer')``: + +.. altair-plot:: + + import altair as alt + from vega_datasets import data + + source = data.movies() + + alt.Chart(source).mark_line().encode( + x=alt.X("IMDB_Rating", bin=True), + y=alt.Y(alt.repeat('layer'), aggregate='mean', title="Mean of US and Worldwide Gross"), + color=alt.ColorDatum(alt.repeat('layer')) + ).repeat(layer=["US_Gross", "Worldwide_Gross"]) + +Currently ``repeat`` can only be encodings (not, e.g., data transforms) but there is discussion within the Vega-Lite community about making this pattern more general in the future. diff --git a/doc/user_guide/encoding.rst b/doc/user_guide/encoding.rst index b761f153d..f02558643 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 +theta :class:`Theta` The start arc angle :ref:`gallery_radial_chart` +theta2 :class:`Theta2` The end arc angle (radian) :ref:`gallery_pacman_chart` ========== =================== ================================= =================================== Mark Property Channels: @@ -68,6 +70,7 @@ color :class:`Color` The color of the mark :ref:`gal fill :class:`Fill` The fill for the mark :ref:`gallery_ridgeline_plot` fillopacity :class:`FillOpacity` The opacity of the mark's fill N/A opacity :class:`Opacity` The opacity of the mark :ref:`gallery_horizon_graph` +radius :class:`Radius` The radius or the mark :ref:`gallery_radial_chart` shape :class:`Shape` The shape of the mark :ref:`gallery_us_incomebrackets_by_state_facet` size :class:`Size` The size of the mark :ref:`gallery_table_bubble_plot_github` stroke :class:`Stroke` The stroke of the mark N/A diff --git a/doc/user_guide/marks.rst b/doc/user_guide/marks.rst index b2a2cd4d7..4fbcf547c 100644 --- a/doc/user_guide/marks.rst +++ b/doc/user_guide/marks.rst @@ -15,6 +15,7 @@ Altair provides a number of basic mark properties: ========== ============================ =================================================== ==================================== Mark Name Method Description Example ========== ============================ =================================================== ==================================== +arc :meth:`~Chart.mark_arc` A pie chart. :ref:`gallery_pie_chart` area :meth:`~Chart.mark_area` A filled area plot. :ref:`gallery_simple_stacked_area_chart` bar :meth:`~Chart.mark_bar` A bar plot. :ref:`gallery_simple_bar_chart` circle :meth:`~Chart.mark_circle` A scatter plot with filled circles. :ref:`gallery_one_dot_per_zipcode` From 2ed281435bae388aa2c7d14d3a766e47af08be5b Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sun, 31 Oct 2021 16:58:56 -0700 Subject: [PATCH 21/46] Update generate_schema_wrapper.py --- tools/generate_schema_wrapper.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index a10b17228..632fb12d6 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -606,8 +606,6 @@ def vegalite_main(skip_download=False): skip_download=skip_download, ) -<<<<<<< HEAD -======= # Put TopLevelRepeatSpec into a more consistent format with the rest of the schema # TODO: Find a more elegant way of dealing with this. # See for more info: https://github.com/vega/vega-lite/issues/7775 @@ -632,7 +630,6 @@ def vegalite_main(skip_download=False): with open(schemafile, "w", encoding="utf-8") as f: json.dump(rootschema, f, ensure_ascii=False, indent=2) ->>>>>>> sample417 # Generate __init__.py file outfile = join(schemapath, "__init__.py") print("Writing {}".format(outfile)) From 08d4b3dbaecc95f65833b2fd6550554bc9cdb462 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sun, 31 Oct 2021 19:12:28 -0700 Subject: [PATCH 22/46] Update to allow the correct spec options in TopLevelRepeatSpec --- altair/vegalite/v4/schema/core.py | 2 +- altair/vegalite/v4/schema/vega-lite-schema.json | 12 +++++++++++- tools/generate_schema_wrapper.py | 12 ++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/altair/vegalite/v4/schema/core.py b/altair/vegalite/v4/schema/core.py index c1c897ab6..ee39e3322 100644 --- a/altair/vegalite/v4/schema/core.py +++ b/altair/vegalite/v4/schema/core.py @@ -18123,7 +18123,7 @@ class TopLevelRepeatSpec(TopLevelSpec): ``"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:`Spec` + spec : anyOf(:class:`Spec`, :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 diff --git a/altair/vegalite/v4/schema/vega-lite-schema.json b/altair/vegalite/v4/schema/vega-lite-schema.json index 8aaa1263e..96bcb0985 100644 --- a/altair/vegalite/v4/schema/vega-lite-schema.json +++ b/altair/vegalite/v4/schema/vega-lite-schema.json @@ -30089,7 +30089,17 @@ "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/Spec", + "anyOf": [ + { + "$ref": "#/definitions/Spec" + }, + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ], "description": "A specification of the view that gets repeated." }, "title": { diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 632fb12d6..550d7cad0 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -608,6 +608,7 @@ def vegalite_main(skip_download=False): # Put TopLevelRepeatSpec into a more consistent format with the rest of the schema # TODO: Find a more elegant way of dealing with this. + # This should really be two separate schemas: a layered version and a nonlayered version. # See for more info: https://github.com/vega/vega-lite/issues/7775 if (library == "vega-lite") and (SCHEMA_VERSION[library][version] == "v4.17.0"): with open(schemafile, encoding="utf8") as f: @@ -625,6 +626,17 @@ def vegalite_main(skip_download=False): "description": repeat_description, } + spec_description = repeat_schema["properties"]["spec"]["description"] + spec_options = [ + {'$ref': '#/definitions/Spec'}, + {'$ref': '#/definitions/LayerSpec'}, + {'$ref': '#/definitions/UnitSpec'}, + ] + repeat_schema["properties"]["spec"] = { + "anyOf": spec_options, + "description": spec_description, + } + rootschema["definitions"]["TopLevelRepeatSpec"] = repeat_schema with open(schemafile, "w", encoding="utf-8") as f: From 771e0362b56da2de40e88fa868b49f4635431b2b Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sun, 31 Oct 2021 19:42:31 -0700 Subject: [PATCH 23/46] Replace spaces with underscores in IMDB column names --- doc/user_guide/compound_charts.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/user_guide/compound_charts.rst b/doc/user_guide/compound_charts.rst index 7c12ac760..ecf711990 100644 --- a/doc/user_guide/compound_charts.rst +++ b/doc/user_guide/compound_charts.rst @@ -82,8 +82,8 @@ heat-map: source = data.movies.url heatmap = alt.Chart(source).mark_rect().encode( - alt.X('IMDB Rating:Q', bin=True), - alt.Y('Rotten Tomatoes Rating:Q', bin=True), + alt.X('IMDB_Rating:Q', bin=True), + alt.Y('Rotten_Tomatoes_Rating:Q', bin=True), alt.Color('count()', scale=alt.Scale(scheme='greenblue')) ) @@ -91,8 +91,8 @@ heat-map: color='black', size=5, ).encode( - x='IMDB Rating:Q', - y='Rotten Tomatoes Rating:Q', + x='IMDB_Rating:Q', + y='Rotten_Tomatoes_Rating:Q', ) heatmap + points From 1eef3de7788f9e77655af59fb0278643d2cc8e1b Mon Sep 17 00:00:00 2001 From: mattijn Date: Tue, 2 Nov 2021 07:48:05 +0100 Subject: [PATCH 24/46] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7085ac76b..1398294f9 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 From d594587fe2b7dcdf56ed47e519501c1acd0b3a0c Mon Sep 17 00:00:00 2001 From: mattijn Date: Tue, 2 Nov 2021 07:48:37 +0100 Subject: [PATCH 25/46] Update docbuild.yml --- .github/workflows/docbuild.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml index b6a586991..87fe56fa2 100644 --- a/.github/workflows/docbuild.yml +++ b/.github/workflows/docbuild.yml @@ -21,8 +21,9 @@ 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 }} - \ No newline at end of file + From b3e30dae8d2960fdb1ff0042a82c4a13a0465a98 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 2 Nov 2021 08:04:04 -0700 Subject: [PATCH 26/46] New method for dealing with TopLevelRepeatSpec Instead of patching the downloaded schema, we change the definition of RepeatChart. Currently the test_chart_from_dict test from altair/vegalite/v4/tests/test_api.py is failing on base.repeat(["c", "d"]). --- altair/vegalite/v4/api.py | 23 +- altair/vegalite/v4/schema/core.py | 138 +---- .../vegalite/v4/schema/vega-lite-schema.json | 497 ++++++++++++------ tools/generate_schema_wrapper.py | 36 -- 4 files changed, 353 insertions(+), 341 deletions(-) diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py index b41bb5299..c72fd32f2 100644 --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -2098,13 +2098,28 @@ def _get(spec, attr): raise ValueError("Concatenated charts cannot be layered.") -@utils.use_signature(core.TopLevelRepeatSpec) -class RepeatChart(TopLevelMixin, core.TopLevelRepeatSpec): +class RepeatChart(TopLevelMixin, core.VegaLiteSchema): """A chart repeated across rows and columns with small changes""" - def __init__(self, data=Undefined, spec=Undefined, repeat=Undefined, **kwargs): + _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} + + # 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__(data=data, spec=spec, repeat=repeat, **kwargs) + 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 diff --git a/altair/vegalite/v4/schema/core.py b/altair/vegalite/v4/schema/core.py index ee39e3322..acb88bed8 100644 --- a/altair/vegalite/v4/schema/core.py +++ b/altair/vegalite/v4/schema/core.py @@ -18110,144 +18110,12 @@ def __init__(self, vconcat=Undefined, autosize=Undefined, background=Undefined, class TopLevelRepeatSpec(TopLevelSpec): """TopLevelRepeatSpec schema wrapper - Mapping(required=[repeat, spec]) - - Attributes - ---------- - - repeat : anyOf(List(string), :class:`RepeatMapping`, :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:`Spec`, :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"``. - 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(:class:`Parameter`) - Dynamic variables 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:`Dictunknown` - 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/v4.json``. Setting the ``$schema`` - property allows automatic validation and autocomplete in editors that support JSON - schema. + anyOf(Mapping(required=[repeat, spec]), Mapping(required=[repeat, spec])) """ _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} - 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): - super(TopLevelRepeatSpec, 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 __init__(self, *args, **kwds): + super(TopLevelRepeatSpec, self).__init__(*args, **kwds) class TopLevelUnitSpec(TopLevelSpec): diff --git a/altair/vegalite/v4/schema/vega-lite-schema.json b/altair/vegalite/v4/schema/vega-lite-schema.json index 96bcb0985..dc73fa4aa 100644 --- a/altair/vegalite/v4/schema/vega-lite-schema.json +++ b/altair/vegalite/v4/schema/vega-lite-schema.json @@ -4314,7 +4314,8 @@ "type": "string" }, "options": { - "items": {}, + "items": { + }, "type": "array" }, "type": { @@ -7977,7 +7978,8 @@ "type": "object" }, "Dict": { - "additionalProperties": {}, + "additionalProperties": { + }, "type": "object" }, "Diverging": { @@ -11443,8 +11445,10 @@ ], "type": "object" }, - "GeoJsonFeature": {}, - "GeoJsonFeatureCollection": {}, + "GeoJsonFeature": { + }, + "GeoJsonFeatureCollection": { + }, "Gradient": { "anyOf": [ { @@ -12154,7 +12158,8 @@ "keyvals": { "anyOf": [ { - "items": {}, + "items": { + }, "type": "array" }, { @@ -12235,7 +12240,8 @@ "keyvals": { "anyOf": [ { - "items": {}, + "items": { + }, "type": "array" }, { @@ -29948,188 +29954,347 @@ "type": "object" }, "TopLevelRepeatSpec": { - "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/v4.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" + "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/v4.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" }, - { - "$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. - 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.\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" + "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. - 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.\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\"`." }, - { - "$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" + "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`" }, - { - "$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. - 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" + "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\"`" }, - { - "$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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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" + "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. - 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" }, - { - "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" + "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`" }, - { - "$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 that parameterize a visualization.", - "items": { - "$ref": "#/definitions/Parameter" - }, - "type": "array" - }, - "repeat": { - "anyOf": [ - { + "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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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 that parameterize a visualization.", "items": { - "type": "string" + "$ref": "#/definitions/Parameter" }, "type": "array" }, - { - "$ref": "#/definitions/RepeatMapping" + "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." }, - { - "$ref": "#/definitions/LayerRepeatMapping" + "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/Spec", + "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" ], - "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." + "type": "object" }, - "spacing": { - "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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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" }, - { - "$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/Spec" + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." }, - { - "$ref": "#/definitions/LayerSpec" + "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." }, - { - "$ref": "#/definitions/UnitSpec" - } - ], - "description": "A specification of the view that gets repeated." - }, - "title": { - "anyOf": [ - { - "$ref": "#/definitions/Text" + "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." }, - { - "$ref": "#/definitions/TitleParams" + "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 that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "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." } - ], - "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" } - }, - "required": [ - "repeat", - "spec" - ], - "type": "object" + ] }, "TopLevelFacetSpec": { "additionalProperties": false, diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 550d7cad0..5cb86d130 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -606,42 +606,6 @@ def vegalite_main(skip_download=False): skip_download=skip_download, ) - # Put TopLevelRepeatSpec into a more consistent format with the rest of the schema - # TODO: Find a more elegant way of dealing with this. - # This should really be two separate schemas: a layered version and a nonlayered version. - # See for more info: https://github.com/vega/vega-lite/issues/7775 - if (library == "vega-lite") and (SCHEMA_VERSION[library][version] == "v4.17.0"): - with open(schemafile, encoding="utf8") as f: - rootschema = json.load(f) - - repeat_schema = rootschema["definitions"]["TopLevelRepeatSpec"]["anyOf"][0] - repeat_description = repeat_schema["properties"]["repeat"]["description"] - repeat_options = [ - {"items": {"type": "string"}, "type": "array"}, - {"$ref": "#/definitions/RepeatMapping"}, - {"$ref": "#/definitions/LayerRepeatMapping"}, - ] - repeat_schema["properties"]["repeat"] = { - "anyOf": repeat_options, - "description": repeat_description, - } - - spec_description = repeat_schema["properties"]["spec"]["description"] - spec_options = [ - {'$ref': '#/definitions/Spec'}, - {'$ref': '#/definitions/LayerSpec'}, - {'$ref': '#/definitions/UnitSpec'}, - ] - repeat_schema["properties"]["spec"] = { - "anyOf": spec_options, - "description": spec_description, - } - - rootschema["definitions"]["TopLevelRepeatSpec"] = repeat_schema - - with open(schemafile, "w", encoding="utf-8") as f: - json.dump(rootschema, f, ensure_ascii=False, indent=2) - # Generate __init__.py file outfile = join(schemapath, "__init__.py") print("Writing {}".format(outfile)) From df162dea409a5d11ada4acbbab02f104cc1360e5 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 2 Nov 2021 13:26:35 -0700 Subject: [PATCH 27/46] Explicit schema for RepeatChart --- .gitignore | 2 -- altair/vegalite/v4/api.py | 67 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 80caf4e24..509ef3e3a 100644 --- a/.gitignore +++ b/.gitignore @@ -70,5 +70,3 @@ Untitled*.ipynb # VSCode .vscode -altair/utils/sample.py -sample_json.json diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py index c72fd32f2..33bb66ada 100644 --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -2097,11 +2097,72 @@ def _get(spec, attr): if isinstance(spec, VConcatChart) or _get(spec, "vconcat") is not Undefined: raise ValueError("Concatenated charts cannot be layered.") - -class RepeatChart(TopLevelMixin, core.VegaLiteSchema): +_repeat_chart_patched_schema = {'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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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 that parameterize a visualization.', + 'items': {'$ref': '#/definitions/Parameter'}, + 'type': 'array'}, + 'repeat': {'anyOf': [{'items': {'type': 'string'}, 'type': 'array'}, + {'$ref': '#/definitions/RepeatMapping'}, + {'$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/Spec'}, + {'$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'} + +@utils.use_signature(core.TopLevelRepeatSpec) +class RepeatChart(TopLevelMixin, core.TopLevelRepeatSpec): """A chart repeated across rows and columns with small changes""" - _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} + _schema = _repeat_chart_patched_schema # Because TopLevelRepeatSpec is defined as a union as of Vega-Lite schema 4.9, # we set the arguments explicitly here. From 444dbb85994510f26d339c2db144f975b01c27f8 Mon Sep 17 00:00:00 2001 From: mattijn Date: Tue, 2 Nov 2021 21:32:41 +0100 Subject: [PATCH 28/46] apply black format --- altair/vegalite/v4/api.py | 242 ++++++++++++++++++++++++++------------ 1 file changed, 168 insertions(+), 74 deletions(-) diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py index 33bb66ada..04adba3fb 100644 --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -2097,66 +2097,126 @@ def _get(spec, attr): if isinstance(spec, VConcatChart) or _get(spec, "vconcat") is not Undefined: raise ValueError("Concatenated charts cannot be layered.") -_repeat_chart_patched_schema = {'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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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 that parameterize a visualization.', - 'items': {'$ref': '#/definitions/Parameter'}, - 'type': 'array'}, - 'repeat': {'anyOf': [{'items': {'type': 'string'}, 'type': 'array'}, - {'$ref': '#/definitions/RepeatMapping'}, - {'$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/Spec'}, - {'$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'} + +_repeat_chart_patched_schema = { + "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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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 that parameterize a visualization.", + "items": {"$ref": "#/definitions/Parameter"}, + "type": "array", + }, + "repeat": { + "anyOf": [ + {"items": {"type": "string"}, "type": "array"}, + {"$ref": "#/definitions/RepeatMapping"}, + {"$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/Spec"}, + {"$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", +} + @utils.use_signature(core.TopLevelRepeatSpec) class RepeatChart(TopLevelMixin, core.TopLevelRepeatSpec): @@ -2165,22 +2225,56 @@ class RepeatChart(TopLevelMixin, core.TopLevelRepeatSpec): _schema = _repeat_chart_patched_schema # Because TopLevelRepeatSpec is defined as a union as of Vega-Lite schema 4.9, - # we set the arguments explicitly here. + # 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): + 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) + 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 From 33e0c90df4c58f8e169183e888442b62ae962529 Mon Sep 17 00:00:00 2001 From: mattijn Date: Tue, 2 Nov 2021 21:37:09 +0100 Subject: [PATCH 29/46] remove trailing white space --- tools/generate_schema_wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 5cb86d130..843f8aad5 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -170,7 +170,7 @@ def to_dict(self, validate=True, ignore=(), context=None): pass return super(DatumChannelMixin, copy).to_dict(validate=validate, ignore=ignore, - context=context) + context=context) """ From f348cd7bdcefa8636aa43fddfe9b007134e75d7a Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 2 Nov 2021 18:45:09 -0700 Subject: [PATCH 30/46] Add an optional default_class argument to _FromDict.from_dict --- altair/utils/schemapi.py | 15 +++- altair/utils/tests/test_mimebundle.py | 6 +- altair/vegalite/v3/tests/test_api.py | 29 ++---- altair/vegalite/v4/api.py | 122 -------------------------- altair/vegalite/v4/tests/test_api.py | 29 ++---- tools/schemapi/schemapi.py | 4 +- 6 files changed, 25 insertions(+), 180 deletions(-) diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index 5ffb26e0f..1a1758757 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -521,7 +521,9 @@ def _freeze(val): return hash(_freeze(schema)) - def from_dict(self, dct, cls=None, schema=None, rootschema=None): + def from_dict( + self, dct, cls=None, schema=None, rootschema=None, default_class=None + ): """Construct an object from a dict representation""" if (schema is None) == (cls is None): raise ValueError("Must provide either cls or schema, but not both.") @@ -541,7 +543,15 @@ def _passthrough(*args, **kwds): # Our class dict is constructed breadth-first from top to bottom, # so the first class that matches is the most general match. matches = self.class_dict[self.hash_schema(schema)] - cls = matches[0] if matches else _passthrough + if matches: + cls = matches[0] + elif default_class: + cls = default_class + else: + cls = _passthrough + default_class = None + else: + default_class = cls schema = _resolve_references(schema, rootschema) if "anyOf" in schema or "oneOf" in schema: @@ -557,6 +567,7 @@ def _passthrough(*args, **kwds): dct, schema=possible_schema, rootschema=rootschema, + default_class=default_class, ) if isinstance(dct, dict): diff --git a/altair/utils/tests/test_mimebundle.py b/altair/utils/tests/test_mimebundle.py index c893b7ce2..6ffa9660b 100644 --- a/altair/utils/tests/test_mimebundle.py +++ b/altair/utils/tests/test_mimebundle.py @@ -199,9 +199,5 @@ def test_spec_to_vega_mimebundle(vega_spec): def test_spec_to_json_mimebundle(): - bundle = spec_to_mimebundle( - spec=vegalite_spec, - mode="vega-lite", - format="json", - ) + bundle = spec_to_mimebundle(spec=vegalite_spec, mode="vega-lite", format="json",) assert bundle == {"application/json": vegalite_spec} diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py index 489d8cf67..466631e9d 100644 --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -38,15 +38,7 @@ def _make_chart_type(chart_type): "color": list("AAAABBBB"), } ) - base = ( - alt.Chart(data) - .mark_point() - .encode( - x="x", - y="y", - color="color", - ) - ) + 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) @@ -301,10 +293,7 @@ def test_facet_basic(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode( - x="x:Q", - y="y:Q", - ) + .encode(x="x:Q", y="y:Q",) .facet("category:N", columns=2) ) @@ -318,10 +307,7 @@ def test_facet_basic(): chart2 = ( alt.Chart("data.csv") .mark_point() - .encode( - x="x:Q", - y="y:Q", - ) + .encode(x="x:Q", y="y:Q",) .facet(row="category1:Q", column="category2:Q") ) @@ -746,10 +732,7 @@ def test_repeat(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode( - x=alt.X(alt.repeat(), type="quantitative"), - y="y:Q", - ) + .encode(x=alt.X(alt.repeat(), type="quantitative"), y="y:Q",) .repeat(["A", "B", "C", "D"], columns=2) ) @@ -876,9 +859,7 @@ def test_layer_errors(): def test_resolve(chart_type): chart = _make_chart_type(chart_type) chart = ( - chart.resolve_scale( - x="independent", - ) + chart.resolve_scale(x="independent",) .resolve_legend(color="independent") .resolve_axis(y="independent") ) diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py index 04adba3fb..70bf399da 100644 --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -2098,132 +2098,10 @@ def _get(spec, attr): raise ValueError("Concatenated charts cannot be layered.") -_repeat_chart_patched_schema = { - "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/v4.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. - 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.\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. - 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: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - 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 that parameterize a visualization.", - "items": {"$ref": "#/definitions/Parameter"}, - "type": "array", - }, - "repeat": { - "anyOf": [ - {"items": {"type": "string"}, "type": "array"}, - {"$ref": "#/definitions/RepeatMapping"}, - {"$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/Spec"}, - {"$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", -} - - @utils.use_signature(core.TopLevelRepeatSpec) class RepeatChart(TopLevelMixin, core.TopLevelRepeatSpec): """A chart repeated across rows and columns with small changes""" - _schema = _repeat_chart_patched_schema - # 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? diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py index 830da2f96..52753cc20 100644 --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -38,15 +38,7 @@ def _make_chart_type(chart_type): "color": list("AAAABBBB"), } ) - base = ( - alt.Chart(data) - .mark_point() - .encode( - x="x", - y="y", - color="color", - ) - ) + 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) @@ -303,10 +295,7 @@ def test_facet_basic(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode( - x="x:Q", - y="y:Q", - ) + .encode(x="x:Q", y="y:Q",) .facet("category:N", columns=2) ) @@ -320,10 +309,7 @@ def test_facet_basic(): chart2 = ( alt.Chart("data.csv") .mark_point() - .encode( - x="x:Q", - y="y:Q", - ) + .encode(x="x:Q", y="y:Q",) .facet(row="category1:Q", column="category2:Q") ) @@ -758,10 +744,7 @@ def test_repeat(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode( - x=alt.X(alt.repeat(), type="quantitative"), - y="y:Q", - ) + .encode(x=alt.X(alt.repeat(), type="quantitative"), y="y:Q",) .repeat(["A", "B", "C", "D"], columns=2) ) @@ -888,9 +871,7 @@ def test_layer_errors(): def test_resolve(chart_type): chart = _make_chart_type(chart_type) chart = ( - chart.resolve_scale( - x="independent", - ) + chart.resolve_scale(x="independent",) .resolve_legend(color="independent") .resolve_axis(y="independent") ) diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index d31d5f8eb..46270fe70 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -552,9 +552,7 @@ def _passthrough(*args, **kwds): continue else: return self.from_dict( - dct, - schema=possible_schema, - rootschema=rootschema, + dct, schema=possible_schema, rootschema=rootschema, ) if isinstance(dct, dict): From a23a8ff3cf0575bfead109403e5076e7333bade3 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Tue, 2 Nov 2021 19:13:42 -0700 Subject: [PATCH 31/46] Add an optional default_class argument to _FromDict.from_dict Same as the previous commit but in the correct file, not the auto-generated file. --- altair/utils/tests/test_mimebundle.py | 6 +++++- altair/vegalite/v3/schema/channels.py | 2 +- altair/vegalite/v3/tests/test_api.py | 29 ++++++++++++++++++++++----- altair/vegalite/v4/schema/channels.py | 2 +- altair/vegalite/v4/tests/test_api.py | 29 ++++++++++++++++++++++----- tools/schemapi/schemapi.py | 19 +++++++++++++++--- 6 files changed, 71 insertions(+), 16 deletions(-) diff --git a/altair/utils/tests/test_mimebundle.py b/altair/utils/tests/test_mimebundle.py index 6ffa9660b..c893b7ce2 100644 --- a/altair/utils/tests/test_mimebundle.py +++ b/altair/utils/tests/test_mimebundle.py @@ -199,5 +199,9 @@ def test_spec_to_vega_mimebundle(vega_spec): def test_spec_to_json_mimebundle(): - bundle = spec_to_mimebundle(spec=vegalite_spec, mode="vega-lite", format="json",) + bundle = spec_to_mimebundle( + spec=vegalite_spec, + mode="vega-lite", + format="json", + ) assert bundle == {"application/json": vegalite_spec} diff --git a/altair/vegalite/v3/schema/channels.py b/altair/vegalite/v3/schema/channels.py index 63fdf8a2f..26432fa41 100644 --- a/altair/vegalite/v3/schema/channels.py +++ b/altair/vegalite/v3/schema/channels.py @@ -88,7 +88,7 @@ def to_dict(self, validate=True, ignore=(), context=None): pass return super(DatumChannelMixin, copy).to_dict(validate=validate, ignore=ignore, - context=context) + context=context) class Color(FieldChannelMixin, core.StringFieldDefWithCondition): diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py index 466631e9d..489d8cf67 100644 --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -38,7 +38,15 @@ def _make_chart_type(chart_type): "color": list("AAAABBBB"), } ) - base = alt.Chart(data).mark_point().encode(x="x", y="y", color="color",) + 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) @@ -293,7 +301,10 @@ def test_facet_basic(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet("category:N", columns=2) ) @@ -307,7 +318,10 @@ def test_facet_basic(): chart2 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet(row="category1:Q", column="category2:Q") ) @@ -732,7 +746,10 @@ def test_repeat(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x=alt.X(alt.repeat(), type="quantitative"), y="y:Q",) + .encode( + x=alt.X(alt.repeat(), type="quantitative"), + y="y:Q", + ) .repeat(["A", "B", "C", "D"], columns=2) ) @@ -859,7 +876,9 @@ def test_layer_errors(): def test_resolve(chart_type): chart = _make_chart_type(chart_type) chart = ( - chart.resolve_scale(x="independent",) + chart.resolve_scale( + x="independent", + ) .resolve_legend(color="independent") .resolve_axis(y="independent") ) diff --git a/altair/vegalite/v4/schema/channels.py b/altair/vegalite/v4/schema/channels.py index 6d5abfc7c..1a6dda19d 100644 --- a/altair/vegalite/v4/schema/channels.py +++ b/altair/vegalite/v4/schema/channels.py @@ -88,7 +88,7 @@ def to_dict(self, validate=True, ignore=(), context=None): pass return super(DatumChannelMixin, copy).to_dict(validate=validate, ignore=ignore, - context=context) + context=context) class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py index 52753cc20..830da2f96 100644 --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -38,7 +38,15 @@ def _make_chart_type(chart_type): "color": list("AAAABBBB"), } ) - base = alt.Chart(data).mark_point().encode(x="x", y="y", color="color",) + 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) @@ -295,7 +303,10 @@ def test_facet_basic(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet("category:N", columns=2) ) @@ -309,7 +320,10 @@ def test_facet_basic(): chart2 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet(row="category1:Q", column="category2:Q") ) @@ -744,7 +758,10 @@ def test_repeat(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x=alt.X(alt.repeat(), type="quantitative"), y="y:Q",) + .encode( + x=alt.X(alt.repeat(), type="quantitative"), + y="y:Q", + ) .repeat(["A", "B", "C", "D"], columns=2) ) @@ -871,7 +888,9 @@ def test_layer_errors(): def test_resolve(chart_type): chart = _make_chart_type(chart_type) chart = ( - chart.resolve_scale(x="independent",) + chart.resolve_scale( + x="independent", + ) .resolve_legend(color="independent") .resolve_axis(y="independent") ) diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index 46270fe70..8a5265ae5 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -519,7 +519,9 @@ def _freeze(val): return hash(_freeze(schema)) - def from_dict(self, dct, cls=None, schema=None, rootschema=None): + def from_dict( + self, dct, cls=None, schema=None, rootschema=None, default_class=None + ): """Construct an object from a dict representation""" if (schema is None) == (cls is None): raise ValueError("Must provide either cls or schema, but not both.") @@ -539,7 +541,15 @@ def _passthrough(*args, **kwds): # Our class dict is constructed breadth-first from top to bottom, # so the first class that matches is the most general match. matches = self.class_dict[self.hash_schema(schema)] - cls = matches[0] if matches else _passthrough + if matches: + cls = matches[0] + elif default_class: + cls = default_class + else: + cls = _passthrough + default_class = None + else: + default_class = cls schema = _resolve_references(schema, rootschema) if "anyOf" in schema or "oneOf" in schema: @@ -552,7 +562,10 @@ def _passthrough(*args, **kwds): continue else: return self.from_dict( - dct, schema=possible_schema, rootschema=rootschema, + dct, + schema=possible_schema, + rootschema=rootschema, + default_class=default_class, ) if isinstance(dct, dict): From 689972297cc2ed60975fcb9b8c5509326791a17e Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Wed, 3 Nov 2021 15:17:22 -0700 Subject: [PATCH 32/46] Allow alt.datum syntax similar to alt.value --- altair/expr/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/altair/expr/core.py b/altair/expr/core.py index 9e530b698..264c5a195 100644 --- a/altair/expr/core.py +++ b/altair/expr/core.py @@ -15,6 +15,10 @@ def __getattr__(self, attr): def __getitem__(self, attr): return GetItemExpression("datum", attr) + def __call__(self, datum, **kwargs): + """Specify a datum for use in an encoding""" + return dict(datum=datum, **kwargs) + datum = DatumType() From 18d0c1238556f87983ef82ae4dc62e3b5e0d67e0 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Wed, 3 Nov 2021 16:17:06 -0700 Subject: [PATCH 33/46] Simplify _FromDict.from_dict logic --- altair/utils/schemapi.py | 15 +++++++-------- tools/schemapi/schemapi.py | 15 +++++++-------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index 1a1758757..bb2600403 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -467,6 +467,10 @@ def __dir__(self): return list(self._kwds.keys()) +def _passthrough(*args, **kwds): + return args[0] if args else kwds + + class _FromDict(object): """Class used to construct SchemaBase class hierarchies from a dict @@ -522,7 +526,7 @@ def _freeze(val): return hash(_freeze(schema)) def from_dict( - self, dct, cls=None, schema=None, rootschema=None, default_class=None + self, dct, cls=None, schema=None, rootschema=None, default_class=_passthrough ): """Construct an object from a dict representation""" if (schema is None) == (cls is None): @@ -532,9 +536,6 @@ def from_dict( rootschema = rootschema or cls._rootschema rootschema = rootschema or schema - def _passthrough(*args, **kwds): - return args[0] if args else kwds - if isinstance(dct, SchemaBase): return dct @@ -545,11 +546,9 @@ def _passthrough(*args, **kwds): matches = self.class_dict[self.hash_schema(schema)] if matches: cls = matches[0] - elif default_class: - cls = default_class else: - cls = _passthrough - default_class = None + cls = default_class + default_class = _passthrough else: default_class = cls schema = _resolve_references(schema, rootschema) diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index 8a5265ae5..a9e1f0f2e 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -465,6 +465,10 @@ def __dir__(self): return list(self._kwds.keys()) +def _passthrough(*args, **kwds): + return args[0] if args else kwds + + class _FromDict(object): """Class used to construct SchemaBase class hierarchies from a dict @@ -520,7 +524,7 @@ def _freeze(val): return hash(_freeze(schema)) def from_dict( - self, dct, cls=None, schema=None, rootschema=None, default_class=None + self, dct, cls=None, schema=None, rootschema=None, default_class=_passthrough ): """Construct an object from a dict representation""" if (schema is None) == (cls is None): @@ -530,9 +534,6 @@ def from_dict( rootschema = rootschema or cls._rootschema rootschema = rootschema or schema - def _passthrough(*args, **kwds): - return args[0] if args else kwds - if isinstance(dct, SchemaBase): return dct @@ -543,11 +544,9 @@ def _passthrough(*args, **kwds): matches = self.class_dict[self.hash_schema(schema)] if matches: cls = matches[0] - elif default_class: - cls = default_class else: - cls = _passthrough - default_class = None + cls = default_class + default_class = _passthrough else: default_class = cls schema = _resolve_references(schema, rootschema) From 7ebe289e5d382ae6fc57262504d39e56f912d2b4 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Wed, 3 Nov 2021 16:52:36 -0700 Subject: [PATCH 34/46] Update Change Log --- doc/releases/changes.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/releases/changes.rst b/doc/releases/changes.rst index 9db0a001c..0b757c3da 100644 --- a/doc/releases/changes.rst +++ b/doc/releases/changes.rst @@ -5,9 +5,16 @@ Altair Change Log Version 4.2.0 (unreleased) -------------------------- +- Update Vega-Lite from version 4.8.1 to version 4.17.0; + see `Vega-Lite Release Notes `_. Enhancements ~~~~~~~~~~~~ +- Pie charts are now supported through the use of ``mark_arc``. (Examples: + :ref:`gallery_pie_chart` and :ref:`gallery_radial_chart`.) +- Support for the ``datum`` encoding specifications from Vega-Lite; see + `Vega-Lite Datum Definition `_. + (Examples: :ref:`gallery_line_chart_with_datum` and :ref:`gallery_line_chart_with_color_datum`.) Bug Fixes ~~~~~~~~~ From 38727fd1e05aa067cfb7515f8e8bd3400639ddec Mon Sep 17 00:00:00 2001 From: mattijn Date: Thu, 4 Nov 2021 11:28:24 +0100 Subject: [PATCH 35/46] include cicurlar plots --- altair/sphinxext/altairgallery.py | 1 + 1 file changed, 1 insertion(+) diff --git a/altair/sphinxext/altairgallery.py b/altair/sphinxext/altairgallery.py index 28393306b..93090667e 100644 --- a/altair/sphinxext/altairgallery.py +++ b/altair/sphinxext/altairgallery.py @@ -265,6 +265,7 @@ def main(app): "Bar Charts": [], "Line Charts": [], "Area Charts": [], + "Circular Plots": [], "Scatter Plots": [], "Histograms": [], "Maps": [], From 33fb84901a9e8758a7f95ffc4ad43e1b4f57451c Mon Sep 17 00:00:00 2001 From: mattijn Date: Thu, 4 Nov 2021 11:28:53 +0100 Subject: [PATCH 36/46] plots in category circular plots --- altair/examples/donut_chart.py | 18 ++++++++++++++++++ altair/examples/pacman_chart.py | 15 +++++++-------- altair/examples/pie_chart.py | 10 +++++----- altair/examples/pie_chart_with_labels.py | 24 ++++++++++++++++++++++++ altair/examples/radial_chart.py | 18 ++++++++---------- 5 files changed, 62 insertions(+), 23 deletions(-) create mode 100644 altair/examples/donut_chart.py create mode 100644 altair/examples/pie_chart_with_labels.py diff --git a/altair/examples/donut_chart.py b/altair/examples/donut_chart.py new file mode 100644 index 000000000..32498a56d --- /dev/null +++ b/altair/examples/donut_chart.py @@ -0,0 +1,18 @@ +""" +Donut Chart +----------- +This example shows how to make a Donut Chart using ``mark_arc``. +This is adapted from a corresponding Vega-Lite Example: +`Donut Chart `_. +""" +# category: circular plots + +import pandas as pd +import altair as alt + +source = pd.DataFrame({"category": [1, 2, 3, 4, 5, 6], "value": [4, 6, 10, 3, 7, 8]}) + +alt.Chart(source).mark_arc(innerRadius=50).encode( + theta=alt.Theta(field="value", type="quantitative"), + color=alt.Color(field="category", type="nominal"), +) diff --git a/altair/examples/pacman_chart.py b/altair/examples/pacman_chart.py index e2c41507c..850c986b7 100644 --- a/altair/examples/pacman_chart.py +++ b/altair/examples/pacman_chart.py @@ -5,16 +5,15 @@ This could also be made using ``alt.Chart(source).mark_arc(color = "gold", theta = (5/8)*np.pi, theta2 = (19/8)*np.pi,radius=100)``. """ -# category: other charts +# category: circular plots import numpy as np -import pandas as pd import altair as alt -source = alt.InlineData([{}]) +no_source = alt.Data(values=[{}]) -alt.Chart(source).mark_arc(color = "gold").encode( - theta = alt.ThetaDatum((5/8)*np.pi, scale = None), - theta2 = alt.Theta2Datum((19/8)*np.pi), - radius = alt.RadiusDatum(100, scale = None), -) \ No newline at end of file +alt.Chart(no_source).mark_arc(color="gold").encode( + theta=alt.datum((5 / 8) * np.pi, scale=None), + theta2=alt.datum((19 / 8) * np.pi), + radius=alt.datum(100, scale=None), +) diff --git a/altair/examples/pie_chart.py b/altair/examples/pie_chart.py index 30228fc67..230127a93 100644 --- a/altair/examples/pie_chart.py +++ b/altair/examples/pie_chart.py @@ -5,14 +5,14 @@ This is adapted from a corresponding Vega-Lite Example: `Pie Chart `_. """ -# category: other charts +# category: circular plots import pandas as pd import altair as alt -source = pd.DataFrame({'category': [1, 2, 3, 4, 5, 6], 'value': [4, 6, 10, 3, 7, 8]}) +source = pd.DataFrame({"category": [1, 2, 3, 4, 5, 6], "value": [4, 6, 10, 3, 7, 8]}) alt.Chart(source).mark_arc().encode( - theta=alt.Theta(field='value', type='quantitative'), - color=alt.Color(field='category', type='nominal') -) \ No newline at end of file + theta=alt.Theta(field="value", type="quantitative"), + color=alt.Color(field="category", type="nominal"), +) diff --git a/altair/examples/pie_chart_with_labels.py b/altair/examples/pie_chart_with_labels.py new file mode 100644 index 000000000..15a3fb188 --- /dev/null +++ b/altair/examples/pie_chart_with_labels.py @@ -0,0 +1,24 @@ +""" +Pie Chart with Labels +--------------------- +This example shows how to layer text over arc marks (``mark_arc``) to label pie charts. +This is adapted from a corresponding Vega-Lite Example: +`Pie Chart with Labels `_. +""" +# category: circular plots + +import pandas as pd +import altair as alt + +source = pd.DataFrame( + {"category": ["a", "b", "c", "d", "e", "f"], "value": [4, 6, 10, 3, 7, 8]} +) + +base = alt.Chart(source).encode( + theta=alt.Theta("value:Q", stack=True), color=alt.Color("category:N", legend=None) +) + +pie = base.mark_arc(outerRadius=120) +text = base.mark_text(radius=140, size=20).encode(text="category:N") + +pie + text diff --git a/altair/examples/radial_chart.py b/altair/examples/radial_chart.py index d69f5427e..3240d092f 100644 --- a/altair/examples/radial_chart.py +++ b/altair/examples/radial_chart.py @@ -5,23 +5,21 @@ This is adapted from a corresponding Vega-Lite Example: `Radial Plot `_. """ -# category: other charts +# category: circular plots import pandas as pd import altair as alt -source = pd.DataFrame({"values":[12, 23, 47, 6, 52, 19]}) +source = pd.DataFrame({"values": [12, 23, 47, 6, 52, 19]}) base = alt.Chart(source).encode( - theta = alt.Theta("values:Q", stack=True), - radius = alt.Radius("values", scale=alt.Scale(type="sqrt",zero=True,rangeMin = 20)), - color = "values:N" + theta=alt.Theta("values:Q", stack=True), + radius=alt.Radius("values", scale=alt.Scale(type="sqrt", zero=True, rangeMin=20)), + color="values:N", ) -c1 = base.mark_arc(innerRadius=20,stroke="#fff") +c1 = base.mark_arc(innerRadius=20, stroke="#fff") -c2 = base.mark_text(radiusOffset=10).encode( - text = "values:Q" -) +c2 = base.mark_text(radiusOffset=10).encode(text="values:Q") -c1+c2 \ No newline at end of file +c1 + c2 From 73de4cde2d180b3656a7cf79d606bb4cde242a82 Mon Sep 17 00:00:00 2001 From: mattijn Date: Thu, 4 Nov 2021 11:29:23 +0100 Subject: [PATCH 37/46] change examples to use alt.datum() --- .../examples/line_chart_with_color_datum.py | 16 +++++++----- altair/examples/line_chart_with_datum.py | 26 ++++++++++--------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/altair/examples/line_chart_with_color_datum.py b/altair/examples/line_chart_with_color_datum.py index c5f970cc5..912b32aa8 100644 --- a/altair/examples/line_chart_with_color_datum.py +++ b/altair/examples/line_chart_with_color_datum.py @@ -1,8 +1,8 @@ """ -Line Chart with Color Datum ---------------------------- -An example of using ``ColorDatum`` and ``repeat`` to color a multi-series line chart. -This is adapted from a corresponding Vega-Lite Example: +Line Chart with datum for color +------------------------------- +An example of using ``datum`` and ``repeat`` to color a multi-series line chart. +This is adapted from this corresponding Vega-Lite Example: `Repeat and Layer to Show Different Movie Measures `_. """ # category: line charts @@ -14,6 +14,8 @@ alt.Chart(source).mark_line().encode( x=alt.X("IMDB_Rating", bin=True), - y=alt.Y(alt.repeat('layer'), aggregate='mean', title="Mean of US and Worldwide Gross"), - color=alt.ColorDatum(alt.repeat('layer')) -).repeat(layer=["US_Gross", "Worldwide_Gross"]) \ No newline at end of file + y=alt.Y( + alt.repeat("layer"), aggregate="mean", title="Mean of US and Worldwide Gross" + ), + color=alt.datum(alt.repeat("layer")), +).repeat(layer=["US_Gross", "Worldwide_Gross"]) diff --git a/altair/examples/line_chart_with_datum.py b/altair/examples/line_chart_with_datum.py index 7a6704d94..e568b3e65 100644 --- a/altair/examples/line_chart_with_datum.py +++ b/altair/examples/line_chart_with_datum.py @@ -1,7 +1,7 @@ """ -Line Chart with XDatum and YDatum +Line Chart with datum --------------------------------- -An example of using ``XDatum`` and ``YDatum`` to highlight certain values, including a ``DateTime`` value. +An example of using ``datum`` to highlight certain values, including a ``DateTime`` value. This is adapted from two corresponding Vega-Lite Examples: `Highlight a Specific Value `_. """ @@ -11,21 +11,23 @@ from vega_datasets import data source = data.stocks() -no_source = alt.InlineData([{}]) +no_source = alt.Data(values=[{}]) -lines = alt.Chart(source).mark_line().encode( - x = alt.X("date"), - y = alt.Y("price"), - color = "symbol" +lines = ( + alt.Chart(source) + .mark_line() + .encode(x=alt.X("date"), y=alt.Y("price"), color="symbol") ) -xrule = alt.Chart(no_source).mark_rule(color='cyan', strokeWidth=2).encode( - x=alt.XDatum(alt.DateTime(year=2006, month = "November")) +xrule = ( + alt.Chart(no_source) + .mark_rule(color="cyan", strokeWidth=2) + .encode(x=alt.datum(alt.DateTime(year=2006, month="November"))) ) -yrule = alt.Chart(no_source).mark_rule(strokeDash=[12,6], size=2).encode( - y = alt.YDatum(350) +yrule = ( + alt.Chart(no_source).mark_rule(strokeDash=[12, 6], size=2).encode(y=alt.datum(350)) ) -lines + yrule + xrule \ No newline at end of file +lines + yrule + xrule From b4f0f91a9e68990346c444fe01caad3161be09b4 Mon Sep 17 00:00:00 2001 From: mattijn Date: Thu, 4 Nov 2021 11:29:51 +0100 Subject: [PATCH 38/46] add example using angle encoding --- altair/examples/wind_vector_map.py | 24 ++++++++++++++++++++++++ doc/user_guide/encoding.rst | 1 + 2 files changed, 25 insertions(+) create mode 100644 altair/examples/wind_vector_map.py diff --git a/altair/examples/wind_vector_map.py b/altair/examples/wind_vector_map.py new file mode 100644 index 000000000..f16ad285a --- /dev/null +++ b/altair/examples/wind_vector_map.py @@ -0,0 +1,24 @@ +""" +Wind Vector Map +--------------- +An example showing a vector array map showing wind speed and direction using ``wedge`` +as shape for ``mark_point`` and ``angle`` encoding for the wind direction. +This is adapted from this corresponding Vega-Lite Example: +`Wind Vector Map `_. +""" +# category: scatter plots + +import altair as alt +from vega_datasets import data + +source = data.windvectors() + +alt.Chart(source).mark_point(shape="wedge", filled=True).encode( + latitude="latitude", + longitude="longitude", + color=alt.Color( + "dir", scale=alt.Scale(domain=[0, 360], scheme="rainbow"), legend=None + ), + angle=alt.Angle("dir", scale=alt.Scale(domain=[0, 360], range=[180, 540])), + size=alt.Size("speed", scale=alt.Scale(rangeMax=500)), +).project("equalEarth") diff --git a/doc/user_guide/encoding.rst b/doc/user_guide/encoding.rst index f02558643..d3a94c09a 100644 --- a/doc/user_guide/encoding.rst +++ b/doc/user_guide/encoding.rst @@ -66,6 +66,7 @@ Mark Property Channels: ============= ====================== ============================== ========================================= Channel Altair Class Description Example ============= ====================== ============================== ========================================= +angle :class:`Angle` The angle of the mark :ref:`gallery_wind_vector_map` color :class:`Color` The color of the mark :ref:`gallery_simple_heatmap` fill :class:`Fill` The fill for the mark :ref:`gallery_ridgeline_plot` fillopacity :class:`FillOpacity` The opacity of the mark's fill N/A From aab8017f4dac4d7f5688db8e17c30c312f3b4e4e Mon Sep 17 00:00:00 2001 From: mattijn Date: Thu, 4 Nov 2021 11:30:25 +0100 Subject: [PATCH 39/46] add example compact trellis grid bar chart --- altair/examples/bar_chart_trellis_compact.py | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 altair/examples/bar_chart_trellis_compact.py diff --git a/altair/examples/bar_chart_trellis_compact.py b/altair/examples/bar_chart_trellis_compact.py new file mode 100644 index 000000000..6fb011476 --- /dev/null +++ b/altair/examples/bar_chart_trellis_compact.py @@ -0,0 +1,50 @@ +""" +Compact Trellis Grid of Bar Charts +================================== +This example shows a simple grid of bar charts to compare performance data.. +""" +# category: bar charts +import altair as alt +import pandas as pd + +source = pd.DataFrame( + [ + {"a": "a1", "b": "b1", "c": "x", "p": "0.14"}, + {"a": "a1", "b": "b1", "c": "y", "p": "0.60"}, + {"a": "a1", "b": "b1", "c": "z", "p": "0.03"}, + {"a": "a1", "b": "b2", "c": "x", "p": "0.80"}, + {"a": "a1", "b": "b2", "c": "y", "p": "0.38"}, + {"a": "a1", "b": "b2", "c": "z", "p": "0.55"}, + {"a": "a1", "b": "b3", "c": "x", "p": "0.11"}, + {"a": "a1", "b": "b3", "c": "y", "p": "0.58"}, + {"a": "a1", "b": "b3", "c": "z", "p": "0.79"}, + {"a": "a2", "b": "b1", "c": "x", "p": "0.83"}, + {"a": "a2", "b": "b1", "c": "y", "p": "0.87"}, + {"a": "a2", "b": "b1", "c": "z", "p": "0.67"}, + {"a": "a2", "b": "b2", "c": "x", "p": "0.97"}, + {"a": "a2", "b": "b2", "c": "y", "p": "0.84"}, + {"a": "a2", "b": "b2", "c": "z", "p": "0.90"}, + {"a": "a2", "b": "b3", "c": "x", "p": "0.74"}, + {"a": "a2", "b": "b3", "c": "y", "p": "0.64"}, + {"a": "a2", "b": "b3", "c": "z", "p": "0.19"}, + {"a": "a3", "b": "b1", "c": "x", "p": "0.57"}, + {"a": "a3", "b": "b1", "c": "y", "p": "0.35"}, + {"a": "a3", "b": "b1", "c": "z", "p": "0.49"}, + {"a": "a3", "b": "b2", "c": "x", "p": "0.91"}, + {"a": "a3", "b": "b2", "c": "y", "p": "0.38"}, + {"a": "a3", "b": "b2", "c": "z", "p": "0.91"}, + {"a": "a3", "b": "b3", "c": "x", "p": "0.99"}, + {"a": "a3", "b": "b3", "c": "y", "p": "0.80"}, + {"a": "a3", "b": "b3", "c": "z", "p": "0.37"}, + ] +) + +alt.Chart(source, width=60, height=alt.Step(8)).mark_bar().encode( + y=alt.Y("c:N", axis=None), + x=alt.X("p:Q", title=None, axis=alt.Axis(format="%")), + color=alt.Color( + "c:N", title="settings", legend=alt.Legend(orient="bottom", titleOrient="left") + ), + row=alt.Row("a:N", title="Factor A", header=alt.Header(labelAngle=0)), + column=alt.Column("b:N", title="Factor B"), +) From 225c9f3c9514bbe672ea64d2b54608b50cee7deb Mon Sep 17 00:00:00 2001 From: mattijn Date: Thu, 4 Nov 2021 11:31:07 +0100 Subject: [PATCH 40/46] extend change log to include angle encoding --- doc/releases/changes.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/releases/changes.rst b/doc/releases/changes.rst index 0b757c3da..4d0eed36a 100644 --- a/doc/releases/changes.rst +++ b/doc/releases/changes.rst @@ -10,11 +10,12 @@ Version 4.2.0 (unreleased) Enhancements ~~~~~~~~~~~~ -- Pie charts are now supported through the use of ``mark_arc``. (Examples: +- Pie charts are now supported through the use of ``mark_arc``. (Examples: eg. :ref:`gallery_pie_chart` and :ref:`gallery_radial_chart`.) - Support for the ``datum`` encoding specifications from Vega-Lite; see `Vega-Lite Datum Definition `_. (Examples: :ref:`gallery_line_chart_with_datum` and :ref:`gallery_line_chart_with_color_datum`.) +- ``angle`` encoding can now be used to control point styles (Example: :ref:`wind_vector_map`) Bug Fixes ~~~~~~~~~ From 158d2ffee43d257bcfa69db279f06a704ef22445 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 4 Nov 2021 05:26:18 -0700 Subject: [PATCH 41/46] Fix typo in link --- doc/releases/changes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/releases/changes.rst b/doc/releases/changes.rst index 4d0eed36a..106738c5f 100644 --- a/doc/releases/changes.rst +++ b/doc/releases/changes.rst @@ -15,7 +15,7 @@ Enhancements - Support for the ``datum`` encoding specifications from Vega-Lite; see `Vega-Lite Datum Definition `_. (Examples: :ref:`gallery_line_chart_with_datum` and :ref:`gallery_line_chart_with_color_datum`.) -- ``angle`` encoding can now be used to control point styles (Example: :ref:`wind_vector_map`) +- ``angle`` encoding can now be used to control point styles (Example: :ref:`gallery_wind_vector_map`) Bug Fixes ~~~~~~~~~ From 98293e95b18bfdf28aa0faaf0176f71bd7f60abc Mon Sep 17 00:00:00 2001 From: mattijn Date: Thu, 4 Nov 2021 22:38:52 +0100 Subject: [PATCH 42/46] simplify from_dict --- tools/schemapi/schemapi.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index a9e1f0f2e..3ca87b991 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -546,9 +546,6 @@ def from_dict( cls = matches[0] else: cls = default_class - default_class = _passthrough - else: - default_class = cls schema = _resolve_references(schema, rootschema) if "anyOf" in schema or "oneOf" in schema: @@ -564,7 +561,7 @@ def from_dict( dct, schema=possible_schema, rootschema=rootschema, - default_class=default_class, + default_class=cls, ) if isinstance(dct, dict): From 25baa86dbd921a30761bcc5300b0c06397eae99d Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Thu, 4 Nov 2021 15:39:39 -0700 Subject: [PATCH 43/46] Update schemapi.py --- altair/utils/schemapi.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index bb2600403..2dfdc8ee1 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -548,9 +548,6 @@ def from_dict( cls = matches[0] else: cls = default_class - default_class = _passthrough - else: - default_class = cls schema = _resolve_references(schema, rootschema) if "anyOf" in schema or "oneOf" in schema: @@ -566,7 +563,7 @@ def from_dict( dct, schema=possible_schema, rootschema=rootschema, - default_class=default_class, + default_class=cls, ) if isinstance(dct, dict): From c10c57e27a58db60923ec1cc2f85003e423d1883 Mon Sep 17 00:00:00 2001 From: mattijn Date: Fri, 5 Nov 2021 09:09:24 +0100 Subject: [PATCH 44/46] serialize values InlineDataset within InlineData --- altair/vegalite/v4/api.py | 5 ++++- altair/vegalite/v4/tests/test_api.py | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py index 70bf399da..b4bca6a28 100644 --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -47,7 +47,10 @@ def _consolidate_data(data, context): if isinstance(data, core.InlineData): if data.name is Undefined and data.values is not Undefined: - values = data.values + if isinstance(data.values, core.InlineDataset): + values = data.values.to_dict() + else: + values = data.values kwds = {"format": data.format} elif isinstance(data, dict): diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py index 830da2f96..450553f3c 100644 --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -947,3 +947,12 @@ def test_graticule(): 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 From 93e846750c1f3542b9bf21a07830d5a88820700b Mon Sep 17 00:00:00 2001 From: mattijn Date: Fri, 5 Nov 2021 15:09:05 +0100 Subject: [PATCH 45/46] improve robustness --- altair/vegalite/v4/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/altair/vegalite/v4/api.py b/altair/vegalite/v4/api.py index b4bca6a28..572316412 100644 --- a/altair/vegalite/v4/api.py +++ b/altair/vegalite/v4/api.py @@ -48,7 +48,7 @@ def _consolidate_data(data, context): if isinstance(data, core.InlineData): if data.name is Undefined and data.values is not Undefined: if isinstance(data.values, core.InlineDataset): - values = data.values.to_dict() + values = data.to_dict()["values"] else: values = data.values kwds = {"format": data.format} From 464b203bf28dbfb74b1bc67bd41fe70b879b52be Mon Sep 17 00:00:00 2001 From: mattijn Date: Sat, 6 Nov 2021 15:24:22 +0100 Subject: [PATCH 46/46] remove link to master of altair_viewer --- .github/workflows/build.yml | 1 - .github/workflows/docbuild.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1398294f9..7085ac76b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,6 @@ 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 87fe56fa2..09a9f4d66 100644 --- a/.github/workflows/docbuild.yml +++ b/.github/workflows/docbuild.yml @@ -21,7 +21,6 @@ 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 }}