From 20c838c7776da7718e79f120262137c81013fd36 Mon Sep 17 00:00:00 2001 From: Kanit Wongsuphasawat Date: Fri, 4 Jan 2019 09:50:39 +0700 Subject: [PATCH] Introduce `ExtendedUnitSpec = NormalizedUnitSpec | CompositeUnitSpec` and separate NormalizedUnitSpec from CompositeUnitSpec --- build/vega-lite-schema.json | 5692 ++++++++++++++++++++++----- package.json | 2 +- scripts/rename-schema.sh | 6 +- src/channel.ts | 25 - src/compile/mark/mark.ts | 4 - src/compositemark/boxplot.ts | 14 +- src/compositemark/common.ts | 25 +- src/compositemark/errorband.ts | 7 +- src/compositemark/errorbar.ts | 68 +- src/compositemark/index.ts | 24 +- src/encoding.ts | 22 - src/mark.ts | 2 +- src/normalize.ts | 18 +- src/spec/index.ts | 21 +- src/spec/layer.ts | 4 +- src/spec/unit.ts | 48 +- src/validate.ts | 7 +- test/compositemark/errorbar.test.ts | 28 +- 18 files changed, 4816 insertions(+), 1201 deletions(-) diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index 73a3bfab2e2..4cb856a1122 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -85,22 +85,6 @@ ], "type": "string" }, - "AnyMark": { - "anyOf": [ - { - "$ref": "#/definitions/CompositeMark" - }, - { - "$ref": "#/definitions/CompositeMarkDef" - }, - { - "$ref": "#/definitions/Mark" - }, - { - "$ref": "#/definitions/MarkDef" - } - ] - }, "AreaConfig": { "additionalProperties": false, "properties": { @@ -1676,6 +1660,12 @@ ], "type": "object" }, + "BoxPlotUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(BoxPlotEncoding),(BoxPlot|BoxPlotDef)>" + }, + "BoxPlotUnitSpec>": { + "$ref": "#/definitions/GenericUnitSpec<(BoxPlotEncoding&FacetMapping),(BoxPlot|BoxPlotDef)>" + }, "BrushConfig": { "additionalProperties": false, "properties": { @@ -1737,39 +1727,41 @@ "ColorFieldDefWithCondition": { "$ref": "#/definitions/FieldDefWithCondition" }, + "ColorFieldDefWithCondition": { + "$ref": "#/definitions/FieldDefWithCondition,(string|null)>" + }, "ColorValueDefWithCondition": { "$ref": "#/definitions/ValueDefWithCondition" }, - "CompositeMark": { + "ColorValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition,(string|null)>" + }, + "CompositeMarkUnitSpec": { "anyOf": [ { - "$ref": "#/definitions/BoxPlot" + "$ref": "#/definitions/ErrorBarUnitSpec" }, { - "$ref": "#/definitions/ErrorBar" + "$ref": "#/definitions/ErrorBandUnitSpec" }, { - "$ref": "#/definitions/ErrorBand" + "$ref": "#/definitions/BoxPlotUnitSpec" } ] }, - "CompositeMarkDef": { + "CompositeMarkUnitSpec>": { "anyOf": [ { - "$ref": "#/definitions/BoxPlotDef" + "$ref": "#/definitions/ErrorBarUnitSpec>" }, { - "$ref": "#/definitions/ErrorBarDef" + "$ref": "#/definitions/ErrorBandUnitSpec>" }, { - "$ref": "#/definitions/ErrorBandDef" + "$ref": "#/definitions/BoxPlotUnitSpec>" } ] }, - "CompositeUnitSpec": { - "$ref": "#/definitions/CompositeUnitSpecAlias", - "description": "Unit spec that can have a composite mark." - }, "ConditionOnlyDef>": { "additionalProperties": false, "description": "A Condition only definition.\n{\n condition: {field: ...} | {value: ...}\n}", @@ -1851,6 +1843,87 @@ ], "type": "object" }, + "ConditionOnlyDef>": { + "additionalProperties": false, + "description": "A Condition only definition.\n{\n condition: {field: ...} | {value: ...}\n}", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + }, + "required": [ + "condition" + ], + "type": "object" + }, + "ConditionOnlyDef>": { + "additionalProperties": false, + "description": "A Condition only definition.\n{\n condition: {field: ...} | {value: ...}\n}", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + }, + "required": [ + "condition" + ], + "type": "object" + }, + "ConditionOnlyDef>": { + "additionalProperties": false, + "description": "A Condition only definition.\n{\n condition: {field: ...} | {value: ...}\n}", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + }, + "required": [ + "condition" + ], + "type": "object" + }, "ConditionOnlyDef": { "additionalProperties": false, "description": "A Condition only definition.\n{\n condition: {field: ...} | {value: ...}\n}", @@ -1878,6 +1951,33 @@ ], "type": "object" }, + "ConditionOnlyDef>": { + "additionalProperties": false, + "description": "A Condition only definition.\n{\n condition: {field: ...} | {value: ...}\n}", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalTextFieldDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + }, + "required": [ + "condition" + ], + "type": "object" + }, "ConditionalMarkPropFieldDef<\"nominal\">": { "anyOf": [ { @@ -1908,6 +2008,36 @@ } ] }, + "ConditionalMarkPropFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalMarkPropFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalMarkPropFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, "ConditionalTextFieldDef": { "anyOf": [ { @@ -1918,6 +2048,16 @@ } ] }, + "ConditionalTextFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, "ConditionalValueDef": { "anyOf": [ { @@ -2238,7 +2378,7 @@ ], "type": "object" }, - "ConditionalPredicate": { + "ConditionalPredicate>": { "additionalProperties": false, "properties": { "aggregate": { @@ -2266,19 +2406,34 @@ "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" }, "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "legend": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/Legend" }, { - "$ref": "#/definitions/RepeatRef" + "type": "null" } ], - "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + "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." }, - "format": { - "description": "The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text field. If not defined, this will be determined automatically.", - "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." + }, + "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\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`." }, "test": { "$ref": "#/definitions/LogicalOperand" @@ -2295,8 +2450,11 @@ ] }, "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__Note:__ 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`)" + "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__Note:__ 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`)", + "enum": [ + "nominal" + ], + "type": "string" } }, "required": [ @@ -2305,38 +2463,329 @@ ], "type": "object" }, - "ConditionalPredicate": { + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "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." + }, + "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." + }, + "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\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`." + }, "test": { "$ref": "#/definitions/LogicalOperand" }, - "value": { - "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ - "number", "string", - "boolean", "null" ] + }, + "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__Note:__ 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`)" } }, "required": [ "test", - "value" + "type" ], "type": "object" }, - "ConditionalPredicate": { + "ConditionalPredicate>": { "additionalProperties": false, "properties": { - "test": { - "$ref": "#/definitions/LogicalOperand" + "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)" }, - "value": { - "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", - "type": [ - "string", + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "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." + }, + "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." + }, + "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\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`." + }, + "test": { + "$ref": "#/definitions/LogicalOperand" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" + } + }, + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "field": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "format": { + "description": "The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text field. If not defined, this will be determined automatically.", + "type": "string" + }, + "test": { + "$ref": "#/definitions/LogicalOperand" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" + } + }, + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "format": { + "description": "The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text field. If not defined, this will be determined automatically.", + "type": "string" + }, + "test": { + "$ref": "#/definitions/LogicalOperand" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" + } + }, + "required": [ + "test", + "type" + ], + "type": "object" + }, + "ConditionalPredicate": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/LogicalOperand" + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "type": [ + "number", + "string", + "boolean", + "null" + ] + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/LogicalOperand" + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "type": [ + "string", "null" ] } @@ -2675,7 +3124,7 @@ ], "type": "object" }, - "ConditionalSelection": { + "ConditionalSelection>": { "additionalProperties": false, "properties": { "aggregate": { @@ -2703,24 +3152,39 @@ "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" }, "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "legend": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/Legend" }, { - "$ref": "#/definitions/RepeatRef" + "type": "null" } ], - "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + "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." }, - "format": { - "description": "The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text field. If not defined, this will be determined automatically.", - "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." }, "selection": { "$ref": "#/definitions/SelectionOperand", "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + }, "timeUnit": { "$ref": "#/definitions/TimeUnit", "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)" @@ -2733,8 +3197,11 @@ ] }, "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__Note:__ 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`)" + "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__Note:__ 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`)", + "enum": [ + "nominal" + ], + "type": "string" } }, "required": [ @@ -2743,91 +3210,302 @@ ], "type": "object" }, - "ConditionalSelection": { + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "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." + }, + "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." + }, "selection": { "$ref": "#/definitions/SelectionOperand", "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\" for color, values between `0` to `1` for opacity).", + "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ - "number", "string", - "boolean", "null" ] + }, + "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__Note:__ 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`)" } }, "required": [ "selection", - "value" + "type" ], "type": "object" }, - "ConditionalSelection": { + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "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." + }, + "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." + }, "selection": { "$ref": "#/definitions/SelectionOperand", "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\" for color, values between `0` to `1` for opacity).", + "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ "string", "null" ] + }, + "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__Note:__ 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`)" } }, "required": [ "selection", - "value" + "type" ], "type": "object" }, - "ConditionalSelection": { + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "field": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "format": { + "description": "The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text field. If not defined, this will be determined automatically.", + "type": "string" + }, "selection": { "$ref": "#/definitions/SelectionOperand", "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\" for color, values between `0` to `1` for opacity).", + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ "string", - "number", - "boolean" + "null" ] + }, + "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__Note:__ 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`)" } }, "required": [ "selection", - "value" + "type" ], "type": "object" }, - "ConditionalSelection": { + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "format": { + "description": "The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text field. If not defined, this will be determined automatically.", + "type": "string" + }, "selection": { "$ref": "#/definitions/SelectionOperand", "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\" for color, values between `0` to `1` for opacity).", - "type": "number" + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" } }, "required": [ "selection", - "value" + "type" ], "type": "object" }, - "ConditionalSelection": { + "ConditionalSelection": { "additionalProperties": false, "properties": { "selection": { @@ -2836,8 +3514,92 @@ }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", - "type": "string" - } + "type": [ + "number", + "string", + "boolean", + "null" + ] + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionOperand", + "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\" for color, values between `0` to `1` for opacity).", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionOperand", + "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\" for color, values between `0` to `1` for opacity).", + "type": [ + "string", + "number", + "boolean" + ] + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionOperand", + "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\" for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionOperand", + "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\" for color, values between `0` to `1` for opacity).", + "type": "string" + } }, "required": [ "selection", @@ -3480,28 +4242,6 @@ ], "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." }, - "xError": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." - }, - "xError2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." - }, "y": { "anyOf": [ { @@ -3523,28 +4263,6 @@ } ], "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." - }, - "yError": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." - }, - "yError2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." } }, "type": "object" @@ -3582,310 +4300,161 @@ }, "type": "object" }, - "EncodingWithFacet": { + "EncodingSortField": { "additionalProperties": false, + "description": "A sort definition for sorting a discrete scale in an encoding field definition.", "properties": { - "color": { + "field": { + "$ref": "#/definitions/Field", + "description": "The data [field](https://vega.github.io/vega-lite/docs/field.html) to sort by.\n\n__Default value:__ If unspecified, defaults to the field specified in the outer data reference." + }, + "op": { + "$ref": "#/definitions/AggregateOp", + "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, `\"mean\"`." + }, + "order": { "anyOf": [ { - "$ref": "#/definitions/ColorFieldDefWithCondition" + "$ref": "#/definitions/SortOrder" }, { - "$ref": "#/definitions/ColorValueDefWithCondition" + "type": "null" } ], - "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. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\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/FacetFieldDef", - "description": "Horizontal facets for trellis plots." - }, - "detail": { + "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "type": "object" + }, + "ErrorBand": { + "enum": [ + "errorband" + ], + "type": "string" + }, + "ErrorBandConfig": { + "additionalProperties": false, + "properties": { + "band": { "anyOf": [ { - "$ref": "#/definitions/FieldDef" + "type": "boolean" }, { - "items": { - "$ref": "#/definitions/FieldDef" - }, - "type": "array" + "$ref": "#/definitions/MarkConfig" } - ], - "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." + ] }, - "fill": { + "borders": { "anyOf": [ { - "$ref": "#/definitions/ColorFieldDefWithCondition" + "type": "boolean" }, { - "$ref": "#/definitions/ColorValueDefWithCondition" + "$ref": "#/definitions/MarkConfig" } - ], - "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:_ When using `fill` channel, `color ` channel will be ignored. To customize both fill and stroke, please use `fill` and `stroke` channels (not `fill` and `color`)." + ] }, - "fillOpacity": { + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: 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." + }, + "tension": { + "description": "The tension parameter for the interpolation type of the error band.", + "maximum": 1, + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ErrorBandDef": { + "additionalProperties": false, + "properties": { + "band": { "anyOf": [ { - "$ref": "#/definitions/NumericFieldDefWithCondition" + "type": "boolean" }, { - "$ref": "#/definitions/NumericValueDefWithCondition" + "$ref": "#/definitions/MarkConfig" } - ], - "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." + ] }, - "href": { + "borders": { "anyOf": [ { - "$ref": "#/definitions/StringFieldDefWithCondition" + "type": "boolean" }, { - "$ref": "#/definitions/StringValueDefWithCondition" + "$ref": "#/definitions/MarkConfig" } - ], - "description": "A URL to load upon mouse click." - }, - "key": { - "$ref": "#/definitions/FieldDef", - "description": "A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data." + ] }, - "latitude": { - "$ref": "#/definitions/LatLongFieldDef", - "description": "Latitude position of geographically projected marks." + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" }, - "latitude2": { - "$ref": "#/definitions/SecondaryFieldDef", - "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + "color": { + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `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).", + "type": "string" }, - "longitude": { - "$ref": "#/definitions/LatLongFieldDef", - "description": "Longitude position of geographically projected marks." + "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\"`." }, - "longitude2": { - "$ref": "#/definitions/SecondaryFieldDef", - "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + "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\"`: 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." }, "opacity": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueDefWithCondition" - } - ], - "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." + "description": "The opacity (value between [0,1]) of the mark.", + "type": "number" }, - "order": { - "anyOf": [ - { - "$ref": "#/definitions/OrderFieldDef" - }, - { - "items": { - "$ref": "#/definitions/OrderFieldDef" - }, - "type": "array" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "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." - }, - "row": { - "$ref": "#/definitions/FacetFieldDef", - "description": "Vertical facets for trellis plots." - }, - "shape": { - "anyOf": [ - { - "$ref": "#/definitions/ShapeFieldDefWithCondition" - }, - { - "$ref": "#/definitions/ShapeValueDefWithCondition" - } - ], - "description": "For `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `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." - }, - "size": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueDefWithCondition" - } - ], - "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" - }, - "stroke": { - "anyOf": [ - { - "$ref": "#/definitions/ColorFieldDefWithCondition" - }, - { - "$ref": "#/definitions/ColorValueDefWithCondition" - } - ], - "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:_ When using `stroke` channel, `color ` channel will be ignored. To customize both stroke and fill, please use `stroke` and `fill` channels (not `stroke` and `color`)." - }, - "strokeOpacity": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueDefWithCondition" - } - ], - "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." - }, - "strokeWidth": { - "anyOf": [ - { - "$ref": "#/definitions/NumericFieldDefWithCondition" - }, - { - "$ref": "#/definitions/NumericValueDefWithCondition" - } - ], - "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." - }, - "text": { - "anyOf": [ - { - "$ref": "#/definitions/TextFieldDefWithCondition" - }, - { - "$ref": "#/definitions/TextValueDefWithCondition" - } - ], - "description": "Text of the `text` mark." - }, - "tooltip": { - "anyOf": [ - { - "$ref": "#/definitions/TextFieldDefWithCondition" - }, - { - "$ref": "#/definitions/TextValueDefWithCondition" - }, - { - "items": { - "$ref": "#/definitions/TextFieldDef" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "description": "The tooltip text to show upon mouse hover." - }, - "x": { - "anyOf": [ - { - "$ref": "#/definitions/PositionFieldDef" - }, - { - "$ref": "#/definitions/XValueDef" - } - ], - "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." - }, - "x2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/XValueDef" - } - ], - "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." - }, - "xError": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." - }, - "xError2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." - }, - "y": { - "anyOf": [ - { - "$ref": "#/definitions/PositionFieldDef" - }, - { - "$ref": "#/definitions/YValueDef" - } - ], - "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." - }, - "y2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/YValueDef" - } - ], - "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + "orient": { + "$ref": "#/definitions/Orient", + "description": "Orientation of the error band. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." }, - "yError": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + "tension": { + "description": "The tension parameter for the interpolation type of the error band.", + "maximum": 1, + "minimum": 0, + "type": "number" }, - "yError2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + "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\"`)." } }, + "required": [ + "type" + ], "type": "object" }, - "ErrorBand": { + "ErrorBandUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(ErrorEncoding),(ErrorBand|ErrorBandDef)>" + }, + "ErrorBandUnitSpec>": { + "$ref": "#/definitions/GenericUnitSpec<(ErrorEncoding&FacetMapping),(ErrorBand|ErrorBandDef)>" + }, + "ErrorBar": { "enum": [ - "errorband" + "errorbar" ], "type": "string" }, - "ErrorBandConfig": { + "ErrorBarConfig": { "additionalProperties": false, "properties": { - "band": { + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "rule": { "anyOf": [ { "type": "boolean" @@ -3895,7 +4464,7 @@ } ] }, - "borders": { + "ticks": { "anyOf": [ { "type": "boolean" @@ -3904,47 +4473,13 @@ "$ref": "#/definitions/MarkConfig" } ] - }, - "extent": { - "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." - }, - "interpolate": { - "$ref": "#/definitions/Interpolate", - "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: 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." - }, - "tension": { - "description": "The tension parameter for the interpolation type of the error band.", - "maximum": 1, - "minimum": 0, - "type": "number" } }, "type": "object" }, - "ErrorBandDef": { + "ErrorBarDef": { "additionalProperties": false, "properties": { - "band": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/MarkConfig" - } - ] - }, - "borders": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/MarkConfig" - } - ] - }, "clip": { "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", "type": "boolean" @@ -3955,11 +4490,7 @@ }, "extent": { "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." - }, - "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\"`: 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 extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, "opacity": { "description": "The opacity (value between [0,1]) of the mark.", @@ -3967,82 +4498,7 @@ }, "orient": { "$ref": "#/definitions/Orient", - "description": "Orientation of the error band. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." - }, - "tension": { - "description": "The tension parameter for the interpolation type of the error band.", - "maximum": 1, - "minimum": 0, - "type": "number" - }, - "type": { - "$ref": "#/definitions/ErrorBand", - "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." - } - }, - "required": [ - "type" - ], - "type": "object" - }, - "ErrorBar": { - "enum": [ - "errorbar" - ], - "type": "string" - }, - "ErrorBarConfig": { - "additionalProperties": false, - "properties": { - "extent": { - "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." - }, - "rule": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/MarkConfig" - } - ] - }, - "ticks": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/MarkConfig" - } - ] - } - }, - "type": "object" - }, - "ErrorBarDef": { - "additionalProperties": false, - "properties": { - "clip": { - "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", - "type": "boolean" - }, - "color": { - "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `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).", - "type": "string" - }, - "extent": { - "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." - }, - "opacity": { - "description": "The opacity (value between [0,1]) of the mark.", - "type": "number" - }, - "orient": { - "$ref": "#/definitions/Orient", - "description": "Orientation of the error bar. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." + "description": "Orientation of the error bar. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." }, "rule": { "anyOf": [ @@ -4083,6 +4539,12 @@ ], "type": "string" }, + "ErrorBarUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(ErrorEncoding),(ErrorBar|ErrorBarDef)>" + }, + "ErrorBarUnitSpec>": { + "$ref": "#/definitions/GenericUnitSpec<(ErrorEncoding&FacetMapping),(ErrorBar|ErrorBarDef)>" + }, "EventStream": { }, "LayerSpec": { @@ -4113,7 +4575,7 @@ "$ref": "#/definitions/LayerSpec" }, { - "$ref": "#/definitions/CompositeUnitSpec" + "$ref": "#/definitions/ExtendedUnitSpec" } ] }, @@ -4163,6 +4625,28 @@ ], "type": "object" }, + "ExtendedUnitSpec": { + "anyOf": [ + { + "$ref": "#/definitions/NormalizedUnitSpec" + }, + { + "$ref": "#/definitions/CompositeMarkUnitSpec" + } + ], + "description": "Unit spec that can be normalized/expanded into a layer spec or another unit spec." + }, + "ExtendedUnitSpec>": { + "anyOf": [ + { + "$ref": "#/definitions/NormalizedUnitSpec>" + }, + { + "$ref": "#/definitions/CompositeMarkUnitSpec>" + } + ], + "description": "Unit spec that can be normalized/expanded into a layer spec or another unit spec." + }, "FacetFieldDef": { "additionalProperties": false, "properties": { @@ -4243,6 +4727,79 @@ ], "type": "object" }, + "FacetFieldDef": { + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `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:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/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__Note:__ 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`)" + } + }, + "required": [ + "type" + ], + "type": "object" + }, "FacetMapping": { "additionalProperties": false, "properties": { @@ -4258,8 +4815,18 @@ "type": "object" }, "FacetedUnitSpec": { - "$ref": "#/definitions/FacetedCompositeUnitSpecAlias", - "description": "Unit spec that can have a composite mark and row or column channels." + "$ref": "#/definitions/ExtendedUnitSpec>", + "description": "Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec)." + }, + "Field": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ] }, "FieldDefWithCondition,string>": { "additionalProperties": false, @@ -4664,7 +5231,7 @@ ], "type": "object" }, - "FieldDefWithCondition": { + "FieldDefWithCondition,string>": { "additionalProperties": false, "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { @@ -4695,11 +5262,11 @@ "condition": { "anyOf": [ { - "$ref": "#/definitions/ConditionalTextValueDef" + "$ref": "#/definitions/ConditionalStringValueDef" }, { "items": { - "$ref": "#/definitions/ConditionalTextValueDef" + "$ref": "#/definitions/ConditionalStringValueDef" }, "type": "array" } @@ -4707,19 +5274,34 @@ "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)\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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "legend": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/Legend" }, { - "$ref": "#/definitions/RepeatRef" + "type": "null" } ], - "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + "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." }, - "format": { - "description": "The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text field. If not defined, this will be determined automatically.", - "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." + }, + "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." }, "timeUnit": { "$ref": "#/definitions/TimeUnit", @@ -4733,8 +5315,11 @@ ] }, "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__Note:__ 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`)" + "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__Note:__ 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`)", + "enum": [ + "nominal" + ], + "type": "string" } }, "required": [ @@ -4742,9 +5327,9 @@ ], "type": "object" }, - "FieldDef": { + "FieldDefWithCondition,(string|null)>": { "additionalProperties": false, - "description": "Field Def without scale (and without bin: \"binned\" support).", + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", @@ -4770,17 +5355,50 @@ ], "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" }, - "field": { + "condition": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/ConditionalColorValueDef" }, { - "$ref": "#/definitions/RepeatRef" + "items": { + "$ref": "#/definitions/ConditionalColorValueDef" + }, + "type": "array" } ], + "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)\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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "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." + }, + "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." + }, + "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + }, "timeUnit": { "$ref": "#/definitions/TimeUnit", "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)" @@ -4802,389 +5420,409 @@ ], "type": "object" }, - "FieldEqualPredicate": { + "FieldDefWithCondition,number>": { "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "equal": { + "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)" + }, + "bin": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { - "type": "number" + "$ref": "#/definitions/BinParams" }, { - "type": "boolean" + "enum": [ + "binned" + ], + "type": "string" }, { - "$ref": "#/definitions/DateTime" + "type": "null" } ], - "description": "The value that the field should be equal to." + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" }, - "field": { - "description": "Field to be filtered.", - "type": "string" + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalNumberValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalNumberValueDef" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel." }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - } - }, - "required": [ - "equal", - "field" - ], - "type": "object" - }, - "FieldGTEPredicate": { - "additionalProperties": false, - "properties": { "field": { - "description": "Field to be filtered.", - "type": "string" + "$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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." }, - "gte": { + "legend": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/Legend" }, { - "type": "number" + "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." + }, + "scale": { + "anyOf": [ + { + "$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." + }, + "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." }, "timeUnit": { "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" } }, "required": [ - "field", - "gte" + "type" ], "type": "object" }, - "FieldGTPredicate": { + "FieldDefWithCondition,string>": { "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "field": { - "description": "Field to be filtered.", - "type": "string" + "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)" }, - "gt": { + "bin": { "anyOf": [ { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "binned" + ], "type": "string" }, { - "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalStringValueDef" }, { - "$ref": "#/definitions/DateTime" + "items": { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + "type": "array" } ], - "description": "The value that the field should be greater than." + "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel." }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - } - }, - "required": [ - "field", - "gt" - ], - "type": "object" - }, - "FieldLTEPredicate": { - "additionalProperties": false, - "properties": { "field": { - "description": "Field to be filtered.", - "type": "string" + "$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__Note:__ 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).\n\n__Note:__ `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.\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." + }, + "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." + }, + "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." }, "timeUnit": { "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" } }, "required": [ - "field", - "lte" + "type" ], "type": "object" }, - "FieldLTPredicate": { + "FieldDefWithCondition": { "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "field": { - "description": "Field to be filtered.", - "type": "string" + "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)" }, - "lt": { + "bin": { "anyOf": [ { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "binned" + ], "type": "string" }, { - "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalTextValueDef" }, { - "$ref": "#/definitions/DateTime" + "items": { + "$ref": "#/definitions/ConditionalTextValueDef" + }, + "type": "array" } ], - "description": "The value that the field should be less than." + "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel." + }, + "field": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "format": { + "description": "The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text field. If not defined, this will be determined automatically.", + "type": "string" }, "timeUnit": { "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" } }, "required": [ - "field", - "lt" + "type" ], "type": "object" }, - "FieldOneOfPredicate": { + "FieldDefWithCondition,(string|number|boolean)>": { "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "field": { - "description": "Field to be filtered.", - "type": "string" + "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)" }, - "oneOf": { + "bin": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "boolean" }, { - "items": { - "type": "number" - }, - "type": "array" + "$ref": "#/definitions/BinParams" }, { - "items": { - "type": "boolean" - }, - "type": "array" + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalTextValueDef" }, { "items": { - "$ref": "#/definitions/DateTime" + "$ref": "#/definitions/ConditionalTextValueDef" }, "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 predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel." }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - } - }, - "required": [ - "field", - "oneOf" - ], - "type": "object" - }, - "FieldRangePredicate": { - "additionalProperties": false, - "properties": { "field": { - "description": "Field to be filtered.", - "type": "string" - }, - "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" - }, - { - "type": "null" - } - ] - }, - "maxItems": 2, - "minItems": 2, - "type": "array" + "$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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - } - }, - "required": [ - "field", - "range" - ], - "type": "object" - }, - "FieldValidPredicate": { - "additionalProperties": false, - "properties": { - "field": { - "description": "Field to be filtered.", + "format": { + "description": "The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text field. If not defined, this will be determined automatically.", "type": "string" }, "timeUnit": { "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." + "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)" }, - "valid": { - "description": "If set to true the field's value has to be valid, meaning both not `null` and not [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN).", - "type": "boolean" - } - }, - "required": [ - "field", - "valid" - ], - "type": "object" - }, - "FilterTransform": { - "additionalProperties": false, - "properties": { - "filter": { - "$ref": "#/definitions/LogicalOperand", - "description": "The `filter` property must be one of the predicate definitions:\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\n\n2) one of the field predicates: [`equal`](https://vega.github.io/vega-lite/docs/filter.html#equal-predicate),\n[`lt`](https://vega.github.io/vega-lite/docs/filter.html#lt-predicate),\n[`lte`](https://vega.github.io/vega-lite/docs/filter.html#lte-predicate),\n[`gt`](https://vega.github.io/vega-lite/docs/filter.html#gt-predicate),\n[`gte`](https://vega.github.io/vega-lite/docs/filter.html#gte-predicate),\n[`range`](https://vega.github.io/vega-lite/docs/filter.html#range-predicate),\n[`oneOf`](https://vega.github.io/vega-lite/docs/filter.html#one-of-predicate),\nor [`valid`](https://vega.github.io/vega-lite/docs/filter.html#valid-predicate),\n\n3) a [selection predicate](https://vega.github.io/vega-lite/docs/filter.html#selection-predicate)\n\n4) a logical operand that combines (1), (2), or (3)." - } - }, - "required": [ - "filter" - ], - "type": "object" - }, - "FlattenTransform": { - "additionalProperties": false, - "properties": { - "as": { - "description": "The output field names for extracted array values.\n\n__Default value:__ The field name of the corresponding array field", - "items": { - "type": "string" - }, - "type": "array" + "title": { + "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": [ + "string", + "null" + ] }, - "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.", - "items": { - "type": "string" - }, - "type": "array" + "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__Note:__ 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`)" } }, "required": [ - "flatten" + "type" ], "type": "object" }, - "FoldTransform": { + "FieldDef": { "additionalProperties": false, + "description": "Field Def without scale (and without bin: \"binned\" support).", "properties": { - "as": { - "description": "The output field names for the key and value properties produced by the fold transform.\n__Default value:__ `[\"key\", \"value\"]`", - "items": [ + "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)" + }, + "bin": { + "anyOf": [ { - "type": "string" + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" }, { + "enum": [ + "binned" + ], "type": "string" + }, + { + "type": "null" } ], - "maxItems": 2, - "minItems": 2, - "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" }, - "fold": { - "description": "An array of data fields indicating the properties to fold.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "fold" - ], - "type": "object" - }, - "FontStyle": { - "enum": [ - "normal", - "italic" - ], - "type": "string" - }, - "FontWeight": { - "enum": [ - "normal", - "bold", - "lighter", - "bolder", - 100, - 200, - 300, - 400, - 500, - 600, - 700, - 800, - 900 - ], - "type": [ - "string", - "number" - ] - }, - "GenericBinMixins<(boolean|BinParams)>": { - "additionalProperties": false, - "properties": { - "bin": { + "field": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { - "$ref": "#/definitions/BinParams" + "$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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" } }, + "required": [ + "type" + ], "type": "object" }, - "GenericBinMixins<(boolean|BinParams|\"binned\"|null)>": { + "FieldDef": { "additionalProperties": false, + "description": "Field Def without scale (and without bin: \"binned\" support).", "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)" + }, "bin": { "anyOf": [ { @@ -5204,85 +5842,1655 @@ } ], "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" } }, + "required": [ + "type" + ], "type": "object" }, - "FacetSpec": { + "FieldEqualPredicate": { "additionalProperties": false, - "description": "Base interface for a facet specification.", "properties": { - "align": { + "equal": { "anyOf": [ { - "$ref": "#/definitions/LayoutAlign" + "type": "string" }, { - "$ref": "#/definitions/RowCol" + "type": "number" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/DateTime" } ], - "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 value that the field should be equal to." }, - "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" + "field": { + "description": "Field to be filtered.", + "type": "string" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "equal", + "field" + ], + "type": "object" + }, + "FieldGTEPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "description": "Field to be filtered.", + "type": "string" + }, + "gte": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "description": "The value that the field should be greater than or equals to." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "gte" + ], + "type": "object" + }, + "FieldGTPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "description": "Field to be filtered.", + "type": "string" + }, + "gt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + } ], + "description": "The value that the field should be greater than." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "gt" + ], + "type": "object" + }, + "FieldLTEPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "description": "Field to be filtered.", "type": "string" }, - "center": { + "lte": { "anyOf": [ { - "type": "boolean" + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "description": "The value that the field should be less than or equals to." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "lte" + ], + "type": "object" + }, + "FieldLTPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "description": "Field to be filtered.", + "type": "string" + }, + "lt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "description": "The value that the field should be less than." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "lt" + ], + "type": "object" + }, + "FieldOneOfPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "description": "Field to be filtered.", + "type": "string" + }, + "oneOf": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ], + "description": "A set of values that the `field`'s value should be a member of,\nfor a data item included in the filtered data." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "oneOf" + ], + "type": "object" + }, + "FieldRangePredicate": { + "additionalProperties": false, + "properties": { + "field": { + "description": "Field to be filtered.", + "type": "string" + }, + "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" + }, + { + "type": "null" + } + ] + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "range" + ], + "type": "object" + }, + "FieldValidPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "description": "Field to be filtered.", + "type": "string" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + }, + "valid": { + "description": "If set to true the field's value has to be valid, meaning both not `null` and not [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN).", + "type": "boolean" + } + }, + "required": [ + "field", + "valid" + ], + "type": "object" + }, + "FilterTransform": { + "additionalProperties": false, + "properties": { + "filter": { + "$ref": "#/definitions/LogicalOperand", + "description": "The `filter` property must be one of the predicate definitions:\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\n\n2) one of the field predicates: [`equal`](https://vega.github.io/vega-lite/docs/filter.html#equal-predicate),\n[`lt`](https://vega.github.io/vega-lite/docs/filter.html#lt-predicate),\n[`lte`](https://vega.github.io/vega-lite/docs/filter.html#lte-predicate),\n[`gt`](https://vega.github.io/vega-lite/docs/filter.html#gt-predicate),\n[`gte`](https://vega.github.io/vega-lite/docs/filter.html#gte-predicate),\n[`range`](https://vega.github.io/vega-lite/docs/filter.html#range-predicate),\n[`oneOf`](https://vega.github.io/vega-lite/docs/filter.html#one-of-predicate),\nor [`valid`](https://vega.github.io/vega-lite/docs/filter.html#valid-predicate),\n\n3) a [selection predicate](https://vega.github.io/vega-lite/docs/filter.html#selection-predicate)\n\n4) a logical operand that combines (1), (2), or (3)." + } + }, + "required": [ + "filter" + ], + "type": "object" + }, + "FlattenTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for extracted array values.\n\n__Default value:__ The field name of the corresponding array field", + "items": { + "type": "string" + }, + "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.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "flatten" + ], + "type": "object" + }, + "FoldTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for the key and value properties produced by the fold transform.\n__Default value:__ `[\"key\", \"value\"]`", + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "fold": { + "description": "An array of data fields indicating the properties to fold.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "fold" + ], + "type": "object" + }, + "FontStyle": { + "enum": [ + "normal", + "italic" + ], + "type": "string" + }, + "FontWeight": { + "enum": [ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ], + "type": [ + "string", + "number" + ] + }, + "GenericBinMixins<(boolean|BinParams)>": { + "additionalProperties": false, + "properties": { + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + } + ], + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + } + }, + "type": "object" + }, + "GenericBinMixins<(boolean|BinParams|\"binned\"|null)>": { + "additionalProperties": false, + "properties": { + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + } + }, + "type": "object" + }, + "FacetSpec": { + "additionalProperties": false, + "description": "Base interface for a facet specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\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\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "facet": { + "$ref": "#/definitions/FacetMapping", + "description": "An object that describes mappings between `row` and `column` channels and their field definitions." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for facets." + }, + "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__: `10`" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/FacetedUnitSpec" + } + ], + "description": "A specification of the view that gets faceted." + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "facet", + "spec" + ], + "type": "object" + }, + "HConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a horizontal concatenation specification.", + "properties": { + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "hconcat": { + "description": "A list of views that should be concatenated and put into a row.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for horizontally concatenated charts." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "hconcat" + ], + "type": "object" + }, + "RepeatSpec": { + "additionalProperties": false, + "description": "Base interface for a repeat specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\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\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "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/Repeat", + "description": "An object that describes what fields should be repeated into views that are laid out as a `row` or `column`." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale and legend resolutions for repeated charts." + }, + "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__: `10`" + }, + "spec": { + "$ref": "#/definitions/Spec" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$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" + }, + "Spec": { + "anyOf": [ + { + "$ref": "#/definitions/FacetedUnitSpec" + }, + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/FacetSpec" + }, + { + "$ref": "#/definitions/RepeatSpec" + }, + { + "$ref": "#/definitions/VConcatSpec" + }, + { + "$ref": "#/definitions/HConcatSpec" + } + ], + "description": "Any specification in Vega-Lite." + }, + "GenericUnitSpec<(BoxPlotEncoding),(BoxPlot|BoxPlotDef)>": { + "additionalProperties": false, + "description": "Base interface for a unit (single-view) specification.", + "properties": { + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\n2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "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." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "size": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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)" + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + } + }, + "required": [ + "color", + "detail", + "opacity", + "size", + "x", + "y" + ], + "type": "object" + }, + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "mark": { + "anyOf": [ + { + "$ref": "#/definitions/BoxPlot" + }, + { + "$ref": "#/definitions/BoxPlotDef" + } + ], + "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)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "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." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "GenericUnitSpec<(BoxPlotEncoding&FacetMapping),(BoxPlot|BoxPlotDef)>": { + "additionalProperties": false, + "description": "Base interface for a unit (single-view) specification.", + "properties": { + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\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/FacetFieldDef", + "description": "Horizontal facets for trellis plots." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "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." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Vertical facets for trellis plots." + }, + "size": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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)" + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + } + }, + "required": [ + "color", + "detail", + "opacity", + "size", + "x", + "y" + ], + "type": "object" + }, + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "mark": { + "anyOf": [ + { + "$ref": "#/definitions/BoxPlot" + }, + { + "$ref": "#/definitions/BoxPlotDef" + } + ], + "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)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "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." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "GenericUnitSpec<(Encoding),(Mark|MarkDef)>": { + "additionalProperties": false, + "description": "Base interface for a unit (single-view) specification.", + "properties": { + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\n2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "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." + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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:_ When using `fill` channel, `color ` channel will be ignored. To customize both fill and stroke, please use `fill` and `stroke` channels (not `fill` and `color`)." + }, + "fillOpacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "A URL to load upon mouse click." + }, + "key": { + "$ref": "#/definitions/FieldDef", + "description": "A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data." + }, + "latitude": { + "$ref": "#/definitions/LatLongFieldDef", + "description": "Latitude position of geographically projected marks." + }, + "latitude2": { + "$ref": "#/definitions/SecondaryFieldDef", + "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "longitude": { + "$ref": "#/definitions/LatLongFieldDef", + "description": "Longitude position of geographically projected marks." + }, + "longitude2": { + "$ref": "#/definitions/SecondaryFieldDef", + "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "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." + }, + "shape": { + "anyOf": [ + { + "$ref": "#/definitions/ShapeFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ShapeValueDefWithCondition" + } + ], + "description": "For `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `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." + }, + "size": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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:_ When using `stroke` channel, `color ` channel will be ignored. To customize both stroke and fill, please use `stroke` and `fill` channels (not `stroke` and `color`)." + }, + "strokeOpacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "strokeWidth": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + } + ], + "description": "Text of the `text` mark." + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/TextFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "The tooltip text to show upon mouse hover." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + } + }, + "type": "object" + }, + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "mark": { + "anyOf": [ + { + "$ref": "#/definitions/Mark" + }, + { + "$ref": "#/definitions/MarkDef" + } + ], + "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)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "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." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "GenericUnitSpec<(Encoding&FacetMapping),(Mark|MarkDef)>": { + "additionalProperties": false, + "description": "Base interface for a unit (single-view) specification.", + "properties": { + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\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/FacetFieldDef", + "description": "Horizontal facets for trellis plots." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "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." + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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:_ When using `fill` channel, `color ` channel will be ignored. To customize both fill and stroke, please use `fill` and `stroke` channels (not `fill` and `color`)." + }, + "fillOpacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "A URL to load upon mouse click." + }, + "key": { + "$ref": "#/definitions/FieldDef", + "description": "A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data." + }, + "latitude": { + "$ref": "#/definitions/LatLongFieldDef", + "description": "Latitude position of geographically projected marks." + }, + "latitude2": { + "$ref": "#/definitions/SecondaryFieldDef", + "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "longitude": { + "$ref": "#/definitions/LatLongFieldDef", + "description": "Longitude position of geographically projected marks." + }, + "longitude2": { + "$ref": "#/definitions/SecondaryFieldDef", + "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "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." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Vertical facets for trellis plots." + }, + "shape": { + "anyOf": [ + { + "$ref": "#/definitions/ShapeFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ShapeValueDefWithCondition" + } + ], + "description": "For `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `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." + }, + "size": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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:_ When using `stroke` channel, `color ` channel will be ignored. To customize both stroke and fill, please use `stroke` and `fill` channels (not `stroke` and `color`)." + }, + "strokeOpacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "strokeWidth": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + } + ], + "description": "Text of the `text` mark." + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/TextFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "The tooltip text to show upon mouse hover." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + } + }, + "type": "object" + }, + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "mark": { + "anyOf": [ + { + "$ref": "#/definitions/Mark" }, { - "$ref": "#/definitions/RowCol" + "$ref": "#/definitions/MarkDef" } ], - "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": { - "$ref": "#/definitions/Data", - "description": "An object describing the data source" - }, - "description": { - "description": "Description of this mark for commenting purpose.", - "type": "string" - }, - "facet": { - "$ref": "#/definitions/FacetMapping", - "description": "An object that describes mappings between `row` and `column` channels and their field definitions." + "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)." }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, - "resolve": { - "$ref": "#/definitions/Resolve", - "description": "Scale, axis, and legend resolutions for facets." - }, - "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__: `10`" + "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." }, - "spec": { - "anyOf": [ - { - "$ref": "#/definitions/LayerSpec" - }, - { - "$ref": "#/definitions/FacetedUnitSpec" - } - ], - "description": "A specification of the view that gets faceted." + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" }, "title": { "anyOf": [ @@ -5301,30 +7509,25 @@ "$ref": "#/definitions/Transform" }, "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" } }, "required": [ - "facet", - "spec" + "mark" ], "type": "object" }, - "HConcatSpec": { + "GenericUnitSpec<(ErrorEncoding),(ErrorBand|ErrorBandDef)>": { "additionalProperties": false, - "description": "Base interface for a horizontal concatenation specification.", + "description": "Base interface for a unit (single-view) specification.", "properties": { - "bounds": { - "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", - "enum": [ - "full", - "flush" - ], - "type": "string" - }, - "center": { - "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", - "type": "boolean" - }, "data": { "$ref": "#/definitions/Data", "description": "An object describing the data source" @@ -5333,24 +7536,175 @@ "description": "Description of this mark for commenting purpose.", "type": "string" }, - "hconcat": { - "description": "A list of views that should be concatenated and put into a row.", - "items": { - "$ref": "#/definitions/Spec" + "encoding": { + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\n2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "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." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } }, - "type": "array" + "required": [ + "color", + "detail", + "opacity", + "x", + "x2", + "y", + "y2" + ], + "type": "object" + }, + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "mark": { + "anyOf": [ + { + "$ref": "#/definitions/ErrorBand" + }, + { + "$ref": "#/definitions/ErrorBandDef" + } + ], + "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)." }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, - "resolve": { - "$ref": "#/definitions/Resolve", - "description": "Scale, axis, and legend resolutions for horizontally concatenated charts." + "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." }, - "spacing": { - "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", - "type": "number" + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" }, "title": { "anyOf": [ @@ -5369,47 +7723,25 @@ "$ref": "#/definitions/Transform" }, "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" } }, "required": [ - "hconcat" + "mark" ], "type": "object" }, - "RepeatSpec": { + "GenericUnitSpec<(ErrorEncoding),(ErrorBar|ErrorBarDef)>": { "additionalProperties": false, - "description": "Base interface for a repeat specification.", + "description": "Base interface for a unit (single-view) specification.", "properties": { - "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\"`." - }, - "bounds": { - "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", - "enum": [ - "full", - "flush" - ], - "type": "string" - }, - "center": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/RowCol" - } - ], - "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" - }, "data": { "$ref": "#/definitions/Data", "description": "An object describing the data source" @@ -5418,31 +7750,175 @@ "description": "Description of this mark for commenting purpose.", "type": "string" }, - "name": { - "description": "Name of the visualization for later reference.", - "type": "string" - }, - "repeat": { - "$ref": "#/definitions/Repeat", - "description": "An object that describes what fields should be repeated into views that are laid out as a `row` or `column`." + "encoding": { + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\n2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "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." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } + }, + "required": [ + "color", + "detail", + "opacity", + "x", + "x2", + "y", + "y2" + ], + "type": "object" }, - "resolve": { - "$ref": "#/definitions/Resolve", - "description": "Scale and legend resolutions for repeated charts." + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" }, - "spacing": { + "mark": { "anyOf": [ { - "type": "number" + "$ref": "#/definitions/ErrorBar" }, { - "$ref": "#/definitions/RowCol" + "$ref": "#/definitions/ErrorBarDef" } ], - "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__: `10`" + "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)." }, - "spec": { - "$ref": "#/definitions/Spec" + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "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." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" }, "title": { "anyOf": [ @@ -5461,38 +7937,22 @@ "$ref": "#/definitions/Transform" }, "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" } }, "required": [ - "repeat", - "spec" + "mark" ], "type": "object" }, - "Spec": { - "anyOf": [ - { - "$ref": "#/definitions/FacetedUnitSpec" - }, - { - "$ref": "#/definitions/LayerSpec" - }, - { - "$ref": "#/definitions/FacetSpec" - }, - { - "$ref": "#/definitions/RepeatSpec" - }, - { - "$ref": "#/definitions/VConcatSpec" - }, - { - "$ref": "#/definitions/HConcatSpec" - } - ], - "description": "Any specification in Vega-Lite." - }, - "CompositeUnitSpecAlias": { + "GenericUnitSpec<(ErrorEncoding&FacetMapping),(ErrorBand|ErrorBandDef)>": { "additionalProperties": false, "description": "Base interface for a unit (single-view) specification.", "properties": { @@ -5505,15 +7965,166 @@ "type": "string" }, "encoding": { - "$ref": "#/definitions/Encoding", - "description": "A key-value mapping between encoding channels and definition of fields." + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\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/FacetFieldDef", + "description": "Horizontal facets for trellis plots." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "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." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Vertical facets for trellis plots." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } + }, + "required": [ + "color", + "detail", + "opacity", + "x", + "x2", + "y", + "y2" + ], + "type": "object" }, "height": { "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", "type": "number" }, "mark": { - "$ref": "#/definitions/AnyMark", + "anyOf": [ + { + "$ref": "#/definitions/ErrorBand" + }, + { + "$ref": "#/definitions/ErrorBandDef" + } + ], "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)." }, "name": { @@ -5563,7 +8174,7 @@ ], "type": "object" }, - "FacetedCompositeUnitSpecAlias": { + "GenericUnitSpec<(ErrorEncoding&FacetMapping),(ErrorBar|ErrorBarDef)>": { "additionalProperties": false, "description": "Base interface for a unit (single-view) specification.", "properties": { @@ -5576,15 +8187,166 @@ "type": "string" }, "encoding": { - "$ref": "#/definitions/EncodingWithFacet", - "description": "A key-value mapping between encoding channels and definition of fields." + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\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/FacetFieldDef", + "description": "Horizontal facets for trellis plots." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "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." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Vertical facets for trellis plots." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } + }, + "required": [ + "color", + "detail", + "opacity", + "x", + "x2", + "y", + "y2" + ], + "type": "object" }, "height": { "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", "type": "number" }, "mark": { - "$ref": "#/definitions/AnyMark", + "anyOf": [ + { + "$ref": "#/definitions/ErrorBar" + }, + { + "$ref": "#/definitions/ErrorBarDef" + } + ], "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)." }, "name": { @@ -6197,40 +8959,99 @@ ], "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)" }, - "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.", - "type": "string" + "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.", + "type": "string" + }, + "type": { + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\nThe 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" + ], + "type": "string" + } + }, + "type": "object" + }, + "LabelOverlap": { + "anyOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "parity" + ], + "type": "string" + }, + { + "enum": [ + "greedy" + ], + "type": "string" + } + ] + }, + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "field": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] }, "type": { - "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\nThe default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default.", + "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__Note:__ 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`)", "enum": [ - "json" + "quantitative" ], "type": "string" } }, "type": "object" }, - "LabelOverlap": { - "anyOf": [ - { - "type": "boolean" - }, - { - "enum": [ - "parity" - ], - "type": "string" - }, - { - "enum": [ - "greedy" - ], - "type": "string" - } - ] - }, - "LatLongFieldDef": { + "LatLongFieldDef": { "additionalProperties": false, "properties": { "aggregate": { @@ -6258,14 +9079,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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" }, "field": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/RepeatRef" - } - ], + "$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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." }, "timeUnit": { @@ -7831,12 +10645,26 @@ ], "type": "string" }, + "NormalizedUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(Encoding),(Mark|MarkDef)>", + "description": "A unit specification without any shortcut/expansion syntax." + }, + "NormalizedUnitSpec>": { + "$ref": "#/definitions/GenericUnitSpec<(Encoding&FacetMapping),(Mark|MarkDef)>", + "description": "A unit specification without any shortcut/expansion syntax." + }, "NumericFieldDefWithCondition": { "$ref": "#/definitions/FieldDefWithCondition" }, + "NumericFieldDefWithCondition": { + "$ref": "#/definitions/FieldDefWithCondition,number>" + }, "NumericValueDefWithCondition": { "$ref": "#/definitions/ValueDefWithCondition" }, + "NumericValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition,number>" + }, "OrderFieldDef": { "additionalProperties": false, "properties": { @@ -7900,6 +10728,62 @@ ], "type": "object" }, + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "sort": { + "$ref": "#/definitions/SortOrder", + "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" + } + }, + "required": [ + "type" + ], + "type": "object" + }, "Orient": { "enum": [ "horizontal", @@ -8403,6 +11287,99 @@ ], "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)" + }, + "axis": { + "anyOf": [ + { + "$ref": "#/definitions/Axis" + }, + { + "type": "null" + } + ], + "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." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "impute": { + "$ref": "#/definitions/ImputeParams", + "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." + }, + "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." + }, + "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 sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\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`." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + } + ], + "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\"`: 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` - 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." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" + } + }, + "required": [ + "type" + ], + "type": "object" + }, "Predicate": { "anyOf": [ { @@ -9245,6 +12222,52 @@ }, "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + } + }, + "type": "object" + }, "SelectionConfig": { "additionalProperties": false, "properties": { @@ -9338,9 +12361,15 @@ "ShapeFieldDefWithCondition": { "$ref": "#/definitions/StringFieldDefWithCondition" }, + "ShapeFieldDefWithCondition": { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, "ShapeValueDefWithCondition": { "$ref": "#/definitions/StringValueDefWithCondition" }, + "ShapeValueDefWithCondition": { + "$ref": "#/definitions/StringValueDefWithCondition" + }, "SingleDefChannel": { "anyOf": [ { @@ -9366,10 +12395,6 @@ "y", "x2", "y2", - "xError", - "yError", - "xError2", - "yError2", "longitude", "latitude", "longitude2", @@ -9536,6 +12561,25 @@ } ] }, + "Sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "$ref": "#/definitions/SortByEncoding" + }, + { + "type": "null" + } + ] + }, "SortArray": { "anyOf": [ { @@ -9695,12 +12739,24 @@ "StringFieldDefWithCondition": { "$ref": "#/definitions/FieldDefWithCondition,string>" }, + "StringFieldDefWithCondition": { + "$ref": "#/definitions/FieldDefWithCondition,string>" + }, + "StringFieldDefWithCondition": { + "$ref": "#/definitions/FieldDefWithCondition,string>" + }, "StringValueDefWithCondition": { "$ref": "#/definitions/ValueDefWithCondition,string>" }, "StringValueDefWithCondition": { "$ref": "#/definitions/ValueDefWithCondition,string>" }, + "StringValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition,string>" + }, + "StringValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition,string>" + }, "StrokeCap": { "enum": [ "butt", @@ -9984,12 +13040,74 @@ ], "type": "object" }, + "TextFieldDef": { + "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)" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "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- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and 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 [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" + }, + "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__Note:__ 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).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "format": { + "description": "The [formatting pattern](https://vega.github.io/vega-lite/docs/format.html) for a text field. If not defined, this will be determined automatically.", + "type": "string" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "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)" + }, + "title": { + "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": [ + "string", + "null" + ] + }, + "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__Note:__ 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`)" + } + }, + "required": [ + "type" + ], + "type": "object" + }, "TextFieldDefWithCondition": { "$ref": "#/definitions/FieldDefWithCondition" }, + "TextFieldDefWithCondition": { + "$ref": "#/definitions/FieldDefWithCondition,(string|number|boolean)>" + }, "TextValueDefWithCondition": { "$ref": "#/definitions/ValueDefWithCondition" }, + "TextValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition,(string|number|boolean)>" + }, "TickConfig": { "additionalProperties": false, "properties": { @@ -10391,7 +13509,7 @@ "$ref": "#/definitions/LayerSpec" }, { - "$ref": "#/definitions/CompositeUnitSpec" + "$ref": "#/definitions/ExtendedUnitSpec" } ] }, @@ -10781,6 +13899,55 @@ ], "type": "object" }, + "TopLevelCompositeMarkUnitSpec": { + "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/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets 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`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "background": { + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "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." + }, + "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`" + }, + "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" + } + }, + "required": [ + "data" + ], + "type": "object" + }, "TopLevelFacetSpec": { "additionalProperties": false, "properties": { @@ -10896,77 +14063,341 @@ { "$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" + ], + "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": { + "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" + } + }, + "required": [ + "data", + "facet", + "spec" + ], + "type": "object" + }, + "TopLevelFacetedUnitSpec": { + "anyOf": [ + { + "$ref": "#/definitions/TopLevelNormalizedUnitSpec" + }, + { + "$ref": "#/definitions/TopLevelCompositeMarkUnitSpec" + } + ] + }, + "TopLevelNormalizedUnitSpec": { + "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/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets 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`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "background": { + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "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" + }, + "encoding": { + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\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/FacetFieldDef", + "description": "Horizontal facets for trellis plots." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "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." + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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:_ When using `fill` channel, `color ` channel will be ignored. To customize both fill and stroke, please use `fill` and `stroke` channels (not `fill` and `color`)." + }, + "fillOpacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "A URL to load upon mouse click." + }, + "key": { + "$ref": "#/definitions/FieldDef", + "description": "A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data." + }, + "latitude": { + "$ref": "#/definitions/LatLongFieldDef", + "description": "Latitude position of geographically projected marks." + }, + "latitude2": { + "$ref": "#/definitions/SecondaryFieldDef", + "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "longitude": { + "$ref": "#/definitions/LatLongFieldDef", + "description": "Longitude position of geographically projected marks." + }, + "longitude2": { + "$ref": "#/definitions/SecondaryFieldDef", + "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "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." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Vertical facets for trellis plots." + }, + "shape": { + "anyOf": [ + { + "$ref": "#/definitions/ShapeFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ShapeValueDefWithCondition" + } + ], + "description": "For `point` marks the supported values are\n`\"circle\"` (default), `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`,\nor `\"triangle-down\"`, or else a custom SVG path string.\nFor `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." + }, + "size": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "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:_ When using `stroke` channel, `color ` channel will be ignored. To customize both stroke and fill, please use `stroke` and `fill` channels (not `stroke` and `color`)." + }, + "strokeOpacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "strokeWidth": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "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." + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + } + ], + "description": "Text of the `text` mark." + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/TextFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "The tooltip text to show upon mouse hover." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + } }, - "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" - } - }, - "required": [ - "data", - "facet", - "spec" - ], - "type": "object" - }, - "TopLevelFacetedUnitSpec": { - "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/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", - "format": "uri", - "type": "string" }, - "autosize": { + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "mark": { "anyOf": [ { - "$ref": "#/definitions/AutosizeType" + "$ref": "#/definitions/Mark" }, { - "$ref": "#/definitions/AutoSizeParams" + "$ref": "#/definitions/MarkDef" } ], - "description": "Sets 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`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" - }, - "background": { - "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", - "type": "string" - }, - "config": { - "$ref": "#/definitions/Config", - "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." - }, - "data": { - "$ref": "#/definitions/Data", - "description": "An object describing the data source" - }, - "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" - }, - "encoding": { - "$ref": "#/definitions/EncodingWithFacet", - "description": "A key-value mapping between encoding channels and definition of fields." - }, - "height": { - "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\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.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", - "type": "number" - }, - "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)." }, "name": { @@ -11302,6 +14733,50 @@ ], "description": "A ValueDef with Condition where either the conition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}" }, + "ValueDefWithCondition,string>": { + "anyOf": [ + { + "$ref": "#/definitions/ValueDefWithOptionalCondition,string>" + }, + { + "$ref": "#/definitions/ConditionOnlyDef>" + } + ], + "description": "A ValueDef with Condition where either the conition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}" + }, + "ValueDefWithCondition,(string|null)>": { + "anyOf": [ + { + "$ref": "#/definitions/ValueDefWithOptionalCondition,(string|null)>" + }, + { + "$ref": "#/definitions/ConditionOnlyDef>" + } + ], + "description": "A ValueDef with Condition where either the conition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}" + }, + "ValueDefWithCondition,number>": { + "anyOf": [ + { + "$ref": "#/definitions/ValueDefWithOptionalCondition,number>" + }, + { + "$ref": "#/definitions/ConditionOnlyDef>" + } + ], + "description": "A ValueDef with Condition where either the conition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}" + }, + "ValueDefWithCondition,string>": { + "anyOf": [ + { + "$ref": "#/definitions/ValueDefWithOptionalCondition,string>" + }, + { + "$ref": "#/definitions/ConditionOnlyDef>" + } + ], + "description": "A ValueDef with Condition where either the conition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}" + }, "ValueDefWithCondition": { "anyOf": [ { @@ -11313,6 +14788,17 @@ ], "description": "A ValueDef with Condition where either the conition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}" }, + "ValueDefWithCondition,(string|number|boolean)>": { + "anyOf": [ + { + "$ref": "#/definitions/ValueDefWithOptionalCondition,(string|number|boolean)>" + }, + { + "$ref": "#/definitions/ConditionOnlyDef>" + } + ], + "description": "A ValueDef with Condition where either the conition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}" + }, "ValueDefWithOptionalCondition,string>": { "additionalProperties": false, "description": "A ValueDef with optional Condition\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", @@ -11440,6 +14926,133 @@ ], "type": "object" }, + "ValueDefWithOptionalCondition,string>": { + "additionalProperties": false, + "description": "A ValueDef with optional Condition\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef" + }, + { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + "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\" for color, values between `0` to `1` for opacity).", + "type": "string" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ValueDefWithOptionalCondition,(string|null)>": { + "additionalProperties": false, + "description": "A ValueDef with optional Condition\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef" + }, + { + "$ref": "#/definitions/ConditionalColorValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalColorValueDef" + }, + "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\" for color, values between `0` to `1` for opacity).", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ValueDefWithOptionalCondition,number>": { + "additionalProperties": false, + "description": "A ValueDef with optional Condition\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef" + }, + { + "$ref": "#/definitions/ConditionalNumberValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalNumberValueDef" + }, + "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\" for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ValueDefWithOptionalCondition,string>": { + "additionalProperties": false, + "description": "A ValueDef with optional Condition\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef" + }, + { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + "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\" for color, values between `0` to `1` for opacity).", + "type": "string" + } + }, + "required": [ + "value" + ], + "type": "object" + }, "ValueDefWithOptionalCondition": { "additionalProperties": false, "description": "A ValueDef with optional Condition\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", @@ -11475,6 +15088,41 @@ ], "type": "object" }, + "ValueDefWithOptionalCondition,(string|number|boolean)>": { + "additionalProperties": false, + "description": "A ValueDef with optional Condition\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalTextFieldDef" + }, + { + "$ref": "#/definitions/ConditionalTextValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalTextValueDef" + }, + "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\" for color, values between `0` to `1` for opacity).", + "type": [ + "string", + "number", + "boolean" + ] + } + }, + "required": [ + "value" + ], + "type": "object" + }, "ViewBackground": { "additionalProperties": false, "properties": { diff --git a/package.json b/package.json index 158782e2a6a..f0ccf691228 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "deploy:gh": "scripts/deploy-gh.sh", "deploy:schema": "scripts/deploy-schema.sh", "preschema": "npm run prebuild", - "schema": "node --stack-size=2800 ./node_modules/.bin/ts-json-schema-generator --no-type-check --path tsconfig.json --type TopLevelSpec > build/vega-lite-schema.json && npm run renameschema && cp build/vega-lite-schema.json _data/", + "schema": "node --stack-size=4000 ./node_modules/.bin/ts-json-schema-generator --no-type-check --path tsconfig.json --type TopLevelSpec > build/vega-lite-schema.json && npm run renameschema && cp build/vega-lite-schema.json _data/", "renameschema": "scripts/rename-schema.sh", "presite": "npm run prebuild && npm run data && npm run build:site && npm run build:toc && npm run build:versions && scripts/create-example-pages", "site": "bundle exec jekyll serve --incremental", diff --git a/scripts/rename-schema.sh b/scripts/rename-schema.sh index 5b2ea198830..d1ccdaf0af1 100755 --- a/scripts/rename-schema.sh +++ b/scripts/rename-schema.sh @@ -3,10 +3,12 @@ perl -pi -e s,'<\(string\|RepeatRef\)>','',g build/vega-lite-schema.json perl -pi -e s,'<\(string\|RepeatRef\)\,','<',g build/vega-lite-schema.json perl -pi -e s,'','',g build/vega-lite-schema.json +perl -pi -e s,'','',g build/vega-lite-schema.json +perl -pi -e s,'&EmptyObject','',g build/vega-lite-schema.json -perl -pi -e s,'FacetedCompositeUnitSpec','FacetedUnitSpec',g build/vega-lite-schema.json +perl -pi -e s,'FacetedExtendedUnitSpec','FacetedUnitSpec',g build/vega-lite-schema.json perl -pi -e s,'ExtendedLayerSpec','LayerSpec',g build/vega-lite-schema.json -perl -pi -e s,'GenericLayerSpec','LayerSpec',g build/vega-lite-schema.json +perl -pi -e s,'GenericLayerSpec','LayerSpec',g build/vega-lite-schema.json perl -pi -e s,'Generic(.*)','\1',g build/vega-lite-schema.json perl -pi -e s,'GenericUnitSpec','FacetedCompositeUnitSpecAlias',g build/vega-lite-schema.json diff --git a/src/channel.ts b/src/channel.ts index 41507801fea..11915c408e9 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -62,10 +62,6 @@ export const X = Channel.X; export const Y = Channel.Y; export const X2 = Channel.X2; export const Y2 = Channel.Y2; -export const XERROR = Channel.XERROR; -export const YERROR = Channel.YERROR; -export const XERROR2 = Channel.XERROR2; -export const YERROR2 = Channel.YERROR2; export const LATITUDE = Channel.LATITUDE; export const LATITUDE2 = Channel.LATITUDE2; @@ -111,10 +107,6 @@ const UNIT_CHANNEL_INDEX: Flag> = { y: 1, x2: 1, y2: 1, - xError: 1, - yError: 1, - xError2: 1, - yError2: 1, ...GEOPOSITION_CHANNEL_INDEX, @@ -180,10 +172,6 @@ export type SingleDefUnitChannel = | 'y' | 'x2' | 'y2' - | 'xError' - | 'yError' - | 'xError2' - | 'yError2' | 'longitude' | 'latitude' | 'longitude2' @@ -237,10 +225,6 @@ const { // x2 and y2 share the same scale as x and y x2: _x2, y2: _y2, - xError: _xError, - yError: _yError, - xError2: _xError2, - yError2: _yError2, latitude: _latitude, longitude: _longitude, latitude2: _latitude2, @@ -409,11 +393,6 @@ function getSupportedMark(channel: Channel): SupportedMark { return {point: 'always', geoshape: 'always'}; case TEXT: return {text: 'always'}; - case XERROR: - case YERROR: - case XERROR2: - case YERROR2: - return {}; } } @@ -429,10 +408,6 @@ export function rangeType(channel: Channel): RangeType { // X2 and Y2 use X and Y scales, so they similarly have continuous range. case X2: case Y2: - case XERROR: - case YERROR: - case XERROR2: - case YERROR2: return undefined; case ROW: diff --git a/src/compile/mark/mark.ts b/src/compile/mark/mark.ts index e2570754f15..464fb47091c 100644 --- a/src/compile/mark/mark.ts +++ b/src/compile/mark/mark.ts @@ -172,10 +172,6 @@ export function pathGroupingFields(mark: Mark, encoding: Encoding): stri case 'href': case 'x2': case 'y2': - case 'xError': - case 'yError': - case 'xError2': - case 'yError2': case 'latitude': case 'longitude': diff --git a/src/compositemark/boxplot.ts b/src/compositemark/boxplot.ts index 8447c49ff21..bb62083e912 100644 --- a/src/compositemark/boxplot.ts +++ b/src/compositemark/boxplot.ts @@ -1,8 +1,7 @@ import {isNumber, isObject} from 'vega-util'; -import {Channel} from '../channel'; import {Config} from '../config'; import {Encoding, extractTransformsFromEncoding} from '../encoding'; -import {PositionFieldDef} from '../fielddef'; +import {Field, PositionFieldDef} from '../fielddef'; import * as log from '../log'; import {isMarkDef, MarkDef} from '../mark'; import {GenericUnitSpec, NormalizedLayerSpec, NormalizedUnitSpec} from '../spec'; @@ -13,7 +12,6 @@ import { compositeMarkContinuousAxis, compositeMarkOrient, CompositeMarkTooltipSummary, - filterUnsupportedChannels, GenericCompositeMarkDef, getCompositeMarkTooltip, makeCompositeAggregatePartFactory, @@ -21,6 +19,10 @@ import { PartsMixins } from './common'; +export type BoxPlotUnitSpec< + EE = {} // extra encoding parameter (for faceted composite unit spec) +> = GenericUnitSpec & EE, BoxPlot | BoxPlotDef>; + export const BOXPLOT: 'boxplot' = 'boxplot'; export type BoxPlot = typeof BOXPLOT; @@ -68,6 +70,8 @@ export type BoxPlotDef = GenericCompositeMarkDef & orient?: Orient; }; +export type BoxPlotEncoding = Pick, 'x' | 'y' | 'color' | 'detail' | 'opacity' | 'size'>; + export interface BoxPlotConfigMixins { /** * Box Config @@ -75,14 +79,10 @@ export interface BoxPlotConfigMixins { boxplot?: BoxPlotConfig; } -const boxPlotSupportedChannels: Channel[] = ['x', 'y', 'color', 'detail', 'opacity', 'size']; - export function normalizeBoxPlot( spec: GenericUnitSpec, BoxPlot | BoxPlotDef>, config: Config ): NormalizedLayerSpec { - spec = filterUnsupportedChannels(spec, boxPlotSupportedChannels, BOXPLOT); - // TODO: use selection const {mark, encoding: _encoding, selection, projection: _p, ...outerSpec} = spec; const markDef: BoxPlotDef = isMarkDef(mark) ? mark : {type: mark}; diff --git a/src/compositemark/common.ts b/src/compositemark/common.ts index 0eff5ed6242..bafea2299f5 100644 --- a/src/compositemark/common.ts +++ b/src/compositemark/common.ts @@ -1,7 +1,6 @@ import {isBoolean, isString} from 'vega-util'; import {CompositeMark, CompositeMarkDef} from '.'; -import {Channel} from '../channel'; -import {Encoding, fieldDefs, reduce} from '../encoding'; +import {Encoding, fieldDefs} from '../encoding'; import { Field, FieldDefBase, @@ -223,25 +222,3 @@ export function compositeMarkOrient( throw new Error('Need a valid continuous axis for ' + compositeMark + 's'); } } - -export function filterUnsupportedChannels>( - spec: GenericUnitSpec, M | MD>, - supportedChannels: Channel[], - compositeMark: M -): GenericUnitSpec, M | MD> { - return { - ...spec, - encoding: reduce( - spec.encoding, - (newEncoding, fieldDef, channel) => { - if (supportedChannels.indexOf(channel) > -1) { - newEncoding[channel] = fieldDef; - } else { - log.warn(log.message.incompatibleChannel(channel, compositeMark)); - } - return newEncoding; - }, - {} - ) - }; -} diff --git a/src/compositemark/errorband.ts b/src/compositemark/errorband.ts index 051eab75ac2..c3379f7722d 100644 --- a/src/compositemark/errorband.ts +++ b/src/compositemark/errorband.ts @@ -1,12 +1,17 @@ import {Config} from '../config'; import {Encoding} from '../encoding'; +import {Field} from '../fielddef'; import * as log from '../log'; import {MarkDef} from '../mark'; import {GenericUnitSpec, NormalizedLayerSpec} from '../spec'; import {Flag, keys} from '../util'; import {Interpolate, Orient} from '../vega.schema'; import {GenericCompositeMarkDef, makeCompositeAggregatePartFactory, PartsMixins} from './common'; -import {ErrorBarCenter, ErrorBarExtent, errorBarParams} from './errorbar'; +import {ErrorBarCenter, ErrorBarExtent, errorBarParams, ErrorEncoding} from './errorbar'; + +export type ErrorBandUnitSpec< + EE = {} // extra encoding parameter (for faceted composite unit spec) +> = GenericUnitSpec & EE, ErrorBand | ErrorBandDef>; export const ERRORBAND: 'errorband' = 'errorband'; export type ErrorBand = typeof ERRORBAND; diff --git a/src/compositemark/errorbar.ts b/src/compositemark/errorbar.ts index c42a8718169..479d8e495d4 100644 --- a/src/compositemark/errorbar.ts +++ b/src/compositemark/errorbar.ts @@ -1,5 +1,4 @@ import {AggregateOp} from 'vega'; -import {Channel} from '../channel'; import {Config} from '../config'; import {Data} from '../data'; import {Encoding, extractTransformsFromEncoding} from '../encoding'; @@ -10,7 +9,8 @@ import { isFieldDef, PositionFieldDef, SecondaryFieldDef, - title + title, + ValueDef } from '../fielddef'; import * as log from '../log'; import {isMarkDef, MarkDef} from '../mark'; @@ -23,7 +23,6 @@ import { compositeMarkContinuousAxis, compositeMarkOrient, CompositeMarkTooltipSummary, - filterUnsupportedChannels, GenericCompositeMarkDef, getCompositeMarkTooltip, makeCompositeAggregatePartFactory, @@ -31,6 +30,10 @@ import { } from './common'; import {ErrorBand, ErrorBandDef} from './errorband'; +export type ErrorBarUnitSpec< + EE = {} // extra encoding parameter (for faceted composite unit spec) +> = GenericUnitSpec & EE, ErrorBar | ErrorBarDef>; + export const ERRORBAR: 'errorbar' = 'errorbar'; export type ErrorBar = typeof ERRORBAR; @@ -46,6 +49,31 @@ const ERRORBAR_PART_INDEX: Flag = { rule: 1 }; +export interface ErrorEncoding + extends Pick, 'x' | 'y' | 'x2' | 'y2' | 'color' | 'detail' | 'opacity'> { + /** + * Error value of x coordinates for error specified `"errorbar"` and `"errorband"`. + */ + xError?: SecondaryFieldDef | ValueDef; + + /** + * Secondary error value of x coordinates for error specified `"errorbar"` and `"errorband"`. + */ + // `xError2` cannot have type as it should have the same type as `xError` + xError2?: SecondaryFieldDef | ValueDef; + + /** + * Error value of y coordinates for error specified `"errorbar"` and `"errorband"`. + */ + yError?: SecondaryFieldDef | ValueDef; + + /** + * Secondary error value of y coordinates for error specified `"errorbar"` and `"errorband"`. + */ + // `yError2` cannot have type as it should have the same type as `yError` + yError2?: SecondaryFieldDef | ValueDef; +} + export const ERRORBAR_PARTS = keys(ERRORBAR_PART_INDEX); export type ErrorBarPartsMixins = PartsMixins; @@ -91,7 +119,7 @@ export interface ErrorBarConfigMixins { } export function normalizeErrorBar( - spec: GenericUnitSpec, ErrorBar | ErrorBarDef>, + spec: GenericUnitSpec, ErrorBar | ErrorBarDef>, config: Config ): NormalizedLayerSpec { const { @@ -143,7 +171,7 @@ export function normalizeErrorBar( } function errorBarOrientAndInputType( - spec: GenericUnitSpec, ErrorBar | ErrorBand | ErrorBarDef | ErrorBandDef>, + spec: GenericUnitSpec, ErrorBar | ErrorBand | ErrorBarDef | ErrorBandDef>, compositeMark: ErrorBar | ErrorBand ): { orient: Orient; @@ -237,7 +265,7 @@ function errorBarOrientAndInputType( } } -function errorBarIsInputTypeRaw(encoding: Encoding): boolean { +function errorBarIsInputTypeRaw(encoding: ErrorEncoding): boolean { return ( (isFieldDef(encoding.x) || isFieldDef(encoding.y)) && !isFieldDef(encoding.x2) && @@ -249,11 +277,11 @@ function errorBarIsInputTypeRaw(encoding: Encoding): boolean { ); } -function errorBarIsInputTypeAggregatedUpperLower(encoding: Encoding): boolean { +function errorBarIsInputTypeAggregatedUpperLower(encoding: ErrorEncoding): boolean { return isFieldDef(encoding.x2) || isFieldDef(encoding.y2); } -function errorBarIsInputTypeAggregatedError(encoding: Encoding): boolean { +function errorBarIsInputTypeAggregatedError(encoding: ErrorEncoding): boolean { return ( isFieldDef(encoding.xError) || isFieldDef(encoding.xError2) || @@ -262,25 +290,11 @@ function errorBarIsInputTypeAggregatedError(encoding: Encoding): boolean ); } -export const errorBarSupportedChannels: Channel[] = [ - 'x', - 'y', - 'x2', - 'y2', - 'xError', - 'yError', - 'xError2', - 'yError2', - 'color', - 'detail', - 'opacity' -]; - export function errorBarParams< M extends ErrorBar | ErrorBand, MD extends GenericCompositeMarkDef & (ErrorBarDef | ErrorBandDef) >( - spec: GenericUnitSpec, M | MD>, + spec: GenericUnitSpec, M | MD>, compositeMark: M, config: Config ): { @@ -288,7 +302,7 @@ export function errorBarParams< groupby: string[]; continuousAxisChannelDef: PositionFieldDef; continuousAxis: 'x' | 'y'; - encodingWithoutContinuousAxis: Encoding; + encodingWithoutContinuousAxis: ErrorEncoding; ticksOrient: Orient; markDef: MD; outerSpec: { @@ -300,10 +314,8 @@ export function errorBarParams< width?: number; height?: number; }; - tooltipEncoding: Encoding; + tooltipEncoding: ErrorEncoding; } { - spec = filterUnsupportedChannels(spec, errorBarSupportedChannels, compositeMark); - // TODO: use selection const {mark, encoding, selection, projection: _p, ...outerSpec} = spec; const markDef: MD = isMarkDef(mark) ? mark : ({type: mark} as MD); @@ -357,7 +369,7 @@ export function errorBarParams< const aggregate: AggregatedFieldDef[] = [...oldAggregate, ...errorBarSpecificAggregate]; const groupby: string[] = inputType !== 'raw' ? [] : oldGroupBy; - const tooltipEncoding: Encoding = getCompositeMarkTooltip( + const tooltipEncoding: ErrorEncoding = getCompositeMarkTooltip( tooltipSummary, continuousAxisChannelDef, encodingWithoutContinuousAxis, diff --git a/src/compositemark/index.ts b/src/compositemark/index.ts index 74a6df08436..881444020be 100644 --- a/src/compositemark/index.ts +++ b/src/compositemark/index.ts @@ -2,16 +2,33 @@ import {Config} from '../config'; import {AnyMark, isMarkDef} from '../mark'; import {GenericUnitSpec, NormalizedLayerSpec} from '../spec'; import {keys} from '../util'; -import {BOXPLOT, BoxPlot, BOXPLOT_PARTS, BoxPlotConfigMixins, BoxPlotDef, normalizeBoxPlot} from './boxplot'; +import { + BOXPLOT, + BoxPlot, + BOXPLOT_PARTS, + BoxPlotConfigMixins, + BoxPlotDef, + BoxPlotUnitSpec, + normalizeBoxPlot +} from './boxplot'; import { ERRORBAND, ErrorBand, ERRORBAND_PARTS, ErrorBandConfigMixins, ErrorBandDef, + ErrorBandUnitSpec, normalizeErrorBand } from './errorband'; -import {ERRORBAR, ErrorBar, ERRORBAR_PARTS, ErrorBarConfigMixins, ErrorBarDef, normalizeErrorBar} from './errorbar'; +import { + ERRORBAR, + ErrorBar, + ERRORBAR_PARTS, + ErrorBarConfigMixins, + ErrorBarDef, + ErrorBarUnitSpec, + normalizeErrorBar +} from './errorbar'; export {BoxPlotConfig} from './boxplot'; export {ErrorBandConfigMixins} from './errorband'; @@ -36,6 +53,9 @@ export function remove(mark: string) { delete compositeMarkRegistry[mark]; } +export type CompositeMarkUnitSpec< + EE = {} // extra encoding parameter (for faceted composite unit spec) +> = ErrorBarUnitSpec | ErrorBandUnitSpec | BoxPlotUnitSpec; export type CompositeMark = BoxPlot | ErrorBar | ErrorBand; export function getAllCompositeMarks() { diff --git a/src/encoding.ts b/src/encoding.ts index b68680cdb49..2bc5a9be4bb 100644 --- a/src/encoding.ts +++ b/src/encoding.ts @@ -81,28 +81,6 @@ export interface Encoding { // `y2` cannot have type as it should have the same type as `y` y2?: SecondaryFieldDef | ValueDef; - /** - * Error value of x coordinates for error specified `"errorbar"` and `"errorband"`. - */ - xError?: SecondaryFieldDef | ValueDef; - - /** - * Secondary error value of x coordinates for error specified `"errorbar"` and `"errorband"`. - */ - // `xError2` cannot have type as it should have the same type as `xError` - xError2?: SecondaryFieldDef | ValueDef; - - /** - * Error value of y coordinates for error specified `"errorbar"` and `"errorband"`. - */ - yError?: SecondaryFieldDef | ValueDef; - - /** - * Secondary error value of y coordinates for error specified `"errorbar"` and `"errorband"`. - */ - // `yError2` cannot have type as it should have the same type as `yError` - yError2?: SecondaryFieldDef | ValueDef; - /** * Longitude position of geographically projected marks. */ diff --git a/src/mark.ts b/src/mark.ts index 5e7e3acd598..d332675df51 100644 --- a/src/mark.ts +++ b/src/mark.ts @@ -145,7 +145,7 @@ export function isMarkDef(mark: AnyMark): mark is MarkDef | CompositeMarkDef { const PRIMITIVE_MARK_INDEX = toSet(PRIMITIVE_MARKS); -export function isPrimitiveMark(mark: CompositeMark | CompositeMarkDef | Mark | MarkDef): mark is Mark { +export function isPrimitiveMark(mark: AnyMark): mark is Mark { const markType = isMarkDef(mark) ? mark.type : mark; return markType in PRIMITIVE_MARK_INDEX; } diff --git a/src/normalize.ts b/src/normalize.ts index f8a18ba8e8a..4c9f5812bc2 100644 --- a/src/normalize.ts +++ b/src/normalize.ts @@ -18,9 +18,9 @@ import { } from './mark'; import {Projection} from './projection'; import { - CompositeUnitSpec, ExtendedLayerSpec, - FacetedCompositeUnitSpec, + ExtendedUnitSpec, + FacetedExtendedUnitSpec, GenericFacetSpec, GenericHConcatSpec, GenericRepeatSpec, @@ -46,7 +46,7 @@ import {stack} from './stack'; import {keys, omit, pick} from './util'; export function normalizeTopLevelSpec( - spec: TopLevelSpec | GenericSpec | FacetedCompositeUnitSpec, + spec: TopLevelSpec | GenericSpec | FacetedExtendedUnitSpec, config: Config ): TopLevel { return normalize(spec, config); @@ -56,7 +56,7 @@ export function normalizeTopLevelSpec( * Decompose extended unit specs into composition of pure unit specs. */ function normalize( - spec: GenericSpec | FacetedCompositeUnitSpec, + spec: GenericSpec | FacetedExtendedUnitSpec, config: Config ): NormalizedSpec { if (isFacetSpec(spec)) { @@ -87,7 +87,7 @@ function normalize( } function normalizeFacet( - spec: GenericFacetSpec, + spec: GenericFacetSpec, config: Config ): NormalizedFacetSpec { const {spec: subspec, ...rest} = spec; @@ -149,7 +149,7 @@ function normalizeLayer( } function normalizeRepeat( - spec: GenericRepeatSpec, + spec: GenericRepeatSpec, config: Config ): NormalizedRepeatSpec { const {spec: subspec, ...rest} = spec; @@ -160,7 +160,7 @@ function normalizeRepeat( } function normalizeVConcat( - spec: GenericVConcatSpec, + spec: GenericVConcatSpec, config: Config ): NormalizedConcatSpec { const {vconcat: vconcat, ...rest} = spec; @@ -171,7 +171,7 @@ function normalizeVConcat( } function normalizeHConcat( - spec: GenericHConcatSpec, + spec: GenericHConcatSpec, config: Config ): NormalizedConcatSpec { const {hconcat: hconcat, ...rest} = spec; @@ -181,7 +181,7 @@ function normalizeHConcat( }; } -function normalizeFacetedUnit(spec: FacetedCompositeUnitSpec, config: Config): NormalizedFacetSpec { +function normalizeFacetedUnit(spec: FacetedExtendedUnitSpec, config: Config): NormalizedFacetSpec { // New encoding in the inside spec should not contain row / column // as row/column should be moved to facet const {row: row, column: column, ...encoding} = spec.encoding; diff --git a/src/spec/index.ts b/src/spec/index.ts index cf631d20d55..beaec8f177b 100644 --- a/src/spec/index.ts +++ b/src/spec/index.ts @@ -19,7 +19,13 @@ import {GenericFacetSpec, isFacetSpec, NormalizedFacetSpec} from './facet'; import {ExtendedLayerSpec, GenericLayerSpec, isLayerSpec, NormalizedLayerSpec} from './layer'; import {GenericRepeatSpec, isRepeatSpec, NormalizedRepeatSpec} from './repeat'; import {TopLevel} from './toplevel'; -import {FacetedCompositeUnitSpec, GenericUnitSpec, isUnitSpec, NormalizedUnitSpec} from './unit'; +import { + FacetedExtendedUnitSpec, + GenericUnitSpec, + isUnitSpec, + NormalizedUnitSpec, + TopLevelFacetedUnitSpec +} from './unit'; export {normalizeTopLevelSpec as normalize} from '../normalize'; export {BaseSpec, DataMixins, LayoutSizeMixins} from './base'; @@ -35,7 +41,7 @@ export {GenericFacetSpec, isFacetSpec, NormalizedFacetSpec} from './facet'; export {ExtendedLayerSpec, GenericLayerSpec, isLayerSpec, NormalizedLayerSpec} from './layer'; export {GenericRepeatSpec, isRepeatSpec, NormalizedRepeatSpec} from './repeat'; export {TopLevel} from './toplevel'; -export {CompositeUnitSpec, FacetedCompositeUnitSpec, GenericUnitSpec, isUnitSpec, NormalizedUnitSpec} from './unit'; +export {ExtendedUnitSpec, FacetedExtendedUnitSpec, GenericUnitSpec, isUnitSpec, NormalizedUnitSpec} from './unit'; /** * Any specification in Vega-Lite. @@ -53,8 +59,7 @@ export type GenericSpec, L extends GenericLa */ export type NormalizedSpec = GenericSpec; -export type TopLevelFacetedUnitSpec = TopLevel & DataMixins; -export type TopLevelFacetSpec = TopLevel> & DataMixins; +export type TopLevelFacetSpec = TopLevel> & DataMixins; /** * A Vega-Lite top-level specification. @@ -65,9 +70,9 @@ export type TopLevelSpec = | TopLevelFacetedUnitSpec | TopLevelFacetSpec | TopLevel - | TopLevel> - | TopLevel> - | TopLevel>; + | TopLevel> + | TopLevel> + | TopLevel>; /* Custom type guards */ @@ -123,7 +128,7 @@ export function fieldDefs(spec: GenericSpec): TypedFieldDef[] { return vals(fieldDefIndex(spec)); } -export function isStacked(spec: TopLevel, config?: Config): boolean { +export function isStacked(spec: TopLevel, config?: Config): boolean { config = config || spec.config; if (isPrimitiveMark(spec.mark)) { return stack(spec.mark, spec.encoding, config ? config.stack : undefined) !== null; diff --git a/src/spec/layer.ts b/src/spec/layer.ts index 65badc71652..75a514d7e72 100644 --- a/src/spec/layer.ts +++ b/src/spec/layer.ts @@ -3,7 +3,7 @@ import {RepeatRef} from '../fielddef'; import {Projection} from '../projection'; import {Resolve} from '../resolve'; import {BaseSpec, LayerUnitMixins} from './base'; -import {CompositeUnitSpec, GenericUnitSpec, NormalizedUnitSpec} from './unit'; +import {ExtendedUnitSpec, GenericUnitSpec, NormalizedUnitSpec} from './unit'; /** * Base interface for a layer specification. @@ -25,7 +25,7 @@ export interface GenericLayerSpec> extends B /** * Layer Spec with `encoding` and `projection` shorthands that will be applied to underlying unit (single-view) specifications. */ -export interface ExtendedLayerSpec extends GenericLayerSpec { +export interface ExtendedLayerSpec extends GenericLayerSpec { /** * A shared key-value mapping between encoding channels and definition of fields in the underlying layers. */ diff --git a/src/spec/unit.ts b/src/spec/unit.ts index f22c1841498..492e827398c 100644 --- a/src/spec/unit.ts +++ b/src/spec/unit.ts @@ -1,13 +1,12 @@ -import {Encoding, EncodingWithFacet} from '../encoding'; -import {RepeatRef} from '../fielddef'; -import {AnyMark, Mark, MarkDef} from '../mark'; +import {CompositeMarkUnitSpec} from '../compositemark/index'; +import {Encoding} from '../encoding'; +import {Field} from '../fielddef'; +import {Mark, MarkDef} from '../mark'; import {Projection} from '../projection'; import {SelectionDef} from '../selection'; -import {BaseSpec, LayerUnitMixins} from './base'; - -export {normalizeTopLevelSpec as normalize} from '../normalize'; -export {BaseSpec, DataMixins, LayoutSizeMixins} from './base'; -export {TopLevel} from './toplevel'; +import {BaseSpec, DataMixins, LayerUnitMixins} from './base'; +import {FacetMapping} from './facet'; +import {TopLevel} from './toplevel'; /** * Base interface for a unit (single-view) specification. @@ -39,18 +38,39 @@ export interface GenericUnitSpec, M> extends BaseSpec, L /** * A unit specification without any shortcut/expansion syntax. */ -export type NormalizedUnitSpec = GenericUnitSpec, Mark | MarkDef>; +export type NormalizedUnitSpec< + /** Extra Encoding */ + EE = {} +> = GenericUnitSpec & EE, Mark | MarkDef>; + +/* tslint:disable */ +// Need to declare empty object so the generated schema has a reasonable name for ExtendedUnitSpec +export interface EmptyObject {} +/* tslint:enable */ /** - * Unit spec that can have a composite mark. + * Unit spec that can be normalized/expanded into a layer spec or another unit spec. */ -export type CompositeUnitSpec = GenericUnitSpec, AnyMark>; +export type ExtendedUnitSpec< + /** Extra Encoding */ + EE = EmptyObject +> = NormalizedUnitSpec | CompositeMarkUnitSpec; /** - * Unit spec that can have a composite mark and row or column channels. + * Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec). */ -export type FacetedCompositeUnitSpec = GenericUnitSpec, AnyMark>; +export type FacetedExtendedUnitSpec = ExtendedUnitSpec>; + +// Note: The following three lines are equivalent to: +// ``` +// export type TopLevelFacetedUnitSpec = TopLevel & DataMixins; +// ``` +// However, the JSON schema generator does not support the simpler syntax + +export type TopLevelNormalizedUnitSpec = TopLevel>> & DataMixins; +export type TopLevelCompositeMarkUnitSpec = TopLevel>> & DataMixins; +export type TopLevelFacetedUnitSpec = TopLevelNormalizedUnitSpec | TopLevelCompositeMarkUnitSpec; -export function isUnitSpec(spec: BaseSpec): spec is FacetedCompositeUnitSpec | NormalizedUnitSpec { +export function isUnitSpec(spec: BaseSpec): spec is FacetedExtendedUnitSpec | NormalizedUnitSpec { return !!spec['mark']; } diff --git a/src/validate.ts b/src/validate.ts index 9f4414b85ab..e0b4098d298 100644 --- a/src/validate.ts +++ b/src/validate.ts @@ -1,7 +1,6 @@ import {toSet} from 'vega-util'; -import {isMarkDef} from './mark'; -import {BAR} from './mark'; -import {FacetedCompositeUnitSpec} from './spec'; +import {BAR, isMarkDef} from './mark'; +import {FacetedExtendedUnitSpec} from './spec'; // TODO: move to vl.spec.validator? export interface RequiredChannelMap { @@ -57,7 +56,7 @@ export const DEFAULT_SUPPORTED_CHANNEL_TYPE: SupportedChannelMap = { * or null if the encoding is valid. */ export function getEncodingMappingError( - spec: FacetedCompositeUnitSpec, + spec: FacetedExtendedUnitSpec, requiredChannelMap: RequiredChannelMap = DEFAULT_REQUIRED_CHANNEL_MAP, supportedChannelMap: SupportedChannelMap = DEFAULT_SUPPORTED_CHANNEL_TYPE ) { diff --git a/test/compositemark/errorbar.test.ts b/test/compositemark/errorbar.test.ts index 614b143920c..35bc12ca25e 100644 --- a/test/compositemark/errorbar.test.ts +++ b/test/compositemark/errorbar.test.ts @@ -1,11 +1,12 @@ /* tslint:disable:quotemark */ import {AggregateOp} from 'vega'; import {ErrorBarCenter, ErrorBarExtent} from '../../src/compositemark/errorbar'; +import {CompositeMarkUnitSpec} from '../../src/compositemark/index'; import {defaultConfig} from '../../src/config'; import {isFieldDef} from '../../src/fielddef'; import * as log from '../../src/log'; import {isMarkDef} from '../../src/mark'; -import {CompositeUnitSpec, ExtendedLayerSpec, GenericSpec, isLayerSpec, isUnitSpec, normalize} from '../../src/spec'; +import {ExtendedLayerSpec, GenericSpec, isLayerSpec, isUnitSpec, normalize} from '../../src/spec'; import {isAggregate, isCalculate, Transform} from '../../src/transform'; import {some} from '../../src/util'; @@ -614,7 +615,7 @@ describe('normalizeErrorBar for all possible extents and centers with raw data i for (const center of centers) { for (const extent of extents) { - const spec: GenericSpec = { + const spec: GenericSpec = { data: {url: 'data/population.json'}, mark: {type, ...(center ? {center} : {}), ...(extent ? {extent} : {})}, encoding: { @@ -900,29 +901,6 @@ describe('normalizeErrorBar with aggregated upper and lower bound input', () => }) ); - it( - 'should produce a warning if there is an unsupported channel in encoding', - log.wrap(localLogger => { - const size = 'size'; - - normalize( - { - data, - mark, - encoding: { - x: {field: 'age', type: 'ordinal'}, - y: {field: 'people', type: 'quantitative'}, - y2: {field: 'people2', type: 'quantitative', aggregate: 'min'}, - size: {value: 10} - } - }, - defaultConfig - ); - - expect(localLogger.warns[0]).toEqual(log.message.incompatibleChannel(size, mark)); - }) - ); - it('should produce a correct tooltip title for ranged errorbar', () => { const outputSpec = normalize( {