diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index 2a4f6b65cf3..f6916c5f04a 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -85,6 +85,22 @@ ], "type": "string" }, + "AnyMark": { + "anyOf": [ + { + "$ref": "#/definitions/CompositeMark" + }, + { + "$ref": "#/definitions/CompositeMarkDef" + }, + { + "$ref": "#/definitions/Mark" + }, + { + "$ref": "#/definitions/MarkDef" + } + ] + }, "AreaConfig": { "additionalProperties": false, "properties": { @@ -1660,12 +1676,6 @@ ], "type": "object" }, - "BoxPlotUnitSpec": { - "$ref": "#/definitions/GenericUnitSpec<(BoxPlotEncoding),(BoxPlot|BoxPlotDef)>" - }, - "BoxPlotUnitSpecWithFacet": { - "$ref": "#/definitions/GenericUnitSpec<(BoxPlotEncodingWithFacet),(BoxPlot|BoxPlotDef)>" - }, "BrushConfig": { "additionalProperties": false, "properties": { @@ -1730,480 +1740,521 @@ "ColorValueDefWithCondition": { "$ref": "#/definitions/ValueDefWithCondition" }, - "CompositeMarkUnitSpec": { - "anyOf": [ - { - "$ref": "#/definitions/ErrorBarUnitSpec" - }, - { - "$ref": "#/definitions/ErrorBandUnitSpec" - }, - { - "$ref": "#/definitions/BoxPlotUnitSpec" - } - ] - }, - "CompositeMarkUnitSpecWithFacet": { - "anyOf": [ - { - "$ref": "#/definitions/ErrorBarUnitSpecWithFacet" - }, - { - "$ref": "#/definitions/ErrorBandUnitSpecWithFacet" - }, - { - "$ref": "#/definitions/BoxPlotUnitSpecWithFacet" - } - ] - }, - "ConditionOnlyDef>": { + "Encoding": { "additionalProperties": false, - "description": "A Condition only definition.\n{\n condition: {field: ...} | {value: ...}\n}", "properties": { - "condition": { + "color": { "anyOf": [ { - "$ref": "#/definitions/ConditionalMarkPropFieldDef<\"nominal\">" + "$ref": "#/definitions/ColorFieldDefWithCondition" }, { - "$ref": "#/definitions/ConditionalValueDef" + "$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/ConditionalValueDef" + "$ref": "#/definitions/FieldDef" }, "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": { + "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/ConditionalMarkPropFieldDef" + "$ref": "#/definitions/ColorFieldDefWithCondition" }, { - "$ref": "#/definitions/ConditionalValueDef" + "$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" }, { - "items": { - "$ref": "#/definitions/ConditionalValueDef" - }, - "type": "array" + "$ref": "#/definitions/NumericValueDefWithCondition" } ], - "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": { + "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/ConditionalMarkPropFieldDef" + "$ref": "#/definitions/StringFieldDefWithCondition" }, { - "$ref": "#/definitions/ConditionalValueDef" + "$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/ConditionalValueDef" + "$ref": "#/definitions/OrderFieldDef" }, "type": "array" + }, + { + "$ref": "#/definitions/NumberValueDef" } ], - "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": { + "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/ConditionalTextFieldDef" + "$ref": "#/definitions/ShapeFieldDefWithCondition" }, { - "$ref": "#/definitions/ConditionalValueDef" + "$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" }, { - "items": { - "$ref": "#/definitions/ConditionalValueDef" - }, - "type": "array" + "$ref": "#/definitions/NumericValueDefWithCondition" } ], - "description": "A field definition or one or more value definition(s) with a selection predicate." - } - }, - "required": [ - "condition" - ], - "type": "object" - }, - "ConditionalMarkPropFieldDef<\"nominal\">": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate>" + "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" }, - { - "$ref": "#/definitions/ConditionalSelection>" - } - ] - }, - "ConditionalMarkPropFieldDef": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate" + "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`)." }, - { - "$ref": "#/definitions/ConditionalSelection" - } - ] - }, - "ConditionalMarkPropFieldDef": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate>" + "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." }, - { - "$ref": "#/definitions/ConditionalSelection>" - } - ] - }, - "ConditionalTextFieldDef": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate" + "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." }, - { - "$ref": "#/definitions/ConditionalSelection" - } - ] - }, - "ConditionalValueDef": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate" - }, - { - "$ref": "#/definitions/ConditionalSelection" - } - ] - }, - "ConditionalColorValueDef": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate" - }, - { - "$ref": "#/definitions/ConditionalSelection" - } - ] - }, - "ConditionalTextValueDef": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate" - }, - { - "$ref": "#/definitions/ConditionalSelection" - } - ] - }, - "ConditionalNumberValueDef": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate" - }, - { - "$ref": "#/definitions/ConditionalSelection" - } - ] - }, - "ConditionalStringValueDef": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalPredicate" - }, - { - "$ref": "#/definitions/ConditionalSelection" - } - ] - }, - "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)" + "text": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + } + ], + "description": "Text of the `text` mark." }, - "bin": { + "tooltip": { "anyOf": [ { - "type": "boolean" + "$ref": "#/definitions/TextFieldDefWithCondition" }, { - "$ref": "#/definitions/BinParams" + "$ref": "#/definitions/TextValueDefWithCondition" }, { - "enum": [ - "binned" - ], - "type": "string" + "items": { + "$ref": "#/definitions/TextFieldDef" + }, + "type": "array" }, { "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`." + "description": "The tooltip text to show upon mouse hover." }, - "legend": { + "x": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "$ref": "#/definitions/PositionFieldDef" }, { - "type": "null" + "$ref": "#/definitions/XValueDef" } ], - "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." + "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\"`." }, - "scale": { + "x2": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "$ref": "#/definitions/SecondaryFieldDef" }, { - "type": "null" + "$ref": "#/definitions/XValueDef" } ], - "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": { - "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": [ - "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)" + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." }, - "bin": { + "xError": { "anyOf": [ { - "type": "boolean" - }, - { - "$ref": "#/definitions/BinParams" - }, - { - "enum": [ - "binned" - ], - "type": "string" + "$ref": "#/definitions/SecondaryFieldDef" }, { - "type": "null" + "$ref": "#/definitions/NumberValueDef" } ], - "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`." + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, - "legend": { + "xError2": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "$ref": "#/definitions/SecondaryFieldDef" }, { - "type": "null" + "$ref": "#/definitions/NumberValueDef" } ], - "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." + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, - "scale": { + "y": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "$ref": "#/definitions/PositionFieldDef" }, { - "type": "null" + "$ref": "#/definitions/YValueDef" } ], - "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/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)" + "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\"`." }, - "bin": { + "y2": { "anyOf": [ { - "type": "boolean" - }, - { - "$ref": "#/definitions/BinParams" - }, - { - "enum": [ - "binned" - ], - "type": "string" + "$ref": "#/definitions/SecondaryFieldDef" }, { - "type": "null" + "$ref": "#/definitions/YValueDef" } ], - "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`." + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." }, - "legend": { + "yError": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "$ref": "#/definitions/SecondaryFieldDef" }, { - "type": "null" + "$ref": "#/definitions/NumberValueDef" } ], - "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." + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, - "scale": { + "yError2": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "$ref": "#/definitions/SecondaryFieldDef" }, { - "type": "null" + "$ref": "#/definitions/NumberValueDef" } ], - "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`." + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } + }, + "type": "object" + }, + "CompositeMark": { + "anyOf": [ + { + "$ref": "#/definitions/BoxPlot" }, - "test": { - "$ref": "#/definitions/LogicalOperand" + { + "$ref": "#/definitions/ErrorBar" }, - "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)" + { + "$ref": "#/definitions/ErrorBand" + } + ] + }, + "CompositeMarkDef": { + "anyOf": [ + { + "$ref": "#/definitions/BoxPlotDef" }, - "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" - ] + { + "$ref": "#/definitions/ErrorBarDef" }, - "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`)" + { + "$ref": "#/definitions/ErrorBandDef" + } + ] + }, + "CompositeUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec", + "description": "Unit spec that can be normalized/expanded into a layer spec or another unit spec." + }, + "ConditionOnlyDef>": { + "additionalProperties": false, + "description": "A Condition only definition.\n{\n condition: {field: ...} | {value: ...}\n}", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef<\"nominal\">" + }, + { + "$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": [ - "test", - "type" + "condition" ], "type": "object" }, - "ConditionalPredicate": { + "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/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": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalMarkPropFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalMarkPropFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalTextFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalValueDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalColorValueDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalTextValueDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalNumberValueDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalStringValueDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalPredicate>": { "additionalProperties": false, "properties": { "aggregate": { @@ -2234,9 +2285,31 @@ "$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" + "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" @@ -2253,8 +2326,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": [ @@ -2263,7 +2339,231 @@ ], "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" + }, + "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`." + }, + "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": { + "$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": { @@ -3193,267 +3493,25 @@ "Element": { "type": "string" }, - "Encoding": { + "EncodingSortField": { "additionalProperties": false, + "description": "A sort definition for sorting a discrete scale in an encoding field definition.", "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)." + "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." }, - "detail": { + "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/FieldDef" + "$ref": "#/definitions/SortOrder" }, { - "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" - }, - "EncodingSortField": { - "additionalProperties": false, - "description": "A sort definition for sorting a discrete scale in an encoding field definition.", - "properties": { - "field": { - "$ref": "#/definitions/Field", - "description": "The data [field](https://vega.github.io/vega-lite/docs/field.html) to sort by.\n\n__Default value:__ If unspecified, defaults to the field specified in the outer data reference." - }, - "op": { - "$ref": "#/definitions/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/SortOrder" - }, - { - "type": "null" + "type": "null" } ], "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." @@ -3570,12 +3628,6 @@ ], "type": "object" }, - "ErrorBandUnitSpec": { - "$ref": "#/definitions/GenericUnitSpec<(ErrorEncoding),(ErrorBand|ErrorBandDef)>" - }, - "ErrorBandUnitSpecWithFacet": { - "$ref": "#/definitions/GenericUnitSpec<(ErrorEncodingWithFacet),(ErrorBand|ErrorBandDef)>" - }, "ErrorBar": { "enum": [ "errorbar" @@ -3674,12 +3726,6 @@ ], "type": "string" }, - "ErrorBarUnitSpec": { - "$ref": "#/definitions/GenericUnitSpec<(ErrorEncoding),(ErrorBar|ErrorBarDef)>" - }, - "ErrorBarUnitSpecWithFacet": { - "$ref": "#/definitions/GenericUnitSpec<(ErrorEncodingWithFacet),(ErrorBar|ErrorBarDef)>" - }, "EventStream": { }, "LayerSpec": { @@ -3710,7 +3756,7 @@ "$ref": "#/definitions/LayerSpec" }, { - "$ref": "#/definitions/ExtendedUnitSpec" + "$ref": "#/definitions/CompositeUnitSpec" } ] }, @@ -3760,28 +3806,6 @@ ], "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." - }, - "ExtendedUnitSpecWithFacet": { - "anyOf": [ - { - "$ref": "#/definitions/NormalizedUnitSpecWithFacet" - }, - { - "$ref": "#/definitions/CompositeMarkUnitSpecWithFacet" - } - ], - "description": "Unit spec that can be normalized/expanded into a layer spec or another unit spec." - }, "FacetFieldDef": { "additionalProperties": false, "properties": { @@ -3869,303 +3893,315 @@ }, "type": "object" }, - "FacetedExtendedUnitSpec": { - "$ref": "#/definitions/ExtendedUnitSpecWithFacet", - "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>": { + "FacetedEncoding": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)" - }, - "bin": { + "color": { "anyOf": [ { - "type": "boolean" - }, - { - "$ref": "#/definitions/BinParams" - }, - { - "enum": [ - "binned" - ], - "type": "string" + "$ref": "#/definitions/ColorFieldDefWithCondition" }, { - "type": "null" + "$ref": "#/definitions/ColorValueDefWithCondition" } ], - "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": "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)." }, - "condition": { + "column": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Horizontal facets for trellis plots." + }, + "detail": { "anyOf": [ { - "$ref": "#/definitions/ConditionalStringValueDef" + "$ref": "#/definitions/FieldDef" }, { "items": { - "$ref": "#/definitions/ConditionalStringValueDef" + "$ref": "#/definitions/FieldDef" }, "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." + "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." }, - "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`." + "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`)." }, - "legend": { + "fillOpacity": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "$ref": "#/definitions/NumericFieldDefWithCondition" }, { - "type": "null" + "$ref": "#/definitions/NumericValueDefWithCondition" } ], - "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." + "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." }, - "scale": { + "href": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "$ref": "#/definitions/StringFieldDefWithCondition" }, { - "type": "null" + "$ref": "#/definitions/StringValueDefWithCondition" } ], - "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." + "description": "A URL to load upon mouse click." }, - "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`." + "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." }, - "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)" + "latitude": { + "$ref": "#/definitions/LatLongFieldDef", + "description": "Latitude position of geographically projected marks." }, - "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" - ] + "latitude2": { + "$ref": "#/definitions/SecondaryFieldDef", + "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." }, - "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`)", - "enum": [ - "nominal" - ], - "type": "string" - } - }, - "required": [ - "type" - ], - "type": "object" - }, - "FieldDefWithCondition": { - "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", - "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)" + "longitude": { + "$ref": "#/definitions/LatLongFieldDef", + "description": "Longitude position of geographically projected marks." }, - "bin": { + "longitude2": { + "$ref": "#/definitions/SecondaryFieldDef", + "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "opacity": { "anyOf": [ { - "type": "boolean" - }, - { - "$ref": "#/definitions/BinParams" - }, - { - "enum": [ - "binned" - ], - "type": "string" + "$ref": "#/definitions/NumericFieldDefWithCondition" }, { - "type": "null" + "$ref": "#/definitions/NumericValueDefWithCondition" } ], - "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": "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." }, - "condition": { + "order": { "anyOf": [ { - "$ref": "#/definitions/ConditionalColorValueDef" + "$ref": "#/definitions/OrderFieldDef" }, { "items": { - "$ref": "#/definitions/ConditionalColorValueDef" + "$ref": "#/definitions/OrderFieldDef" }, "type": "array" + }, + { + "$ref": "#/definitions/NumberValueDef" } ], - "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." + "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." }, - "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`." + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Vertical facets for trellis plots." }, - "legend": { + "shape": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "$ref": "#/definitions/ShapeFieldDefWithCondition" }, { - "type": "null" + "$ref": "#/definitions/ShapeValueDefWithCondition" } ], - "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." + "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." }, - "scale": { + "size": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "$ref": "#/definitions/NumericFieldDefWithCondition" }, { - "type": "null" + "$ref": "#/definitions/NumericValueDefWithCondition" } ], - "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)" - }, - "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" - }, - "FieldDefWithCondition": { - "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", - "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)" + "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)" }, - "bin": { + "stroke": { "anyOf": [ { - "type": "boolean" - }, - { - "$ref": "#/definitions/BinParams" - }, - { - "enum": [ - "binned" - ], - "type": "string" + "$ref": "#/definitions/ColorFieldDefWithCondition" }, { - "type": "null" + "$ref": "#/definitions/ColorValueDefWithCondition" } ], - "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": "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`)." }, - "condition": { + "strokeOpacity": { "anyOf": [ { - "$ref": "#/definitions/ConditionalNumberValueDef" + "$ref": "#/definitions/NumericFieldDefWithCondition" }, { - "items": { - "$ref": "#/definitions/ConditionalNumberValueDef" - }, - "type": "array" + "$ref": "#/definitions/NumericValueDefWithCondition" } ], - "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`." + "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." }, - "legend": { + "strokeWidth": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "$ref": "#/definitions/NumericFieldDefWithCondition" }, { - "type": "null" + "$ref": "#/definitions/NumericValueDefWithCondition" } ], - "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." + "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." }, - "scale": { + "text": { "anyOf": [ { - "$ref": "#/definitions/Scale" + "$ref": "#/definitions/TextFieldDefWithCondition" }, { - "type": "null" + "$ref": "#/definitions/TextValueDefWithCondition" } ], - "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." + "description": "Text of the `text` mark." }, - "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`." + "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." }, - "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)" + "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\"`." }, - "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" - ] + "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\"`." }, - "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`)" + "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": [ - "type" - ], "type": "object" }, - "FieldDefWithCondition,string>": { + "FacetedUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec", + "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, "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { @@ -4249,8 +4285,11 @@ ] }, "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`)" + "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": [ @@ -4258,7 +4297,7 @@ ], "type": "object" }, - "FieldDefWithCondition": { + "FieldDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { @@ -4289,11 +4328,11 @@ "condition": { "anyOf": [ { - "$ref": "#/definitions/ConditionalTextValueDef" + "$ref": "#/definitions/ConditionalColorValueDef" }, { "items": { - "$ref": "#/definitions/ConditionalTextValueDef" + "$ref": "#/definitions/ConditionalColorValueDef" }, "type": "array" } @@ -4304,9 +4343,31 @@ "$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" + "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", @@ -4329,9 +4390,9 @@ ], "type": "object" }, - "FieldDef": { + "FieldDefWithCondition": { "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", @@ -4357,10 +4418,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`" }, + "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." + }, "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)" @@ -4382,35 +4483,252 @@ ], "type": "object" }, - "FieldEqualPredicate": { + "FieldDefWithCondition,string>": { "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`" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + "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": { - "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`." }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - } - }, + "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)" + }, + "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": [ + "type" + ], + "type": "object" + }, + "FieldDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)" + }, + "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`" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalTextValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalTextValueDef" + }, + "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`." + }, + "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" + }, + "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": [ + { + "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": { + "$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" + }, + "FieldEqualPredicate": { + "additionalProperties": false, + "properties": { + "equal": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "description": "The value that the field should be equal to." + }, + "field": { + "description": "Field to be filtered.", + "type": "string" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, "required": [ "equal", "field" @@ -4859,1366 +5177,10 @@ "$ref": "#/definitions/LayerSpec" }, { - "$ref": "#/definitions/FacetedExtendedUnitSpec" - } - ], - "description": "A specification of the view that gets faceted." - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/TitleParams" + "$ref": "#/definitions/FacetedUnitSpec" } ], - "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/FacetedExtendedUnitSpec" - }, - { - "$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<(BoxPlotEncodingWithFacet),(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<(EncodingWithFacet),(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/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<(ErrorEncoding),(ErrorBand|ErrorBandDef)>": { - "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." - }, - "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": { - "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" - }, - "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" + "description": "A specification of the view that gets faceted." }, "title": { "anyOf": [ @@ -6237,25 +5199,30 @@ "$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" + "facet", + "spec" ], "type": "object" }, - "GenericUnitSpec<(ErrorEncoding),(ErrorBar|ErrorBarDef)>": { + "HConcatSpec": { "additionalProperties": false, - "description": "Base interface for a unit (single-view) specification.", + "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" @@ -6264,175 +5231,24 @@ "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." - }, - "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\"`." - } + "hconcat": { + "description": "A list of views that should be concatenated and put into a row.", + "items": { + "$ref": "#/definitions/Spec" }, - "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/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)." + "type": "array" }, "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." + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for horizontally concatenated charts." }, - "selection": { - "additionalProperties": { - "$ref": "#/definitions/SelectionDef" - }, - "description": "A key-value mapping between selection names and definitions.", - "type": "object" + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" }, "title": { "anyOf": [ @@ -6451,25 +5267,47 @@ "$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" + "hconcat" ], "type": "object" }, - "GenericUnitSpec<(ErrorEncodingWithFacet),(ErrorBand|ErrorBandDef)>": { + "RepeatSpec": { "additionalProperties": false, - "description": "Base interface for a unit (single-view) specification.", + "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" @@ -6478,167 +5316,102 @@ "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." - }, - "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\"`." + "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" }, - "yError": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + { + "$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" }, - "yError2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + { + "$ref": "#/definitions/TitleParams" } - }, - "required": [ - "color", - "detail", - "opacity", - "x", - "x2", - "y", - "y2" ], - "type": "object" + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "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": { + "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": { + "$ref": "#/definitions/Encoding", + "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": { - "anyOf": [ - { - "$ref": "#/definitions/ErrorBand" - }, - { - "$ref": "#/definitions/ErrorBandDef" - } - ], + "$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": { @@ -6688,7 +5461,7 @@ ], "type": "object" }, - "GenericUnitSpec<(ErrorEncodingWithFacet),(ErrorBar|ErrorBarDef)>": { + "GenericUnitSpec": { "additionalProperties": false, "description": "Base interface for a unit (single-view) specification.", "properties": { @@ -6701,166 +5474,15 @@ "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." - }, - "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" + "$ref": "#/definitions/FacetedEncoding", + "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": { - "anyOf": [ - { - "$ref": "#/definitions/ErrorBar" - }, - { - "$ref": "#/definitions/ErrorBarDef" - } - ], + "$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": { @@ -9100,14 +7722,6 @@ ], "type": "string" }, - "NormalizedUnitSpec": { - "$ref": "#/definitions/GenericUnitSpec<(Encoding),(Mark|MarkDef)>", - "description": "A unit specification without any shortcut/expansion syntax." - }, - "NormalizedUnitSpecWithFacet": { - "$ref": "#/definitions/GenericUnitSpec<(EncodingWithFacet),(Mark|MarkDef)>", - "description": "A unit specification without any shortcut/expansion syntax." - }, "NumericFieldDefWithCondition": { "$ref": "#/definitions/FieldDefWithCondition" }, @@ -11636,7 +10250,7 @@ "$ref": "#/definitions/LayerSpec" }, { - "$ref": "#/definitions/ExtendedUnitSpec" + "$ref": "#/definitions/CompositeUnitSpec" } ] }, @@ -11979,774 +10593,52 @@ "description": "Name of the visualization for later reference.", "type": "string" }, - "padding": { - "$ref": "#/definitions/Padding", - "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" - }, - "resolve": { - "$ref": "#/definitions/Resolve", - "description": "Scale, axis, and legend resolutions for vertically 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" - }, - "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" - }, - "vconcat": { - "description": "A list of views that should be concatenated and put into a column.", - "items": { - "$ref": "#/definitions/Spec" - }, - "type": "array" - } - }, - "required": [ - "vconcat" - ], - "type": "object" - }, - "TopLevelCompositeMarkUnitSpec": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "$schema": { - "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/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." - }, - "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": { - "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": { - "description": "Name of the visualization for later reference.", - "type": "string" - }, - "padding": { - "$ref": "#/definitions/Padding", - "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" - }, - "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" - }, - "usermeta": { - "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", - "type": "object" - }, - "view": { - "$ref": "#/definitions/ViewBackground", - "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" - }, - "width": { - "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": [ - "data", - "mark" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "$schema": { - "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/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." - }, - "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": { - "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.", + "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`" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for vertically 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" }, - "padding": { - "$ref": "#/definitions/Padding", - "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" - }, - "projection": { - "$ref": "#/definitions/Projection", - "description": "An object defining properties of 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" - }, - "usermeta": { - "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", - "type": "object" - }, - "view": { - "$ref": "#/definitions/ViewBackground", - "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" - }, - "width": { - "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" + { + "$ref": "#/definitions/TitleParams" } - }, - "required": [ - "data", - "mark" ], - "type": "object" + "description": "Title for the plot." }, - { - "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." - }, - "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" - }, - "padding": { - "$ref": "#/definitions/Padding", - "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" - }, - "projection": { - "$ref": "#/definitions/Projection", - "description": "An object defining properties of 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" - }, - "usermeta": { - "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", - "type": "object" - }, - "view": { - "$ref": "#/definitions/ViewBackground", - "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" - }, - "width": { - "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" - } + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" }, - "required": [ - "data", - "mark" - ], + "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" + }, + "vconcat": { + "description": "A list of views that should be concatenated and put into a column.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" } - ] + }, + "required": [ + "vconcat" + ], + "type": "object" }, "TopLevelFacetSpec": { "additionalProperties": false, @@ -12850,7 +10742,7 @@ "$ref": "#/definitions/LayerSpec" }, { - "$ref": "#/definitions/FacetedExtendedUnitSpec" + "$ref": "#/definitions/FacetedUnitSpec" } ], "description": "A specification of the view that gets faceted." @@ -12885,17 +10777,30 @@ ], "type": "object" }, - "TopLevelFacetedUnitSpec": { + "TopLevelSpec": { "anyOf": [ { - "$ref": "#/definitions/TopLevelNormalizedUnitSpec" + "$ref": "#/definitions/TopLevelUnitSpec" + }, + { + "$ref": "#/definitions/TopLevelFacetSpec" + }, + { + "$ref": "#/definitions/TopLevelLayerSpec" + }, + { + "$ref": "#/definitions/TopLevelRepeatSpec" + }, + { + "$ref": "#/definitions/TopLevelVConcatSpec" }, { - "$ref": "#/definitions/TopLevelCompositeMarkUnitSpec" + "$ref": "#/definitions/TopLevelHConcatSpec" } - ] + ], + "description": "A Vega-Lite top-level specification.\nThis is the root class for all Vega-Lite specifications.\n(The json schema is generated from this type.)" }, - "TopLevelNormalizedUnitSpec": { + "TopLevelUnitSpec": { "additionalProperties": false, "properties": { "$schema": { @@ -12935,269 +10840,15 @@ "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" + "$ref": "#/definitions/FacetedEncoding", + "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": { - "anyOf": [ - { - "$ref": "#/definitions/Mark" - }, - { - "$ref": "#/definitions/MarkDef" - } - ], + "$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": { @@ -13256,29 +10907,6 @@ ], "type": "object" }, - "TopLevelSpec": { - "anyOf": [ - { - "$ref": "#/definitions/TopLevelFacetedUnitSpec" - }, - { - "$ref": "#/definitions/TopLevelFacetSpec" - }, - { - "$ref": "#/definitions/TopLevelLayerSpec" - }, - { - "$ref": "#/definitions/TopLevelRepeatSpec" - }, - { - "$ref": "#/definitions/TopLevelVConcatSpec" - }, - { - "$ref": "#/definitions/TopLevelHConcatSpec" - } - ], - "description": "A Vega-Lite top-level specification.\nThis is the root class for all Vega-Lite specifications.\n(The json schema is generated from this type.)" - }, "TopoDataFormat": { "additionalProperties": false, "properties": { diff --git a/scripts/rename-schema.sh b/scripts/rename-schema.sh index 97862d02295..37ce8afddd1 100755 --- a/scripts/rename-schema.sh +++ b/scripts/rename-schema.sh @@ -1,20 +1,13 @@ #!/usr/bin/env bash -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,'','',g build/vega-lite-schema.json perl -pi -e s,'','',g build/vega-lite-schema.json -perl -pi -e s,'\&FacetMapping','WithFacet',g build/vega-lite-schema.json -perl -pi -e s,'','WithFacet',g build/vega-lite-schema.json - +perl -pi -e s,'CompositeEncoding','Encoding',g build/vega-lite-schema.json perl -pi -e s,'FacetedCompositeUnitSpec','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,'Generic(.*)','\1',g build/vega-lite-schema.json - -perl -pi -e s,'GenericUnitSpec','FacetedCompositeUnitSpecAlias',g build/vega-lite-schema.json -perl -pi -e s,'GenericUnitSpec','CompositeUnitSpecAlias',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,'FieldDefWithoutScale','FieldDef',g build/vega-lite-schema.json diff --git a/src/compositemark/boxplot.ts b/src/compositemark/boxplot.ts index bb62083e912..d8e550a3e17 100644 --- a/src/compositemark/boxplot.ts +++ b/src/compositemark/boxplot.ts @@ -1,7 +1,7 @@ import {isNumber, isObject} from 'vega-util'; import {Config} from '../config'; import {Encoding, extractTransformsFromEncoding} from '../encoding'; -import {Field, PositionFieldDef} from '../fielddef'; +import {PositionFieldDef} from '../fielddef'; import * as log from '../log'; import {isMarkDef, MarkDef} from '../mark'; import {GenericUnitSpec, NormalizedLayerSpec, NormalizedUnitSpec} from '../spec'; @@ -19,10 +19,6 @@ 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; @@ -70,8 +66,6 @@ export type BoxPlotDef = GenericCompositeMarkDef & orient?: Orient; }; -export type BoxPlotEncoding = Pick, 'x' | 'y' | 'color' | 'detail' | 'opacity' | 'size'>; - export interface BoxPlotConfigMixins { /** * Box Config diff --git a/src/compositemark/errorbar.ts b/src/compositemark/errorbar.ts index 479d8e495d4..6205d46e193 100644 --- a/src/compositemark/errorbar.ts +++ b/src/compositemark/errorbar.ts @@ -30,10 +30,6 @@ 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; @@ -49,8 +45,7 @@ const ERRORBAR_PART_INDEX: Flag = { rule: 1 }; -export interface ErrorEncoding - extends Pick, 'x' | 'y' | 'x2' | 'y2' | 'color' | 'detail' | 'opacity'> { +export interface ErrorExtraEncoding { /** * Error value of x coordinates for error specified `"errorbar"` and `"errorband"`. */ @@ -74,6 +69,12 @@ export interface ErrorEncoding yError2?: SecondaryFieldDef | ValueDef; } +export type ErrorEncoding = Pick< + Encoding, + 'x' | 'y' | 'x2' | 'y2' | 'color' | 'detail' | 'opacity' +> & + ErrorExtraEncoding; + export const ERRORBAR_PARTS = keys(ERRORBAR_PART_INDEX); export type ErrorBarPartsMixins = PartsMixins; diff --git a/src/compositemark/index.ts b/src/compositemark/index.ts index 881444020be..2f3a6047083 100644 --- a/src/compositemark/index.ts +++ b/src/compositemark/index.ts @@ -1,23 +1,17 @@ import {Config} from '../config'; +import {Encoding} from '../encoding'; +import {Field} from '../fielddef'; import {AnyMark, isMarkDef} from '../mark'; import {GenericUnitSpec, NormalizedLayerSpec} from '../spec'; +import {FacetMapping} from '../spec/facet'; import {keys} from '../util'; -import { - BOXPLOT, - BoxPlot, - BOXPLOT_PARTS, - BoxPlotConfigMixins, - BoxPlotDef, - BoxPlotUnitSpec, - normalizeBoxPlot -} from './boxplot'; +import {BOXPLOT, BoxPlot, BOXPLOT_PARTS, BoxPlotConfigMixins, BoxPlotDef, normalizeBoxPlot} from './boxplot'; import { ERRORBAND, ErrorBand, ERRORBAND_PARTS, ErrorBandConfigMixins, ErrorBandDef, - ErrorBandUnitSpec, normalizeErrorBand } from './errorband'; import { @@ -26,7 +20,7 @@ import { ERRORBAR_PARTS, ErrorBarConfigMixins, ErrorBarDef, - ErrorBarUnitSpec, + ErrorExtraEncoding, normalizeErrorBar } from './errorbar'; @@ -53,9 +47,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 CompositeEncoding = Encoding & ErrorExtraEncoding; +export type FacetedCompositeEncoding = Encoding & ErrorExtraEncoding & FacetMapping; + export type CompositeMark = BoxPlot | ErrorBar | ErrorBand; export function getAllCompositeMarks() { diff --git a/src/spec/index.ts b/src/spec/index.ts index 2059e63c0cf..1e790ca3092 100644 --- a/src/spec/index.ts +++ b/src/spec/index.ts @@ -17,13 +17,7 @@ import {GenericFacetSpec, isFacetSpec} from './facet'; import {ExtendedLayerSpec, GenericLayerSpec, isLayerSpec, NormalizedLayerSpec} from './layer'; import {GenericRepeatSpec, isRepeatSpec} from './repeat'; import {TopLevel} from './toplevel'; -import { - FacetedExtendedUnitSpec, - GenericUnitSpec, - isUnitSpec, - NormalizedUnitSpec, - TopLevelFacetedUnitSpec -} from './unit'; +import {FacetedCompositeUnitSpec, GenericUnitSpec, isUnitSpec, NormalizedUnitSpec, TopLevelUnitSpec} from './unit'; export {normalizeTopLevelSpec as normalize} from '../normalize'; export {BaseSpec, DataMixins, LayoutSizeMixins} from './base'; @@ -39,7 +33,13 @@ export {GenericFacetSpec, isFacetSpec, NormalizedFacetSpec} from './facet'; export {ExtendedLayerSpec, GenericLayerSpec, isLayerSpec, NormalizedLayerSpec} from './layer'; export {GenericRepeatSpec, isRepeatSpec, NormalizedRepeatSpec} from './repeat'; export {TopLevel} from './toplevel'; -export {ExtendedUnitSpec, FacetedExtendedUnitSpec, GenericUnitSpec, isUnitSpec, NormalizedUnitSpec} from './unit'; +export { + CompositeUnitSpec as ExtendedUnitSpec, + FacetedCompositeUnitSpec as FacetedExtendedUnitSpec, + GenericUnitSpec, + isUnitSpec, + NormalizedUnitSpec +} from './unit'; /** * Any specification in Vega-Lite. @@ -57,7 +57,7 @@ export type GenericSpec, L extends GenericLa */ export type NormalizedSpec = GenericSpec; -export type TopLevelFacetSpec = TopLevel> & DataMixins; +export type TopLevelFacetSpec = TopLevel> & DataMixins; /** * A Vega-Lite top-level specification. @@ -65,12 +65,12 @@ export type TopLevelFacetSpec = TopLevel - | TopLevel> - | TopLevel> - | TopLevel>; + | TopLevel> + | TopLevel> + | TopLevel>; /* Custom type guards */ @@ -126,7 +126,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 99d501cb9a3..ed7f3859d2a 100644 --- a/src/spec/layer.ts +++ b/src/spec/layer.ts @@ -1,9 +1,8 @@ -import {Encoding} from '../encoding'; -import {Field} from '../fielddef'; +import {CompositeEncoding} from '../compositemark/index'; import {Projection} from '../projection'; import {Resolve} from '../resolve'; import {BaseSpec, LayerUnitMixins} from './base'; -import {ExtendedUnitSpec, GenericUnitSpec, NormalizedUnitSpec} from './unit'; +import {CompositeUnitSpec, GenericUnitSpec, NormalizedUnitSpec} from './unit'; /** * Base interface for a layer specification. @@ -25,11 +24,11 @@ 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. */ - encoding?: Encoding; + encoding?: CompositeEncoding; /** * An object defining properties of the geographic projection shared by underlying layers. diff --git a/src/spec/unit.ts b/src/spec/unit.ts index 6129872a8ab..ae0a7d3bd4e 100644 --- a/src/spec/unit.ts +++ b/src/spec/unit.ts @@ -1,14 +1,10 @@ -import {BoxPlotUnitSpec} from '../compositemark/boxplot'; -import {ErrorBandUnitSpec} from '../compositemark/errorband'; -import {ErrorBarUnitSpec} from '../compositemark/errorbar'; -import {CompositeMarkUnitSpec} from '../compositemark/index'; +import {CompositeEncoding, FacetedCompositeEncoding} from '../compositemark/index'; import {Encoding} from '../encoding'; import {Field} from '../fielddef'; -import {Mark, MarkDef} from '../mark'; +import {AnyMark, Mark, MarkDef} from '../mark'; import {Projection} from '../projection'; import {SelectionDef} from '../selection'; import {BaseSpec, DataMixins, LayerUnitMixins} from './base'; -import {FacetMapping} from './facet'; import {TopLevel} from './toplevel'; /** @@ -41,42 +37,20 @@ export interface GenericUnitSpec, M> extends BaseSpec, L /** * A unit specification without any shortcut/expansion syntax. */ -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 */ +export type NormalizedUnitSpec = GenericUnitSpec, Mark | MarkDef>; /** * Unit spec that can be normalized/expanded into a layer spec or another unit spec. */ -export type ExtendedUnitSpec< - /** Extra Encoding */ - EE = EmptyObject -> = NormalizedUnitSpec | CompositeMarkUnitSpec; +export type CompositeUnitSpec = GenericUnitSpec; /** * Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec). */ -export type FacetedExtendedUnitSpec = ExtendedUnitSpec>; - -// Note: The following three declarations are equivalent to: -// ``` -// export type TopLevelFacetedUnitSpec = TopLevel & DataMixins; -// ``` -// However, the JSON schema generator does not support the simpler syntax +export type FacetedCompositeUnitSpec = GenericUnitSpec; -export type TopLevelNormalizedUnitSpec = TopLevel>> & DataMixins; -export type TopLevelCompositeMarkUnitSpec = - | (TopLevel>> & DataMixins) - | (TopLevel>> & DataMixins) - | (TopLevel>> & DataMixins); -export type TopLevelFacetedUnitSpec = TopLevelNormalizedUnitSpec | TopLevelCompositeMarkUnitSpec; +export type TopLevelUnitSpec = TopLevel & DataMixins; -export function isUnitSpec(spec: BaseSpec): spec is FacetedExtendedUnitSpec | NormalizedUnitSpec { +export function isUnitSpec(spec: BaseSpec): spec is FacetedCompositeUnitSpec | NormalizedUnitSpec { return !!spec['mark']; } diff --git a/src/validate.ts b/src/validate.ts index e0b4098d298..675dd5745e3 100644 --- a/src/validate.ts +++ b/src/validate.ts @@ -1,6 +1,6 @@ import {toSet} from 'vega-util'; import {BAR, isMarkDef} from './mark'; -import {FacetedExtendedUnitSpec} from './spec'; +import {FacetedCompositeUnitSpec} from './spec/unit'; // TODO: move to vl.spec.validator? export interface RequiredChannelMap { @@ -56,7 +56,7 @@ export const DEFAULT_SUPPORTED_CHANNEL_TYPE: SupportedChannelMap = { * or null if the encoding is valid. */ export function getEncodingMappingError( - spec: FacetedExtendedUnitSpec, + spec: FacetedCompositeUnitSpec, 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 35bc12ca25e..af912282723 100644 --- a/test/compositemark/errorbar.test.ts +++ b/test/compositemark/errorbar.test.ts @@ -1,12 +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 {ExtendedLayerSpec, GenericSpec, isLayerSpec, isUnitSpec, normalize} from '../../src/spec'; +import {CompositeUnitSpec} from '../../src/spec/unit'; import {isAggregate, isCalculate, Transform} from '../../src/transform'; import {some} from '../../src/util'; @@ -615,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: {