diff --git a/build/vega-lite-schema.json b/build/vega-lite-schema.json index 8d5300dd1ee..8d43ea55149 100644 --- a/build/vega-lite-schema.json +++ b/build/vega-lite-schema.json @@ -85,22 +85,6 @@ ], "type": "string" }, - "AnyMark": { - "anyOf": [ - { - "$ref": "#/definitions/CompositeMark" - }, - { - "$ref": "#/definitions/CompositeMarkDef" - }, - { - "$ref": "#/definitions/Mark" - }, - { - "$ref": "#/definitions/MarkDef" - } - ] - }, "AreaConfig": { "additionalProperties": false, "properties": { @@ -1676,6 +1660,12 @@ ], "type": "object" }, + "BoxPlotUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(BoxPlotEncoding),(BoxPlot|BoxPlotDef)>" + }, + "BoxPlotUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(BoxPlotEncodingWithFacet),(BoxPlot|BoxPlotDef)>" + }, "BrushConfig": { "additionalProperties": false, "properties": { @@ -1740,36 +1730,32 @@ "ColorValueDefWithCondition": { "$ref": "#/definitions/ValueDefWithCondition" }, - "CompositeMark": { + "CompositeMarkUnitSpec": { "anyOf": [ { - "$ref": "#/definitions/BoxPlot" + "$ref": "#/definitions/ErrorBarUnitSpec" }, { - "$ref": "#/definitions/ErrorBar" + "$ref": "#/definitions/ErrorBandUnitSpec" }, { - "$ref": "#/definitions/ErrorBand" + "$ref": "#/definitions/BoxPlotUnitSpec" } ] }, - "CompositeMarkDef": { + "CompositeMarkUnitSpec": { "anyOf": [ { - "$ref": "#/definitions/BoxPlotDef" + "$ref": "#/definitions/ErrorBarUnitSpec" }, { - "$ref": "#/definitions/ErrorBarDef" + "$ref": "#/definitions/ErrorBandUnitSpec" }, { - "$ref": "#/definitions/ErrorBandDef" + "$ref": "#/definitions/BoxPlotUnitSpec" } ] }, - "CompositeUnitSpec": { - "$ref": "#/definitions/CompositeUnitSpecAlias", - "description": "Unit spec that can have a composite mark." - }, "ConditionOnlyDef>": { "additionalProperties": false, "description": "A Condition only definition.\n{\n condition: {field: ...} | {value: ...}\n}", @@ -3424,28 +3410,6 @@ ], "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." }, - "xError": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." - }, - "xError2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." - }, "y": { "anyOf": [ { @@ -3467,28 +3431,6 @@ } ], "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." - }, - "yError": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." - }, - "yError2": { - "anyOf": [ - { - "$ref": "#/definitions/SecondaryFieldDef" - }, - { - "$ref": "#/definitions/NumberValueDef" - } - ], - "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." } }, "type": "object" @@ -3519,402 +3461,703 @@ }, "type": "object" }, - "EncodingWithFacet": { + "ErrorBand": { + "enum": [ + "errorband" + ], + "type": "string" + }, + "ErrorBandConfig": { "additionalProperties": false, "properties": { - "color": { + "band": { "anyOf": [ { - "$ref": "#/definitions/ColorFieldDefWithCondition" + "type": "boolean" }, { - "$ref": "#/definitions/ColorValueDefWithCondition" + "$ref": "#/definitions/MarkConfig" } - ], - "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": { + "borders": { "anyOf": [ { - "$ref": "#/definitions/FieldDef" + "type": "boolean" }, { - "items": { - "$ref": "#/definitions/FieldDef" - }, - "type": "array" + "$ref": "#/definitions/MarkConfig" } - ], - "description": "Additional levels of detail for grouping data in aggregate views and\nin line, trail, and area marks without mapping data to a specific visual channel." + ] }, - "fill": { - "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`)." + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, - "fillOpacity": { + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "tension": { + "description": "The tension parameter for the interpolation type of the error band.", + "maximum": 1, + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ErrorBandDef": { + "additionalProperties": false, + "properties": { + "band": { "anyOf": [ { - "$ref": "#/definitions/NumericFieldDefWithCondition" + "type": "boolean" }, { - "$ref": "#/definitions/NumericValueDefWithCondition" + "$ref": "#/definitions/MarkConfig" } - ], - "description": "Fill opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `fillOpacity` property." + ] }, - "href": { + "borders": { "anyOf": [ { - "$ref": "#/definitions/StringFieldDefWithCondition" + "type": "boolean" }, { - "$ref": "#/definitions/StringValueDefWithCondition" + "$ref": "#/definitions/MarkConfig" } - ], - "description": "A URL to load upon mouse click." - }, - "key": { - "$ref": "#/definitions/FieldDef", - "description": "A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data." + ] }, - "latitude": { - "$ref": "#/definitions/LatLongFieldDef", - "description": "Latitude position of geographically projected marks." + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" }, - "latitude2": { - "$ref": "#/definitions/SecondaryFieldDef", - "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + "color": { + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "string" }, - "longitude": { - "$ref": "#/definitions/LatLongFieldDef", - "description": "Longitude position of geographically projected marks." + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, - "longitude2": { - "$ref": "#/definitions/SecondaryFieldDef", - "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orient", + "description": "Orientation of the error band. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." + }, + "tension": { + "description": "The tension parameter for the interpolation type of the error band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "type": { + "$ref": "#/definitions/ErrorBand", + "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ErrorBandUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(ErrorEncoding),(ErrorBand|ErrorBandDef)>" + }, + "ErrorBandUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(ErrorEncodingWithFacet),(ErrorBand|ErrorBandDef)>" + }, + "ErrorBar": { + "enum": [ + "errorbar" + ], + "type": "string" + }, + "ErrorBarConfig": { + "additionalProperties": false, + "properties": { + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "rule": { "anyOf": [ { - "$ref": "#/definitions/NumericFieldDefWithCondition" + "type": "boolean" }, { - "$ref": "#/definitions/NumericValueDefWithCondition" + "$ref": "#/definitions/MarkConfig" } - ], - "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": { + "ticks": { "anyOf": [ { - "$ref": "#/definitions/OrderFieldDef" - }, - { - "items": { - "$ref": "#/definitions/OrderFieldDef" - }, - "type": "array" + "type": "boolean" }, { - "$ref": "#/definitions/NumberValueDef" + "$ref": "#/definitions/MarkConfig" } - ], - "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." + ] + } + }, + "type": "object" + }, + "ErrorBarDef": { + "additionalProperties": false, + "properties": { + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" }, - "row": { - "$ref": "#/definitions/FacetFieldDef", - "description": "Vertical facets for trellis plots." + "color": { + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "string" }, - "shape": { + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orient", + "description": "Orientation of the error bar. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." + }, + "rule": { "anyOf": [ { - "$ref": "#/definitions/ShapeFieldDefWithCondition" + "type": "boolean" }, { - "$ref": "#/definitions/ShapeValueDefWithCondition" + "$ref": "#/definitions/MarkConfig" } - ], - "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": { + "ticks": { "anyOf": [ { - "$ref": "#/definitions/NumericFieldDefWithCondition" + "type": "boolean" }, { - "$ref": "#/definitions/NumericValueDefWithCondition" + "$ref": "#/definitions/MarkConfig" } - ], - "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": { + "type": { + "$ref": "#/definitions/ErrorBar", + "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ErrorBarExtent": { + "enum": [ + "ci", + "iqr", + "stderr", + "stdev" + ], + "type": "string" + }, + "ErrorBarUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(ErrorEncoding),(ErrorBar|ErrorBarDef)>" + }, + "ErrorBarUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(ErrorEncodingWithFacet),(ErrorBar|ErrorBarDef)>" + }, + "EventStream": { + }, + "LayerSpec": { + "additionalProperties": false, + "description": "Layer Spec with `encoding` and `projection` shorthands that will be applied to underlying unit (single-view) specifications.", + "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 shared key-value mapping between encoding channels and definition of fields in the underlying layers." + }, + "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" + }, + "layer": { + "description": "Layer or single view specifications to be layered.\n\n__Note__: Specifications inside `layer` cannot use `row` and `column` channels as layering facet specifications is not allowed. Instead, use the [facet operator](https://vega.github.io/vega-lite/docs/facet.html) and place a layer inside a facet.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/ExtendedUnitSpec" + } + ] + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of the geographic projection shared by underlying layers." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for layers." + }, + "title": { "anyOf": [ { - "$ref": "#/definitions/ColorFieldDefWithCondition" + "type": "string" }, { - "$ref": "#/definitions/ColorValueDefWithCondition" + "$ref": "#/definitions/TitleParams" } ], - "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`)." + "description": "Title for the plot." }, - "strokeOpacity": { + "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": [ + "layer" + ], + "type": "object" + }, + "ExtendedUnitSpec": { + "anyOf": [ + { + "$ref": "#/definitions/NormalizedUnitSpec" + }, + { + "$ref": "#/definitions/CompositeMarkUnitSpec" + } + ], + "description": "Unit spec that can be normalized/expanded into a layer spec or another unit spec." + }, + "ExtendedUnitSpec": { + "anyOf": [ + { + "$ref": "#/definitions/NormalizedUnitSpec" + }, + { + "$ref": "#/definitions/CompositeMarkUnitSpec" + } + ], + "description": "Unit spec that can be normalized/expanded into a layer spec or another unit spec." + }, + "FacetFieldDef": { + "additionalProperties": false, + "properties": { + "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": [ { - "$ref": "#/definitions/NumericFieldDefWithCondition" + "type": "boolean" }, { - "$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/BinParams" + }, { - "$ref": "#/definitions/NumericFieldDefWithCondition" + "enum": [ + "binned" + ], + "type": "string" }, { - "$ref": "#/definitions/NumericValueDefWithCondition" + "type": "null" } ], - "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." + "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`" }, - "text": { + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "header": { + "$ref": "#/definitions/Header", + "description": "An object defining properties of a facet's header." + }, + "sort": { "anyOf": [ { - "$ref": "#/definitions/TextFieldDefWithCondition" + "$ref": "#/definitions/SortArray" }, { - "$ref": "#/definitions/TextValueDefWithCondition" + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "type": "null" } ], - "description": "Text of the `text` mark." + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." }, - "tooltip": { + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)" + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/Type", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n__Note:__ Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`)" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "FacetMapping": { + "additionalProperties": false, + "properties": { + "column": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Horizontal facets for trellis plots." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Vertical facets for trellis plots." + } + }, + "type": "object" + }, + "FacetedExtendedUnitSpec": { + "$ref": "#/definitions/ExtendedUnitSpec", + "description": "Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec)." + }, + "Field": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ] + }, + "FieldDefWithCondition,string>": { + "additionalProperties": false, + "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": [ { - "$ref": "#/definitions/TextFieldDefWithCondition" + "type": "boolean" }, { - "$ref": "#/definitions/TextValueDefWithCondition" + "$ref": "#/definitions/BinParams" }, { - "items": { - "$ref": "#/definitions/TextFieldDef" - }, - "type": "array" + "enum": [ + "binned" + ], + "type": "string" }, { "type": "null" } ], - "description": "The tooltip text to show upon mouse hover." + "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`" }, - "x": { + "condition": { "anyOf": [ { - "$ref": "#/definitions/PositionFieldDef" + "$ref": "#/definitions/ConditionalStringValueDef" }, { - "$ref": "#/definitions/XValueDef" + "items": { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + "type": "array" } ], - "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\"`." + "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." }, - "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\"`." + "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`." }, - "xError": { + "legend": { "anyOf": [ { - "$ref": "#/definitions/SecondaryFieldDef" + "$ref": "#/definitions/Legend" }, { - "$ref": "#/definitions/NumberValueDef" + "type": "null" } ], - "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + "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." }, - "xError2": { + "scale": { "anyOf": [ { - "$ref": "#/definitions/SecondaryFieldDef" + "$ref": "#/definitions/Scale" }, { - "$ref": "#/definitions/NumberValueDef" + "type": "null" } ], - "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + "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." }, - "y": { + "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": { + "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)" + }, + "bin": { "anyOf": [ { - "$ref": "#/definitions/PositionFieldDef" + "type": "boolean" }, { - "$ref": "#/definitions/YValueDef" + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "binned" + ], + "type": "string" + }, + { + "type": "null" } ], - "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\"`." + "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`" }, - "y2": { + "condition": { "anyOf": [ { - "$ref": "#/definitions/SecondaryFieldDef" + "$ref": "#/definitions/ConditionalColorValueDef" }, { - "$ref": "#/definitions/YValueDef" + "items": { + "$ref": "#/definitions/ConditionalColorValueDef" + }, + "type": "array" } ], - "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + "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`." }, - "yError": { + "legend": { "anyOf": [ { - "$ref": "#/definitions/SecondaryFieldDef" + "$ref": "#/definitions/Legend" }, { - "$ref": "#/definitions/NumberValueDef" + "type": "null" } ], - "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + "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." }, - "yError2": { + "scale": { "anyOf": [ { - "$ref": "#/definitions/SecondaryFieldDef" + "$ref": "#/definitions/Scale" }, { - "$ref": "#/definitions/NumberValueDef" + "type": "null" } ], - "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + "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`)" } }, - "type": "object" - }, - "ErrorBand": { - "enum": [ - "errorband" + "required": [ + "type" ], - "type": "string" + "type": "object" }, - "ErrorBandConfig": { + "FieldDefWithCondition": { "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "band": { + "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/MarkConfig" + "$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`" }, - "borders": { + "condition": { "anyOf": [ { - "type": "boolean" + "$ref": "#/definitions/ConditionalNumberValueDef" }, { - "$ref": "#/definitions/MarkConfig" + "items": { + "$ref": "#/definitions/ConditionalNumberValueDef" + }, + "type": "array" } - ] - }, - "extent": { - "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + ], + "description": "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." }, - "interpolate": { - "$ref": "#/definitions/Interpolate", - "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + "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`." }, - "tension": { - "description": "The tension parameter for the interpolation type of the error band.", - "maximum": 1, - "minimum": 0, - "type": "number" - } - }, - "type": "object" - }, - "ErrorBandDef": { - "additionalProperties": false, - "properties": { - "band": { + "legend": { "anyOf": [ { - "type": "boolean" + "$ref": "#/definitions/Legend" }, { - "$ref": "#/definitions/MarkConfig" + "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." }, - "borders": { + "scale": { "anyOf": [ { - "type": "boolean" + "$ref": "#/definitions/Scale" }, { - "$ref": "#/definitions/MarkConfig" + "type": "null" } - ] - }, - "clip": { - "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", - "type": "boolean" - }, - "color": { - "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", - "type": "string" - }, - "extent": { - "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." - }, - "interpolate": { - "$ref": "#/definitions/Interpolate", - "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + ], + "description": "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." }, - "opacity": { - "description": "The opacity (value between [0,1]) of the mark.", - "type": "number" + "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`." }, - "orient": { - "$ref": "#/definitions/Orient", - "description": "Orientation of the error band. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." + "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)" }, - "tension": { - "description": "The tension parameter for the interpolation type of the error band.", - "maximum": 1, - "minimum": 0, - "type": "number" + "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/ErrorBand", - "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + "$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": [ @@ -3922,186 +4165,102 @@ ], "type": "object" }, - "ErrorBar": { - "enum": [ - "errorbar" - ], - "type": "string" - }, - "ErrorBarConfig": { + "FieldDefWithCondition,string>": { "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "extent": { - "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + "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)" }, - "rule": { + "bin": { "anyOf": [ { "type": "boolean" }, { - "$ref": "#/definitions/MarkConfig" - } - ] - }, - "ticks": { - "anyOf": [ + "$ref": "#/definitions/BinParams" + }, { - "type": "boolean" + "enum": [ + "binned" + ], + "type": "string" }, { - "$ref": "#/definitions/MarkConfig" + "type": "null" } - ] - } - }, - "type": "object" - }, - "ErrorBarDef": { - "additionalProperties": false, - "properties": { - "clip": { - "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", - "type": "boolean" - }, - "color": { - "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", - "type": "string" - }, - "extent": { - "$ref": "#/definitions/ErrorBarExtent", - "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." - }, - "opacity": { - "description": "The opacity (value between [0,1]) of the mark.", - "type": "number" - }, - "orient": { - "$ref": "#/definitions/Orient", - "description": "Orientation of the error bar. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." + ], + "description": "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`" }, - "rule": { + "condition": { "anyOf": [ { - "type": "boolean" + "$ref": "#/definitions/ConditionalStringValueDef" }, { - "$ref": "#/definitions/MarkConfig" + "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." }, - "ticks": { + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`." + }, + "legend": { "anyOf": [ { - "type": "boolean" + "$ref": "#/definitions/Legend" }, { - "$ref": "#/definitions/MarkConfig" + "type": "null" } - ] - }, - "type": { - "$ref": "#/definitions/ErrorBar", - "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." - } - }, - "required": [ - "type" - ], - "type": "object" - }, - "ErrorBarExtent": { - "enum": [ - "ci", - "iqr", - "stderr", - "stdev" - ], - "type": "string" - }, - "EventStream": { - }, - "LayerSpec": { - "additionalProperties": false, - "description": "Layer Spec with `encoding` and `projection` shorthands that will be applied to underlying unit (single-view) specifications.", - "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 shared key-value mapping between encoding channels and definition of fields in the underlying layers." - }, - "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" - }, - "layer": { - "description": "Layer or single view specifications to be layered.\n\n__Note__: Specifications inside `layer` cannot use `row` and `column` channels as layering facet specifications is not allowed. Instead, use the [facet operator](https://vega.github.io/vega-lite/docs/facet.html) and place a layer inside a facet.", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/LayerSpec" - }, - { - "$ref": "#/definitions/CompositeUnitSpec" - } - ] - }, - "type": "array" - }, - "name": { - "description": "Name of the visualization for later reference.", - "type": "string" - }, - "projection": { - "$ref": "#/definitions/Projection", - "description": "An object defining properties of the geographic projection shared by underlying layers." - }, - "resolve": { - "$ref": "#/definitions/Resolve", - "description": "Scale, axis, and legend resolutions for layers." + ], + "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." }, - "title": { + "scale": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/Scale" }, { - "$ref": "#/definitions/TitleParams" + "type": "null" } ], - "description": "Title for the plot." + "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." }, - "transform": { - "description": "An array of data transformations such as filter and new field calculation.", - "items": { - "$ref": "#/definitions/Transform" - }, - "type": "array" + "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`." }, - "view": { - "$ref": "#/definitions/ViewBackground", - "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + "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)" }, - "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" + "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": [ - "layer" + "type" ], "type": "object" }, - "FacetFieldDef": { + "FieldDefWithCondition": { "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", @@ -4127,30 +4286,27 @@ ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- To indicate that the data for the `x` (or `y`) channel are already binned, you can set the `bin` property of the `x` (or `y`) channel to `\"binned\"` and map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`" }, - "field": { - "$ref": "#/definitions/Field", - "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__Note:__ Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n\n__Note:__ `field` is not required if `aggregate` is `count`." - }, - "header": { - "$ref": "#/definitions/Header", - "description": "An object defining properties of a facet's header." - }, - "sort": { + "condition": { "anyOf": [ { - "$ref": "#/definitions/SortArray" - }, - { - "$ref": "#/definitions/SortOrder" - }, - { - "$ref": "#/definitions/EncodingSortField" + "$ref": "#/definitions/ConditionalTextValueDef" }, { - "type": "null" + "items": { + "$ref": "#/definitions/ConditionalTextValueDef" + }, + "type": "array" } ], - "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + "description": "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", @@ -4164,7 +4320,7 @@ ] }, "type": { - "$ref": "#/definitions/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`)" } }, @@ -4173,37 +4329,9 @@ ], "type": "object" }, - "FacetMapping": { - "additionalProperties": false, - "properties": { - "column": { - "$ref": "#/definitions/FacetFieldDef", - "description": "Horizontal facets for trellis plots." - }, - "row": { - "$ref": "#/definitions/FacetFieldDef", - "description": "Vertical facets for trellis plots." - } - }, - "type": "object" - }, - "FacetedUnitSpec": { - "$ref": "#/definitions/FacetedCompositeUnitSpecAlias", - "description": "Unit spec that can have a composite mark and row or column channels." - }, - "Field": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/definitions/RepeatRef" - } - ] - }, - "FieldDefWithCondition,string>": { + "FieldDef": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", + "description": "Field Def without scale (and without bin: \"binned\" support).", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", @@ -4229,50 +4357,10 @@ ], "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": { "$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)" @@ -4285,11 +4373,8 @@ ] }, "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" + "$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": [ @@ -4297,429 +4382,256 @@ ], "type": "object" }, - "FieldDefWithCondition": { + "FieldEqualPredicate": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)" - }, - "bin": { + "equal": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { - "$ref": "#/definitions/BinParams" + "type": "number" }, { - "enum": [ - "binned" - ], - "type": "string" + "type": "boolean" }, { - "type": "null" + "$ref": "#/definitions/DateTime" } ], - "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": "The value that the field should be equal to." }, - "condition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalColorValueDef" - }, - { - "items": { - "$ref": "#/definitions/ConditionalColorValueDef" - }, - "type": "array" - } - ], - "description": "One or more value definition(s) with a selection predicate.\n\n__Note:__ A field definition's `condition` property can only contain [value definitions](https://vega.github.io/vega-lite/docs/encoding.html#value-def)\nsince Vega-Lite only allows at most one encoded field per encoding channel." + "field": { + "description": "Field to be filtered.", + "type": "string" }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "equal", + "field" + ], + "type": "object" + }, + "FieldGTEPredicate": { + "additionalProperties": false, + "properties": { "field": { - "$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": "Field to be filtered.", + "type": "string" }, - "legend": { + "gte": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "type": "string" }, { - "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": "number" }, { - "type": "null" + "$ref": "#/definitions/DateTime" } ], - "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": "The value that the field should be greater than or equals to." }, "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`)" + "description": "Time unit for the field to be filtered." } }, "required": [ - "type" + "field", + "gte" ], "type": "object" }, - "FieldDefWithCondition": { + "FieldGTPredicate": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)" + "field": { + "description": "Field to be filtered.", + "type": "string" }, - "bin": { + "gt": { "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/ConditionalNumberValueDef" + "type": "number" }, { - "items": { - "$ref": "#/definitions/ConditionalNumberValueDef" - }, - "type": "array" + "$ref": "#/definitions/DateTime" } ], - "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": "The value that the field should be greater than." }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "gt" + ], + "type": "object" + }, + "FieldLTEPredicate": { + "additionalProperties": false, + "properties": { "field": { - "$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": "Field to be filtered.", + "type": "string" }, - "legend": { + "lte": { "anyOf": [ { - "$ref": "#/definitions/Legend" + "type": "string" }, { - "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": "number" }, { - "type": "null" + "$ref": "#/definitions/DateTime" } ], - "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": "The value that the field should be less than or equals to." }, "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`)" + "description": "Time unit for the field to be filtered." } }, "required": [ - "type" + "field", + "lte" ], "type": "object" }, - "FieldDefWithCondition,string>": { + "FieldLTPredicate": { "additionalProperties": false, - "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", "properties": { - "aggregate": { - "$ref": "#/definitions/Aggregate", - "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)" + "field": { + "description": "Field to be filtered.", + "type": "string" }, - "bin": { + "lt": { "anyOf": [ { - "type": "boolean" - }, - { - "$ref": "#/definitions/BinParams" + "type": "string" }, { - "enum": [ - "binned" - ], - "type": "string" + "type": "number" }, { - "type": "null" + "$ref": "#/definitions/DateTime" } ], - "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": { - "$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`." + "description": "The value that the field should be less than." }, "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`)" + "description": "Time unit for the field to be filtered." } }, "required": [ - "type" + "field", + "lt" ], "type": "object" }, - "FieldDefWithCondition": { + "FieldOneOfPredicate": { "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)" + "field": { + "description": "Field to be filtered.", + "type": "string" }, - "bin": { + "oneOf": { "anyOf": [ { - "type": "boolean" - }, - { - "$ref": "#/definitions/BinParams" + "items": { + "type": "string" + }, + "type": "array" }, { - "enum": [ - "binned" - ], - "type": "string" + "items": { + "type": "number" + }, + "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`" - }, - "condition": { - "anyOf": [ - { - "$ref": "#/definitions/ConditionalTextValueDef" + "items": { + "type": "boolean" + }, + "type": "array" }, { "items": { - "$ref": "#/definitions/ConditionalTextValueDef" + "$ref": "#/definitions/DateTime" }, "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" + "description": "A set of values that the `field`'s value should be a member of,\nfor a data item included in the filtered data." }, "timeUnit": { "$ref": "#/definitions/TimeUnit", - "description": "Time unit (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`)" + "description": "Time unit for the field to be filtered." } }, "required": [ - "type" + "field", + "oneOf" ], "type": "object" }, - "FieldDef": { + "FieldRangePredicate": { "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`." + "description": "Field to be filtered.", + "type": "string" + }, + "range": { + "description": "An array of inclusive minimum and maximum values\nfor a field value of a data item to be included in the filtered data.", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "type": "null" + } + ] + }, + "maxItems": 2, + "minItems": 2, + "type": "array" }, "timeUnit": { "$ref": "#/definitions/TimeUnit", - "description": "Time unit (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`)" + "description": "Time unit for the field to be filtered." } }, "required": [ - "type" + "field", + "range" ], "type": "object" }, - "FieldEqualPredicate": { + "FieldValidPredicate": { "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" @@ -4727,270 +4639,40 @@ "timeUnit": { "$ref": "#/definitions/TimeUnit", "description": "Time unit for the field to be filtered." + }, + "valid": { + "description": "If set to true the field's value has to be valid, meaning both not `null` and not [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN).", + "type": "boolean" } }, "required": [ - "equal", - "field" + "field", + "valid" ], "type": "object" }, - "FieldGTEPredicate": { + "FilterTransform": { "additionalProperties": false, "properties": { - "field": { - "description": "Field to be filtered.", - "type": "string" - }, - "gte": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "$ref": "#/definitions/DateTime" - } - ], - "description": "The value that the field should be greater than or equals to." - }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." + "filter": { + "$ref": "#/definitions/LogicalOperand", + "description": "The `filter` property must be one of the predicate definitions:\n\n1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string,\nwhere `datum` can be used to refer to the current data object\n\n2) one of the field predicates: [`equal`](https://vega.github.io/vega-lite/docs/filter.html#equal-predicate),\n[`lt`](https://vega.github.io/vega-lite/docs/filter.html#lt-predicate),\n[`lte`](https://vega.github.io/vega-lite/docs/filter.html#lte-predicate),\n[`gt`](https://vega.github.io/vega-lite/docs/filter.html#gt-predicate),\n[`gte`](https://vega.github.io/vega-lite/docs/filter.html#gte-predicate),\n[`range`](https://vega.github.io/vega-lite/docs/filter.html#range-predicate),\n[`oneOf`](https://vega.github.io/vega-lite/docs/filter.html#one-of-predicate),\nor [`valid`](https://vega.github.io/vega-lite/docs/filter.html#valid-predicate),\n\n3) a [selection predicate](https://vega.github.io/vega-lite/docs/filter.html#selection-predicate)\n\n4) a logical operand that combines (1), (2), or (3)." } }, "required": [ - "field", - "gte" + "filter" ], "type": "object" }, - "FieldGTPredicate": { + "FlattenTransform": { "additionalProperties": false, "properties": { - "field": { - "description": "Field to be filtered.", - "type": "string" - }, - "gt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "$ref": "#/definitions/DateTime" - } - ], - "description": "The value that the field should be greater than." - }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - } - }, - "required": [ - "field", - "gt" - ], - "type": "object" - }, - "FieldLTEPredicate": { - "additionalProperties": false, - "properties": { - "field": { - "description": "Field to be filtered.", - "type": "string" - }, - "lte": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "$ref": "#/definitions/DateTime" - } - ], - "description": "The value that the field should be less than or equals to." - }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - } - }, - "required": [ - "field", - "lte" - ], - "type": "object" - }, - "FieldLTPredicate": { - "additionalProperties": false, - "properties": { - "field": { - "description": "Field to be filtered.", - "type": "string" - }, - "lt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "$ref": "#/definitions/DateTime" - } - ], - "description": "The value that the field should be less than." - }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - } - }, - "required": [ - "field", - "lt" - ], - "type": "object" - }, - "FieldOneOfPredicate": { - "additionalProperties": false, - "properties": { - "field": { - "description": "Field to be filtered.", - "type": "string" - }, - "oneOf": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "items": { - "type": "number" - }, - "type": "array" - }, - { - "items": { - "type": "boolean" - }, - "type": "array" - }, - { - "items": { - "$ref": "#/definitions/DateTime" - }, - "type": "array" - } - ], - "description": "A set of values that the `field`'s value should be a member of,\nfor a data item included in the filtered data." - }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - } - }, - "required": [ - "field", - "oneOf" - ], - "type": "object" - }, - "FieldRangePredicate": { - "additionalProperties": false, - "properties": { - "field": { - "description": "Field to be filtered.", - "type": "string" - }, - "range": { - "description": "An array of inclusive minimum and maximum values\nfor a field value of a data item to be included in the filtered data.", - "items": { - "anyOf": [ - { - "type": "number" - }, - { - "$ref": "#/definitions/DateTime" - }, - { - "type": "null" - } - ] - }, - "maxItems": 2, - "minItems": 2, - "type": "array" - }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - } - }, - "required": [ - "field", - "range" - ], - "type": "object" - }, - "FieldValidPredicate": { - "additionalProperties": false, - "properties": { - "field": { - "description": "Field to be filtered.", - "type": "string" - }, - "timeUnit": { - "$ref": "#/definitions/TimeUnit", - "description": "Time unit for the field to be filtered." - }, - "valid": { - "description": "If set to true the field's value has to be valid, meaning both not `null` and not [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN).", - "type": "boolean" - } - }, - "required": [ - "field", - "valid" - ], - "type": "object" - }, - "FilterTransform": { - "additionalProperties": false, - "properties": { - "filter": { - "$ref": "#/definitions/LogicalOperand", - "description": "The `filter` property must be one of the predicate definitions:\n\n1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string,\nwhere `datum` can be used to refer to the current data object\n\n2) one of the field predicates: [`equal`](https://vega.github.io/vega-lite/docs/filter.html#equal-predicate),\n[`lt`](https://vega.github.io/vega-lite/docs/filter.html#lt-predicate),\n[`lte`](https://vega.github.io/vega-lite/docs/filter.html#lte-predicate),\n[`gt`](https://vega.github.io/vega-lite/docs/filter.html#gt-predicate),\n[`gte`](https://vega.github.io/vega-lite/docs/filter.html#gte-predicate),\n[`range`](https://vega.github.io/vega-lite/docs/filter.html#range-predicate),\n[`oneOf`](https://vega.github.io/vega-lite/docs/filter.html#one-of-predicate),\nor [`valid`](https://vega.github.io/vega-lite/docs/filter.html#valid-predicate),\n\n3) a [selection predicate](https://vega.github.io/vega-lite/docs/filter.html#selection-predicate)\n\n4) a logical operand that combines (1), (2), or (3)." - } - }, - "required": [ - "filter" - ], - "type": "object" - }, - "FlattenTransform": { - "additionalProperties": false, - "properties": { - "as": { - "description": "The output field names for extracted array values.\n\n__Default value:__ The field name of the corresponding array field", - "items": { - "type": "string" - }, - "type": "array" + "as": { + "description": "The output field names for extracted array values.\n\n__Default value:__ The field name of the corresponding array field", + "items": { + "type": "string" + }, + "type": "array" }, "flatten": { "description": "An array of one or more data fields containing arrays to flatten.\nIf multiple fields are specified, their array values should have a parallel structure, ideally with the same length.\nIf the lengths of parallel arrays do not match,\nthe longest array will be used with `null` values added for missing entries.", @@ -5165,22 +4847,1378 @@ { "type": "number" }, - { - "$ref": "#/definitions/RowCol" + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent spacing values for rows and columns.\n\n__Default value__: `10`" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/FacetedExtendedUnitSpec" + } + ], + "description": "A specification of the view that gets faceted." + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "facet", + "spec" + ], + "type": "object" + }, + "HConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a horizontal concatenation specification.", + "properties": { + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "hconcat": { + "description": "A list of views that should be concatenated and put into a row.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for horizontally concatenated charts." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "hconcat" + ], + "type": "object" + }, + "RepeatSpec": { + "additionalProperties": false, + "description": "Base interface for a repeat specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\nThe supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "description": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "repeat": { + "$ref": "#/definitions/Repeat", + "description": "An object that describes what fields should be repeated into views that are laid out as a `row` or `column`." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale and legend resolutions for repeated charts." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent spacing values for rows and columns.\n\n__Default value__: `10`" + }, + "spec": { + "$ref": "#/definitions/Spec" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + }, + "Spec": { + "anyOf": [ + { + "$ref": "#/definitions/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" ], - "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`" + "type": "object" }, - "spec": { + "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/LayerSpec" + "$ref": "#/definitions/ErrorBand" }, { - "$ref": "#/definitions/FacetedUnitSpec" + "$ref": "#/definitions/ErrorBandDef" } ], - "description": "A specification of the view that gets faceted." + "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": [ @@ -5199,30 +6237,25 @@ "$ref": "#/definitions/Transform" }, "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" } }, "required": [ - "facet", - "spec" + "mark" ], "type": "object" }, - "HConcatSpec": { + "GenericUnitSpec<(ErrorEncoding),(ErrorBar|ErrorBarDef)>": { "additionalProperties": false, - "description": "Base interface for a horizontal concatenation specification.", + "description": "Base interface for a unit (single-view) specification.", "properties": { - "bounds": { - "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", - "enum": [ - "full", - "flush" - ], - "type": "string" - }, - "center": { - "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", - "type": "boolean" - }, "data": { "$ref": "#/definitions/Data", "description": "An object describing the data source" @@ -5231,116 +6264,175 @@ "description": "Description of this mark for commenting purpose.", "type": "string" }, - "hconcat": { - "description": "A list of views that should be concatenated and put into a row.", - "items": { - "$ref": "#/definitions/Spec" - }, - "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" + "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)." }, - { - "$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" + "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." }, - { - "$ref": "#/definitions/RowCol" + "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" ], - "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\"`." + "type": "object" }, - "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" + "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" }, - "center": { + "mark": { "anyOf": [ { - "type": "boolean" + "$ref": "#/definitions/ErrorBar" }, { - "$ref": "#/definitions/RowCol" + "$ref": "#/definitions/ErrorBarDef" } ], - "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" + "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" }, - "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`" + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks\nand to `latitude` and `\"longitude\"` channels for other marks." }, - "spec": { - "$ref": "#/definitions/Spec" + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" }, "title": { "anyOf": [ @@ -5359,38 +6451,22 @@ "$ref": "#/definitions/Transform" }, "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" } }, "required": [ - "repeat", - "spec" + "mark" ], "type": "object" }, - "Spec": { - "anyOf": [ - { - "$ref": "#/definitions/FacetedUnitSpec" - }, - { - "$ref": "#/definitions/LayerSpec" - }, - { - "$ref": "#/definitions/FacetSpec" - }, - { - "$ref": "#/definitions/RepeatSpec" - }, - { - "$ref": "#/definitions/VConcatSpec" - }, - { - "$ref": "#/definitions/HConcatSpec" - } - ], - "description": "Any specification in Vega-Lite." - }, - "CompositeUnitSpecAlias": { + "GenericUnitSpec<(ErrorEncodingWithFacet),(ErrorBand|ErrorBandDef)>": { "additionalProperties": false, "description": "Base interface for a unit (single-view) specification.", "properties": { @@ -5403,15 +6479,166 @@ "type": "string" }, "encoding": { - "$ref": "#/definitions/Encoding", - "description": "A key-value mapping between encoding channels and definition of fields." + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"trail\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.\n\n_Note:_\n1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\n2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "column": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Horizontal facets for trellis plots." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "type": "array" + } + ], + "description": "Additional levels of detail for grouping data in aggregate views and\nin line, trail, and area marks without mapping data to a specific visual channel." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `opacity` property." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Vertical facets for trellis plots." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } + }, + "required": [ + "color", + "detail", + "opacity", + "x", + "x2", + "y", + "y2" + ], + "type": "object" }, "height": { "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", "type": "number" }, "mark": { - "$ref": "#/definitions/AnyMark", + "anyOf": [ + { + "$ref": "#/definitions/ErrorBand" + }, + { + "$ref": "#/definitions/ErrorBandDef" + } + ], "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." }, "name": { @@ -5461,7 +6688,7 @@ ], "type": "object" }, - "FacetedCompositeUnitSpecAlias": { + "GenericUnitSpec<(ErrorEncodingWithFacet),(ErrorBar|ErrorBarDef)>": { "additionalProperties": false, "description": "Base interface for a unit (single-view) specification.", "properties": { @@ -5474,15 +6701,166 @@ "type": "string" }, "encoding": { - "$ref": "#/definitions/EncodingWithFacet", - "description": "A key-value mapping between encoding channels and definition of fields." + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"trail\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.\n\n_Note:_\n1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\n2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "column": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Horizontal facets for trellis plots." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "type": "array" + } + ], + "description": "Additional levels of detail for grouping data in aggregate views and\nin line, trail, and area marks without mapping data to a specific visual channel." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `opacity` property." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Vertical facets for trellis plots." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"`." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"`." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } + }, + "required": [ + "color", + "detail", + "opacity", + "x", + "x2", + "y", + "y2" + ], + "type": "object" }, "height": { "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", "type": "number" }, "mark": { - "$ref": "#/definitions/AnyMark", + "anyOf": [ + { + "$ref": "#/definitions/ErrorBar" + }, + { + "$ref": "#/definitions/ErrorBarDef" + } + ], "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." }, "name": { @@ -7722,6 +9100,14 @@ ], "type": "string" }, + "NormalizedUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(Encoding),(Mark|MarkDef)>", + "description": "A unit specification without any shortcut/expansion syntax." + }, + "NormalizedUnitSpec": { + "$ref": "#/definitions/GenericUnitSpec<(EncodingWithFacet),(Mark|MarkDef)>", + "description": "A unit specification without any shortcut/expansion syntax." + }, "NumericFieldDefWithCondition": { "$ref": "#/definitions/FieldDefWithCondition" }, @@ -9236,10 +10622,6 @@ "y", "x2", "y2", - "xError", - "yError", - "xError2", - "yError2", "longitude", "latitude", "longitude2", @@ -10254,7 +11636,7 @@ "$ref": "#/definitions/LayerSpec" }, { - "$ref": "#/definitions/CompositeUnitSpec" + "$ref": "#/definitions/ExtendedUnitSpec" } ] }, @@ -10644,6 +12026,55 @@ ], "type": "object" }, + "TopLevelCompositeMarkUnitSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets how the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "background": { + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "$ref": "#/definitions/Data", + "description": "An object describing the data source" + }, + "datasets": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." + }, + "padding": { + "$ref": "#/definitions/Padding", + "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides.\nIf an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" + }, + "usermeta": { + "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, "TopLevelFacetSpec": { "additionalProperties": false, "properties": { @@ -10746,7 +12177,7 @@ "$ref": "#/definitions/LayerSpec" }, { - "$ref": "#/definitions/FacetedUnitSpec" + "$ref": "#/definitions/FacetedExtendedUnitSpec" } ], "description": "A specification of the view that gets faceted." @@ -10782,6 +12213,16 @@ "type": "object" }, "TopLevelFacetedUnitSpec": { + "anyOf": [ + { + "$ref": "#/definitions/TopLevelNormalizedUnitSpec" + }, + { + "$ref": "#/definitions/TopLevelCompositeMarkUnitSpec" + } + ] + }, + "TopLevelNormalizedUnitSpec": { "additionalProperties": false, "properties": { "$schema": { @@ -10821,15 +12262,269 @@ "type": "string" }, "encoding": { - "$ref": "#/definitions/EncodingWithFacet", - "description": "A key-value mapping between encoding channels and definition of fields." + "additionalProperties": false, + "description": "A key-value mapping between encoding channels and definition of fields.", + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ColorValueDefWithCondition" + } + ], + "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"trail\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.\n\n_Note:_\n1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\n2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "column": { + "$ref": "#/definitions/FacetFieldDef", + "description": "Horizontal facets for trellis plots." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDef" + }, + { + "items": { + "$ref": "#/definitions/FieldDef" + }, + "type": "array" + } + ], + "description": "Additional levels of detail for grouping data in aggregate views and\nin line, trail, and area marks without mapping data to a specific visual channel." + }, + "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": { - "$ref": "#/definitions/AnyMark", + "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": { diff --git a/package.json b/package.json index 158782e2a6a..f0ccf691228 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "deploy:gh": "scripts/deploy-gh.sh", "deploy:schema": "scripts/deploy-schema.sh", "preschema": "npm run prebuild", - "schema": "node --stack-size=2800 ./node_modules/.bin/ts-json-schema-generator --no-type-check --path tsconfig.json --type TopLevelSpec > build/vega-lite-schema.json && npm run renameschema && cp build/vega-lite-schema.json _data/", + "schema": "node --stack-size=4000 ./node_modules/.bin/ts-json-schema-generator --no-type-check --path tsconfig.json --type TopLevelSpec > build/vega-lite-schema.json && npm run renameschema && cp build/vega-lite-schema.json _data/", "renameschema": "scripts/rename-schema.sh", "presite": "npm run prebuild && npm run data && npm run build:site && npm run build:toc && npm run build:versions && scripts/create-example-pages", "site": "bundle exec jekyll serve --incremental", diff --git a/scripts/check-schema.sh b/scripts/check-schema.sh index ecb690d6af8..1821abd91e9 100755 --- a/scripts/check-schema.sh +++ b/scripts/check-schema.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -if grep 'Generic.*Spec<' ./build/vega-lite-schema.json +if grep 'Generic[^U].*Spec<' ./build/vega-lite-schema.json then - echo "Generic*Spec in the schema have not been replaced." + echo "Non-Unit Generic Spec in the schema have not been replaced." exit 1 elif grep 'UnitSpec','',g build/vega-lite-schema.json +perl -pi -e s,'\&EmptyObject','',g build/vega-lite-schema.json +perl -pi -e s,'(.*)Encoding\\&FacetMapping\','\1EncodingWithFacet',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,'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,'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 diff --git a/src/channel.ts b/src/channel.ts index 41507801fea..11915c408e9 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -62,10 +62,6 @@ export const X = Channel.X; export const Y = Channel.Y; export const X2 = Channel.X2; export const Y2 = Channel.Y2; -export const XERROR = Channel.XERROR; -export const YERROR = Channel.YERROR; -export const XERROR2 = Channel.XERROR2; -export const YERROR2 = Channel.YERROR2; export const LATITUDE = Channel.LATITUDE; export const LATITUDE2 = Channel.LATITUDE2; @@ -111,10 +107,6 @@ const UNIT_CHANNEL_INDEX: Flag> = { y: 1, x2: 1, y2: 1, - xError: 1, - yError: 1, - xError2: 1, - yError2: 1, ...GEOPOSITION_CHANNEL_INDEX, @@ -180,10 +172,6 @@ export type SingleDefUnitChannel = | 'y' | 'x2' | 'y2' - | 'xError' - | 'yError' - | 'xError2' - | 'yError2' | 'longitude' | 'latitude' | 'longitude2' @@ -237,10 +225,6 @@ const { // x2 and y2 share the same scale as x and y x2: _x2, y2: _y2, - xError: _xError, - yError: _yError, - xError2: _xError2, - yError2: _yError2, latitude: _latitude, longitude: _longitude, latitude2: _latitude2, @@ -409,11 +393,6 @@ function getSupportedMark(channel: Channel): SupportedMark { return {point: 'always', geoshape: 'always'}; case TEXT: return {text: 'always'}; - case XERROR: - case YERROR: - case XERROR2: - case YERROR2: - return {}; } } @@ -429,10 +408,6 @@ export function rangeType(channel: Channel): RangeType { // X2 and Y2 use X and Y scales, so they similarly have continuous range. case X2: case Y2: - case XERROR: - case YERROR: - case XERROR2: - case YERROR2: return undefined; case ROW: diff --git a/src/compile/mark/mark.ts b/src/compile/mark/mark.ts index e2570754f15..464fb47091c 100644 --- a/src/compile/mark/mark.ts +++ b/src/compile/mark/mark.ts @@ -172,10 +172,6 @@ export function pathGroupingFields(mark: Mark, encoding: Encoding): stri case 'href': case 'x2': case 'y2': - case 'xError': - case 'yError': - case 'xError2': - case 'yError2': case 'latitude': case 'longitude': diff --git a/src/compositemark/boxplot.ts b/src/compositemark/boxplot.ts index 8447c49ff21..bb62083e912 100644 --- a/src/compositemark/boxplot.ts +++ b/src/compositemark/boxplot.ts @@ -1,8 +1,7 @@ import {isNumber, isObject} from 'vega-util'; -import {Channel} from '../channel'; import {Config} from '../config'; import {Encoding, extractTransformsFromEncoding} from '../encoding'; -import {PositionFieldDef} from '../fielddef'; +import {Field, PositionFieldDef} from '../fielddef'; import * as log from '../log'; import {isMarkDef, MarkDef} from '../mark'; import {GenericUnitSpec, NormalizedLayerSpec, NormalizedUnitSpec} from '../spec'; @@ -13,7 +12,6 @@ import { compositeMarkContinuousAxis, compositeMarkOrient, CompositeMarkTooltipSummary, - filterUnsupportedChannels, GenericCompositeMarkDef, getCompositeMarkTooltip, makeCompositeAggregatePartFactory, @@ -21,6 +19,10 @@ import { PartsMixins } from './common'; +export type BoxPlotUnitSpec< + EE = {} // extra encoding parameter (for faceted composite unit spec) +> = GenericUnitSpec & EE, BoxPlot | BoxPlotDef>; + export const BOXPLOT: 'boxplot' = 'boxplot'; export type BoxPlot = typeof BOXPLOT; @@ -68,6 +70,8 @@ export type BoxPlotDef = GenericCompositeMarkDef & orient?: Orient; }; +export type BoxPlotEncoding = Pick, 'x' | 'y' | 'color' | 'detail' | 'opacity' | 'size'>; + export interface BoxPlotConfigMixins { /** * Box Config @@ -75,14 +79,10 @@ export interface BoxPlotConfigMixins { boxplot?: BoxPlotConfig; } -const boxPlotSupportedChannels: Channel[] = ['x', 'y', 'color', 'detail', 'opacity', 'size']; - export function normalizeBoxPlot( spec: GenericUnitSpec, BoxPlot | BoxPlotDef>, config: Config ): NormalizedLayerSpec { - spec = filterUnsupportedChannels(spec, boxPlotSupportedChannels, BOXPLOT); - // TODO: use selection const {mark, encoding: _encoding, selection, projection: _p, ...outerSpec} = spec; const markDef: BoxPlotDef = isMarkDef(mark) ? mark : {type: mark}; diff --git a/src/compositemark/common.ts b/src/compositemark/common.ts index 0eff5ed6242..bafea2299f5 100644 --- a/src/compositemark/common.ts +++ b/src/compositemark/common.ts @@ -1,7 +1,6 @@ import {isBoolean, isString} from 'vega-util'; import {CompositeMark, CompositeMarkDef} from '.'; -import {Channel} from '../channel'; -import {Encoding, fieldDefs, reduce} from '../encoding'; +import {Encoding, fieldDefs} from '../encoding'; import { Field, FieldDefBase, @@ -223,25 +222,3 @@ export function compositeMarkOrient( throw new Error('Need a valid continuous axis for ' + compositeMark + 's'); } } - -export function filterUnsupportedChannels>( - spec: GenericUnitSpec, M | MD>, - supportedChannels: Channel[], - compositeMark: M -): GenericUnitSpec, M | MD> { - return { - ...spec, - encoding: reduce( - spec.encoding, - (newEncoding, fieldDef, channel) => { - if (supportedChannels.indexOf(channel) > -1) { - newEncoding[channel] = fieldDef; - } else { - log.warn(log.message.incompatibleChannel(channel, compositeMark)); - } - return newEncoding; - }, - {} - ) - }; -} diff --git a/src/compositemark/errorband.ts b/src/compositemark/errorband.ts index 051eab75ac2..c3379f7722d 100644 --- a/src/compositemark/errorband.ts +++ b/src/compositemark/errorband.ts @@ -1,12 +1,17 @@ import {Config} from '../config'; import {Encoding} from '../encoding'; +import {Field} from '../fielddef'; import * as log from '../log'; import {MarkDef} from '../mark'; import {GenericUnitSpec, NormalizedLayerSpec} from '../spec'; import {Flag, keys} from '../util'; import {Interpolate, Orient} from '../vega.schema'; import {GenericCompositeMarkDef, makeCompositeAggregatePartFactory, PartsMixins} from './common'; -import {ErrorBarCenter, ErrorBarExtent, errorBarParams} from './errorbar'; +import {ErrorBarCenter, ErrorBarExtent, errorBarParams, ErrorEncoding} from './errorbar'; + +export type ErrorBandUnitSpec< + EE = {} // extra encoding parameter (for faceted composite unit spec) +> = GenericUnitSpec & EE, ErrorBand | ErrorBandDef>; export const ERRORBAND: 'errorband' = 'errorband'; export type ErrorBand = typeof ERRORBAND; diff --git a/src/compositemark/errorbar.ts b/src/compositemark/errorbar.ts index c42a8718169..479d8e495d4 100644 --- a/src/compositemark/errorbar.ts +++ b/src/compositemark/errorbar.ts @@ -1,5 +1,4 @@ import {AggregateOp} from 'vega'; -import {Channel} from '../channel'; import {Config} from '../config'; import {Data} from '../data'; import {Encoding, extractTransformsFromEncoding} from '../encoding'; @@ -10,7 +9,8 @@ import { isFieldDef, PositionFieldDef, SecondaryFieldDef, - title + title, + ValueDef } from '../fielddef'; import * as log from '../log'; import {isMarkDef, MarkDef} from '../mark'; @@ -23,7 +23,6 @@ import { compositeMarkContinuousAxis, compositeMarkOrient, CompositeMarkTooltipSummary, - filterUnsupportedChannels, GenericCompositeMarkDef, getCompositeMarkTooltip, makeCompositeAggregatePartFactory, @@ -31,6 +30,10 @@ import { } from './common'; import {ErrorBand, ErrorBandDef} from './errorband'; +export type ErrorBarUnitSpec< + EE = {} // extra encoding parameter (for faceted composite unit spec) +> = GenericUnitSpec & EE, ErrorBar | ErrorBarDef>; + export const ERRORBAR: 'errorbar' = 'errorbar'; export type ErrorBar = typeof ERRORBAR; @@ -46,6 +49,31 @@ const ERRORBAR_PART_INDEX: Flag = { rule: 1 }; +export interface ErrorEncoding + extends Pick, 'x' | 'y' | 'x2' | 'y2' | 'color' | 'detail' | 'opacity'> { + /** + * Error value of x coordinates for error specified `"errorbar"` and `"errorband"`. + */ + xError?: SecondaryFieldDef | ValueDef; + + /** + * Secondary error value of x coordinates for error specified `"errorbar"` and `"errorband"`. + */ + // `xError2` cannot have type as it should have the same type as `xError` + xError2?: SecondaryFieldDef | ValueDef; + + /** + * Error value of y coordinates for error specified `"errorbar"` and `"errorband"`. + */ + yError?: SecondaryFieldDef | ValueDef; + + /** + * Secondary error value of y coordinates for error specified `"errorbar"` and `"errorband"`. + */ + // `yError2` cannot have type as it should have the same type as `yError` + yError2?: SecondaryFieldDef | ValueDef; +} + export const ERRORBAR_PARTS = keys(ERRORBAR_PART_INDEX); export type ErrorBarPartsMixins = PartsMixins; @@ -91,7 +119,7 @@ export interface ErrorBarConfigMixins { } export function normalizeErrorBar( - spec: GenericUnitSpec, ErrorBar | ErrorBarDef>, + spec: GenericUnitSpec, ErrorBar | ErrorBarDef>, config: Config ): NormalizedLayerSpec { const { @@ -143,7 +171,7 @@ export function normalizeErrorBar( } function errorBarOrientAndInputType( - spec: GenericUnitSpec, ErrorBar | ErrorBand | ErrorBarDef | ErrorBandDef>, + spec: GenericUnitSpec, ErrorBar | ErrorBand | ErrorBarDef | ErrorBandDef>, compositeMark: ErrorBar | ErrorBand ): { orient: Orient; @@ -237,7 +265,7 @@ function errorBarOrientAndInputType( } } -function errorBarIsInputTypeRaw(encoding: Encoding): boolean { +function errorBarIsInputTypeRaw(encoding: ErrorEncoding): boolean { return ( (isFieldDef(encoding.x) || isFieldDef(encoding.y)) && !isFieldDef(encoding.x2) && @@ -249,11 +277,11 @@ function errorBarIsInputTypeRaw(encoding: Encoding): boolean { ); } -function errorBarIsInputTypeAggregatedUpperLower(encoding: Encoding): boolean { +function errorBarIsInputTypeAggregatedUpperLower(encoding: ErrorEncoding): boolean { return isFieldDef(encoding.x2) || isFieldDef(encoding.y2); } -function errorBarIsInputTypeAggregatedError(encoding: Encoding): boolean { +function errorBarIsInputTypeAggregatedError(encoding: ErrorEncoding): boolean { return ( isFieldDef(encoding.xError) || isFieldDef(encoding.xError2) || @@ -262,25 +290,11 @@ function errorBarIsInputTypeAggregatedError(encoding: Encoding): boolean ); } -export const errorBarSupportedChannels: Channel[] = [ - 'x', - 'y', - 'x2', - 'y2', - 'xError', - 'yError', - 'xError2', - 'yError2', - 'color', - 'detail', - 'opacity' -]; - export function errorBarParams< M extends ErrorBar | ErrorBand, MD extends GenericCompositeMarkDef & (ErrorBarDef | ErrorBandDef) >( - spec: GenericUnitSpec, M | MD>, + spec: GenericUnitSpec, M | MD>, compositeMark: M, config: Config ): { @@ -288,7 +302,7 @@ export function errorBarParams< groupby: string[]; continuousAxisChannelDef: PositionFieldDef; continuousAxis: 'x' | 'y'; - encodingWithoutContinuousAxis: Encoding; + encodingWithoutContinuousAxis: ErrorEncoding; ticksOrient: Orient; markDef: MD; outerSpec: { @@ -300,10 +314,8 @@ export function errorBarParams< width?: number; height?: number; }; - tooltipEncoding: Encoding; + tooltipEncoding: ErrorEncoding; } { - spec = filterUnsupportedChannels(spec, errorBarSupportedChannels, compositeMark); - // TODO: use selection const {mark, encoding, selection, projection: _p, ...outerSpec} = spec; const markDef: MD = isMarkDef(mark) ? mark : ({type: mark} as MD); @@ -357,7 +369,7 @@ export function errorBarParams< const aggregate: AggregatedFieldDef[] = [...oldAggregate, ...errorBarSpecificAggregate]; const groupby: string[] = inputType !== 'raw' ? [] : oldGroupBy; - const tooltipEncoding: Encoding = getCompositeMarkTooltip( + const tooltipEncoding: ErrorEncoding = getCompositeMarkTooltip( tooltipSummary, continuousAxisChannelDef, encodingWithoutContinuousAxis, diff --git a/src/compositemark/index.ts b/src/compositemark/index.ts index 74a6df08436..881444020be 100644 --- a/src/compositemark/index.ts +++ b/src/compositemark/index.ts @@ -2,16 +2,33 @@ import {Config} from '../config'; import {AnyMark, isMarkDef} from '../mark'; import {GenericUnitSpec, NormalizedLayerSpec} from '../spec'; import {keys} from '../util'; -import {BOXPLOT, BoxPlot, BOXPLOT_PARTS, BoxPlotConfigMixins, BoxPlotDef, normalizeBoxPlot} from './boxplot'; +import { + BOXPLOT, + BoxPlot, + BOXPLOT_PARTS, + BoxPlotConfigMixins, + BoxPlotDef, + BoxPlotUnitSpec, + normalizeBoxPlot +} from './boxplot'; import { ERRORBAND, ErrorBand, ERRORBAND_PARTS, ErrorBandConfigMixins, ErrorBandDef, + ErrorBandUnitSpec, normalizeErrorBand } from './errorband'; -import {ERRORBAR, ErrorBar, ERRORBAR_PARTS, ErrorBarConfigMixins, ErrorBarDef, normalizeErrorBar} from './errorbar'; +import { + ERRORBAR, + ErrorBar, + ERRORBAR_PARTS, + ErrorBarConfigMixins, + ErrorBarDef, + ErrorBarUnitSpec, + normalizeErrorBar +} from './errorbar'; export {BoxPlotConfig} from './boxplot'; export {ErrorBandConfigMixins} from './errorband'; @@ -36,6 +53,9 @@ export function remove(mark: string) { delete compositeMarkRegistry[mark]; } +export type CompositeMarkUnitSpec< + EE = {} // extra encoding parameter (for faceted composite unit spec) +> = ErrorBarUnitSpec | ErrorBandUnitSpec | BoxPlotUnitSpec; export type CompositeMark = BoxPlot | ErrorBar | ErrorBand; export function getAllCompositeMarks() { diff --git a/src/encoding.ts b/src/encoding.ts index 1157a65e1e2..abf93c79e6f 100644 --- a/src/encoding.ts +++ b/src/encoding.ts @@ -80,28 +80,6 @@ export interface Encoding { // `y2` cannot have type as it should have the same type as `y` y2?: SecondaryFieldDef | ValueDef; - /** - * Error value of x coordinates for error specified `"errorbar"` and `"errorband"`. - */ - xError?: SecondaryFieldDef | ValueDef; - - /** - * Secondary error value of x coordinates for error specified `"errorbar"` and `"errorband"`. - */ - // `xError2` cannot have type as it should have the same type as `xError` - xError2?: SecondaryFieldDef | ValueDef; - - /** - * Error value of y coordinates for error specified `"errorbar"` and `"errorband"`. - */ - yError?: SecondaryFieldDef | ValueDef; - - /** - * Secondary error value of y coordinates for error specified `"errorbar"` and `"errorband"`. - */ - // `yError2` cannot have type as it should have the same type as `yError` - yError2?: SecondaryFieldDef | ValueDef; - /** * Longitude position of geographically projected marks. */ diff --git a/src/mark.ts b/src/mark.ts index 5e7e3acd598..d332675df51 100644 --- a/src/mark.ts +++ b/src/mark.ts @@ -145,7 +145,7 @@ export function isMarkDef(mark: AnyMark): mark is MarkDef | CompositeMarkDef { const PRIMITIVE_MARK_INDEX = toSet(PRIMITIVE_MARKS); -export function isPrimitiveMark(mark: CompositeMark | CompositeMarkDef | Mark | MarkDef): mark is Mark { +export function isPrimitiveMark(mark: AnyMark): mark is Mark { const markType = isMarkDef(mark) ? mark.type : mark; return markType in PRIMITIVE_MARK_INDEX; } diff --git a/src/normalize.ts b/src/normalize.ts index 07e26ab6ec7..5289b660a88 100644 --- a/src/normalize.ts +++ b/src/normalize.ts @@ -18,9 +18,9 @@ import { } from './mark'; import {Projection} from './projection'; import { - CompositeUnitSpec, ExtendedLayerSpec, - FacetedCompositeUnitSpec, + ExtendedUnitSpec, + FacetedExtendedUnitSpec, GenericFacetSpec, GenericHConcatSpec, GenericRepeatSpec, @@ -46,7 +46,7 @@ import {stack} from './stack'; import {keys, omit, pick} from './util'; export function normalizeTopLevelSpec( - spec: TopLevelSpec | GenericSpec | FacetedCompositeUnitSpec, + spec: TopLevelSpec | GenericSpec | FacetedExtendedUnitSpec, config: Config ): TopLevel { return normalize(spec, config); @@ -56,7 +56,7 @@ export function normalizeTopLevelSpec( * Decompose extended unit specs into composition of pure unit specs. */ function normalize( - spec: GenericSpec | FacetedCompositeUnitSpec, + spec: GenericSpec | FacetedExtendedUnitSpec, config: Config ): NormalizedSpec { if (isFacetSpec(spec)) { @@ -87,7 +87,7 @@ function normalize( } function normalizeFacet( - spec: GenericFacetSpec, + spec: GenericFacetSpec, config: Config ): NormalizedFacetSpec { const {spec: subspec, ...rest} = spec; @@ -149,7 +149,7 @@ function normalizeLayer( } function normalizeRepeat( - spec: GenericRepeatSpec, + spec: GenericRepeatSpec, config: Config ): NormalizedRepeatSpec { const {spec: subspec, ...rest} = spec; @@ -160,7 +160,7 @@ function normalizeRepeat( } function normalizeVConcat( - spec: GenericVConcatSpec, + spec: GenericVConcatSpec, config: Config ): NormalizedConcatSpec { const {vconcat: vconcat, ...rest} = spec; @@ -171,7 +171,7 @@ function normalizeVConcat( } function normalizeHConcat( - spec: GenericHConcatSpec, + spec: GenericHConcatSpec, config: Config ): NormalizedConcatSpec { const {hconcat: hconcat, ...rest} = spec; @@ -181,7 +181,7 @@ function normalizeHConcat( }; } -function normalizeFacetedUnit(spec: FacetedCompositeUnitSpec, config: Config): NormalizedFacetSpec { +function normalizeFacetedUnit(spec: FacetedExtendedUnitSpec, config: Config): NormalizedFacetSpec { // New encoding in the inside spec should not contain row / column // as row/column should be moved to facet const {row: row, column: column, ...encoding} = spec.encoding; diff --git a/src/spec/index.ts b/src/spec/index.ts index cf631d20d55..beaec8f177b 100644 --- a/src/spec/index.ts +++ b/src/spec/index.ts @@ -19,7 +19,13 @@ import {GenericFacetSpec, isFacetSpec, NormalizedFacetSpec} from './facet'; import {ExtendedLayerSpec, GenericLayerSpec, isLayerSpec, NormalizedLayerSpec} from './layer'; import {GenericRepeatSpec, isRepeatSpec, NormalizedRepeatSpec} from './repeat'; import {TopLevel} from './toplevel'; -import {FacetedCompositeUnitSpec, GenericUnitSpec, isUnitSpec, NormalizedUnitSpec} from './unit'; +import { + FacetedExtendedUnitSpec, + GenericUnitSpec, + isUnitSpec, + NormalizedUnitSpec, + TopLevelFacetedUnitSpec +} from './unit'; export {normalizeTopLevelSpec as normalize} from '../normalize'; export {BaseSpec, DataMixins, LayoutSizeMixins} from './base'; @@ -35,7 +41,7 @@ export {GenericFacetSpec, isFacetSpec, NormalizedFacetSpec} from './facet'; export {ExtendedLayerSpec, GenericLayerSpec, isLayerSpec, NormalizedLayerSpec} from './layer'; export {GenericRepeatSpec, isRepeatSpec, NormalizedRepeatSpec} from './repeat'; export {TopLevel} from './toplevel'; -export {CompositeUnitSpec, FacetedCompositeUnitSpec, GenericUnitSpec, isUnitSpec, NormalizedUnitSpec} from './unit'; +export {ExtendedUnitSpec, FacetedExtendedUnitSpec, GenericUnitSpec, isUnitSpec, NormalizedUnitSpec} from './unit'; /** * Any specification in Vega-Lite. @@ -53,8 +59,7 @@ export type GenericSpec, L extends GenericLa */ export type NormalizedSpec = GenericSpec; -export type TopLevelFacetedUnitSpec = TopLevel & DataMixins; -export type TopLevelFacetSpec = TopLevel> & DataMixins; +export type TopLevelFacetSpec = TopLevel> & DataMixins; /** * A Vega-Lite top-level specification. @@ -65,9 +70,9 @@ export type TopLevelSpec = | TopLevelFacetedUnitSpec | TopLevelFacetSpec | TopLevel - | TopLevel> - | TopLevel> - | TopLevel>; + | TopLevel> + | TopLevel> + | TopLevel>; /* Custom type guards */ @@ -123,7 +128,7 @@ export function fieldDefs(spec: GenericSpec): TypedFieldDef[] { return vals(fieldDefIndex(spec)); } -export function isStacked(spec: TopLevel, config?: Config): boolean { +export function isStacked(spec: TopLevel, config?: Config): boolean { config = config || spec.config; if (isPrimitiveMark(spec.mark)) { return stack(spec.mark, spec.encoding, config ? config.stack : undefined) !== null; diff --git a/src/spec/layer.ts b/src/spec/layer.ts index b33b2a0c2aa..99d501cb9a3 100644 --- a/src/spec/layer.ts +++ b/src/spec/layer.ts @@ -3,7 +3,7 @@ import {Field} from '../fielddef'; import {Projection} from '../projection'; import {Resolve} from '../resolve'; import {BaseSpec, LayerUnitMixins} from './base'; -import {CompositeUnitSpec, GenericUnitSpec, NormalizedUnitSpec} from './unit'; +import {ExtendedUnitSpec, GenericUnitSpec, NormalizedUnitSpec} from './unit'; /** * Base interface for a layer specification. @@ -25,7 +25,7 @@ export interface GenericLayerSpec> extends B /** * Layer Spec with `encoding` and `projection` shorthands that will be applied to underlying unit (single-view) specifications. */ -export interface ExtendedLayerSpec extends GenericLayerSpec { +export interface ExtendedLayerSpec extends GenericLayerSpec { /** * A shared key-value mapping between encoding channels and definition of fields in the underlying layers. */ diff --git a/src/spec/unit.ts b/src/spec/unit.ts index bc08d1d9494..492e827398c 100644 --- a/src/spec/unit.ts +++ b/src/spec/unit.ts @@ -1,13 +1,12 @@ -import {Encoding, EncodingWithFacet} from '../encoding'; +import {CompositeMarkUnitSpec} from '../compositemark/index'; +import {Encoding} from '../encoding'; import {Field} from '../fielddef'; -import {AnyMark, Mark, MarkDef} from '../mark'; +import {Mark, MarkDef} from '../mark'; import {Projection} from '../projection'; import {SelectionDef} from '../selection'; -import {BaseSpec, LayerUnitMixins} from './base'; - -export {normalizeTopLevelSpec as normalize} from '../normalize'; -export {BaseSpec, DataMixins, LayoutSizeMixins} from './base'; -export {TopLevel} from './toplevel'; +import {BaseSpec, DataMixins, LayerUnitMixins} from './base'; +import {FacetMapping} from './facet'; +import {TopLevel} from './toplevel'; /** * Base interface for a unit (single-view) specification. @@ -39,18 +38,39 @@ export interface GenericUnitSpec, M> extends BaseSpec, L /** * A unit specification without any shortcut/expansion syntax. */ -export type NormalizedUnitSpec = GenericUnitSpec, Mark | MarkDef>; +export type NormalizedUnitSpec< + /** Extra Encoding */ + EE = {} +> = GenericUnitSpec & EE, Mark | MarkDef>; + +/* tslint:disable */ +// Need to declare empty object so the generated schema has a reasonable name for ExtendedUnitSpec +export interface EmptyObject {} +/* tslint:enable */ /** - * Unit spec that can have a composite mark. + * Unit spec that can be normalized/expanded into a layer spec or another unit spec. */ -export type CompositeUnitSpec = GenericUnitSpec, AnyMark>; +export type ExtendedUnitSpec< + /** Extra Encoding */ + EE = EmptyObject +> = NormalizedUnitSpec | CompositeMarkUnitSpec; /** - * Unit spec that can have a composite mark and row or column channels. + * Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec). */ -export type FacetedCompositeUnitSpec = GenericUnitSpec, AnyMark>; +export type FacetedExtendedUnitSpec = ExtendedUnitSpec>; + +// Note: The following three lines are equivalent to: +// ``` +// export type TopLevelFacetedUnitSpec = TopLevel & DataMixins; +// ``` +// However, the JSON schema generator does not support the simpler syntax + +export type TopLevelNormalizedUnitSpec = TopLevel>> & DataMixins; +export type TopLevelCompositeMarkUnitSpec = TopLevel>> & DataMixins; +export type TopLevelFacetedUnitSpec = TopLevelNormalizedUnitSpec | TopLevelCompositeMarkUnitSpec; -export function isUnitSpec(spec: BaseSpec): spec is FacetedCompositeUnitSpec | NormalizedUnitSpec { +export function isUnitSpec(spec: BaseSpec): spec is FacetedExtendedUnitSpec | NormalizedUnitSpec { return !!spec['mark']; } diff --git a/src/validate.ts b/src/validate.ts index 9f4414b85ab..e0b4098d298 100644 --- a/src/validate.ts +++ b/src/validate.ts @@ -1,7 +1,6 @@ import {toSet} from 'vega-util'; -import {isMarkDef} from './mark'; -import {BAR} from './mark'; -import {FacetedCompositeUnitSpec} from './spec'; +import {BAR, isMarkDef} from './mark'; +import {FacetedExtendedUnitSpec} from './spec'; // TODO: move to vl.spec.validator? export interface RequiredChannelMap { @@ -57,7 +56,7 @@ export const DEFAULT_SUPPORTED_CHANNEL_TYPE: SupportedChannelMap = { * or null if the encoding is valid. */ export function getEncodingMappingError( - spec: FacetedCompositeUnitSpec, + spec: FacetedExtendedUnitSpec, requiredChannelMap: RequiredChannelMap = DEFAULT_REQUIRED_CHANNEL_MAP, supportedChannelMap: SupportedChannelMap = DEFAULT_SUPPORTED_CHANNEL_TYPE ) { diff --git a/test/compositemark/errorbar.test.ts b/test/compositemark/errorbar.test.ts index 614b143920c..35bc12ca25e 100644 --- a/test/compositemark/errorbar.test.ts +++ b/test/compositemark/errorbar.test.ts @@ -1,11 +1,12 @@ /* tslint:disable:quotemark */ import {AggregateOp} from 'vega'; import {ErrorBarCenter, ErrorBarExtent} from '../../src/compositemark/errorbar'; +import {CompositeMarkUnitSpec} from '../../src/compositemark/index'; import {defaultConfig} from '../../src/config'; import {isFieldDef} from '../../src/fielddef'; import * as log from '../../src/log'; import {isMarkDef} from '../../src/mark'; -import {CompositeUnitSpec, ExtendedLayerSpec, GenericSpec, isLayerSpec, isUnitSpec, normalize} from '../../src/spec'; +import {ExtendedLayerSpec, GenericSpec, isLayerSpec, isUnitSpec, normalize} from '../../src/spec'; import {isAggregate, isCalculate, Transform} from '../../src/transform'; import {some} from '../../src/util'; @@ -614,7 +615,7 @@ describe('normalizeErrorBar for all possible extents and centers with raw data i for (const center of centers) { for (const extent of extents) { - const spec: GenericSpec = { + const spec: GenericSpec = { data: {url: 'data/population.json'}, mark: {type, ...(center ? {center} : {}), ...(extent ? {extent} : {})}, encoding: { @@ -900,29 +901,6 @@ describe('normalizeErrorBar with aggregated upper and lower bound input', () => }) ); - it( - 'should produce a warning if there is an unsupported channel in encoding', - log.wrap(localLogger => { - const size = 'size'; - - normalize( - { - data, - mark, - encoding: { - x: {field: 'age', type: 'ordinal'}, - y: {field: 'people', type: 'quantitative'}, - y2: {field: 'people2', type: 'quantitative', aggregate: 'min'}, - size: {value: 10} - } - }, - defaultConfig - ); - - expect(localLogger.warns[0]).toEqual(log.message.incompatibleChannel(size, mark)); - }) - ); - it('should produce a correct tooltip title for ranged errorbar', () => { const outputSpec = normalize( {